tiko_heating_api icon indicating copy to clipboard operation
tiko_heating_api copied to clipboard

besoin d'aide pour débutant

Open phid78 opened this issue 2 years ago • 127 comments

Bonjour, Je n'y connais malheureusement rien et tente d'apprendre. J'ai fait les étapes : 1-2-3-4 (mais j'ai l'impression que je n'ai pas tout). J'ai compris qu'il fallait heberger le fichier tiko.php. J'ai un site sur 02switch, j'ai crée un sous domaine et maintenant.... que vais je faire..... Me suffit il de mettre le fichier php a la racine de mon sous domaine ? En vous remerciant pour votre aide.

phid78 avatar Nov 16 '23 09:11 phid78

Bonjour, oui c'est exactement ça, ensuite:

1- vous lancez le script (sous-domaine.votredomaine.com/tiko.php), vous serez redirigé vers la page d'installation qui demande vos login Tiko

2- une fois renseigné, ça crée un fichier de config avec ces infos, et vous détaille les étapes suivantes (les actions à réaliser directement dans home aussi), et vous donne le code:

  • du package Tiko à installer sur H.A
  • des cartes lovelace à installer pour piloter vous radiateurs depuis l'interface de Home Assistant

Le jeu. 16 nov. 2023, 10:13, phid78 @.***> a écrit :

Bonjour, Je n'y connais malheureusement rien et tente d'apprendre. J'ai fait les étapes : 1-2-3-4. J'ai compris qu'il fallait heberger le fichier tiko.php. J'ai un site sur 02switch, j'ai crée un sous domaine et maintenant.... que vais je faire..... Me suffit il de mettre le fichier php a la racine de mon sous domaine ? En vous remerciant pour votre aide.

— Reply to this email directly, view it on GitHub https://github.com/noiwid/tiko_heating_api/issues/12, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFML5A4TDGANUXHTPED3IM3YEXKL3AVCNFSM6AAAAAA7NZYMXSVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE4TMNBQGY4TGMI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

noiwid avatar Nov 16 '23 11:11 noiwid

Ok, j'ai mis mon fichier a la racine de mon sous domaine, j'ai modifié le php comme je suis via mon pilotage elect via engie par : /////////////// // FUNCTION ////////////// if(($hash and $_REQUEST["hash"]==$hash) or $_REQUEST["install"]){ function f_tiko($json, $token=false, $account_id=false){ if(!$account_id) { $url = "https://portal-engie.tiko.ch"; $method = "POST"; } else { $url = "https://portal-engie.tiko.ch".$account_id."/consumption_summary/"; $method = "GET"; } $headers = array( 'Content-Type:application/json', // 'User-agent:Mozilla/5.0 (Linux; Android 13; Pixel 4a Build/T1B3.221003.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/106.0.5249.126 Mobile Safari/537.36' // needed with tiko.ch api endpoint

J'ai bien un fichier .env et spyc qui s'est creer. Quand je vais sur http://sous-domaine/tiko.php?install=true&hash=clé du fichier .env ca me rammene a la page 1 saisissez vos identifiant tiko.

Je precise que j'ai été sur la page https://portal-engie.tiko.ch, mis mes identifiant et j'accede bien a mon installation

phid78 avatar Nov 16 '23 13:11 phid78

alors en remplacant par : if(!$account_id) { $url = "https://portal-engie.tiko.ch/api/v3/graphql/"; $method = "POST"; } else { $url = "https://portal-engie.tiko.ch/api/v3/properties/".$account_id."/consumption_summary/"; $method = "GET"; } J'ai bien la page suivante avec la config. Quand j'ajoute packages: !include_dir_merge_named packages/ dans /homeassistant/configuration.yaml Et que je verifie, j'ai le message d'erreur : Configuration non valide ! Integration error: packages - Integration 'packages' not found. Pourtant j'ai bien creer mon .yaml dans /homeassistant/packages/tiko/tiko.yaml

phid78 avatar Nov 16 '23 18:11 phid78

ok, alors en ajoutant dans /homeassistant/configuration.yaml homeassistant: packages: !include_dir_named packages/ ca fonctionne, MErci !

phid78 avatar Nov 16 '23 20:11 phid78

Petite question : si je veux m'assurer que le radiateur ne chauffera pas plus qu'une certaine température, je peux rajouter ca dans le fichier ? id: set_temp_piece alias: set_temp_piece description: > on climate update, send update command to endpoint trigger: - platform: state entity_id: - climate..piece data: target_temp_high: 23 target_temp_low: 15 attribute: temperature

phid78 avatar Nov 17 '23 10:11 phid78

apparement ca fonctionne pas. Et je viens de me rendre compte que (en configuration de base) lorsque je demande une temperature dans HA, l'info est bien transmise a l'appli et au radiateur, mais dans la minute qui suit, l'appli rebascule sur son reglage d'origine et en fonction arrete la chauffe. Je desactive donc l'appli dans l'attente d'une solution @paulchartres

phid78 avatar Nov 17 '23 11:11 phid78

Bonjour @phid78, avez-vous des erreurs liées au package TIKO dans vos logs Home Assistant?

noiwid avatar Nov 17 '23 12:11 noiwid

non, tout a l'air de bien fonctionner sur home assistant C'est comme ci la programmation faite sur leur appli prenait le pas sur la demande faites via HA

phid78 avatar Nov 17 '23 13:11 phid78

Le process tel qu'il est prévu est le suivant :

Quand on change de temperature sur H.A, ca change en live les infos de l'entite climate de H.A, et appel mon gateway pour transmettre cette info à TIKO, ce qui impacte les radiateurs (et l'APP TIKO). Toutes les 60 secondes, mon package remet à jour tiko_settings qui contient également les infos de température récupérés par l'API de TIKO.

En théorie, que la température ait été définie par un canal (H.A) ou par l'autre (l'APP TIKO), ca revient au même car la finalité est de transmettre la valeur à TIKO.

Je constate le même problème que toi depuis quelques jours, mes radiateurs repassent à des temperatures cibles qui ne sont pas celles que j'ai demandé dès que je rallume mon package TIKO (ce qui sous entend que c'est lui qui renvoie cette mauvaise info), je me pencherai ce week-end dessus pour comprendre d'ou sort cette valeur. L'APP TIKO vient d'évoluer, il est tout à fait possible qu'il faille que j'adapte légèrement les webservices pour passer des nouvelles infos à leur API.... to be continued!

Tu es sûr que tu ne vois aucun log d'erreur sur H.A lié au package TIKO ? (Settings -> System -> Logs) Attention si tu les colles ici à masquer ton domaine et ton token :)

noiwid avatar Nov 17 '23 14:11 noiwid

j"ai reactivé l'integration, relancer mon home assistant et j'obtiens ceci (merci de m'avoir dit ou trouver les logs ;) ) : Au demarrage de l'appli rien. Quand je change la temperature d'une piece : 2023-11-17 16:37:09.366 WARNING (MainThread) [homeassistant.components.automation.set_temp_piece_1] set_temp_piece_1: Already running 2023-11-17 16:39:14.661 WARNING (MainThread) [homeassistant.components.command_line] Updating Command Line Switch Radiateurs on/off took longer than the scheduled update interval 0:01:00

phid78 avatar Nov 17 '23 15:11 phid78

2023-11-17 16:37:09.366 WARNING (MainThread) [homeassistant.components.automation.set_temp_piece_1] set_temp_piece_1: Already running 2023-11-17 16:39:14.661 WARNING (MainThread) [homeassistant.components.command_line] Updating Command Line Switch Radiateurs on/off took longer than the scheduled update interval 0:01:00 2023-11-17 16:54:01.301 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'None' has no attribute 'absence' when rendering '{{value_json["absence"]}}' 2023-11-17 16:54:01.302 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'None' has no attribute 'absence' when rendering '{% if (value_json.absence) %} mdi:door-closed-lock {% else %} mdi:door {% endif %}' 2023-11-17 17:00:15.316 ERROR (SyncWorker_9) [homeassistant.components.command_line.utils] Timeout for command: curl -k -g 'https://IP/tiko.php?hash=token' 2023-11-17 17:00:15.318 ERROR (SyncWorker_4) [homeassistant.components.command_line.utils] Timeout for command: curl -k -g 'https://IP/tiko.php?hash=token' 2023-11-17 17:00:15.608 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{% if (value_json.disableHeating) %} mdi:radiator-off {% else %} mdi:radiator-off {% endif %}' 2023-11-17 17:00:15.609 ERROR (MainThread) [homeassistant.helpers.switch] Error rendering icon template for switch.radiateurs_off: UndefinedError: 'value_json' is undefined 2023-11-17 17:00:15.613 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{% if (value_json.absence) %} mdi:door-closed-lock {% else %} mdi:door {% endif %}' 2023-11-17 17:00:15.613 ERROR (MainThread) [homeassistant.helpers.switch] Error rendering icon template for switch.radiateurs_absence: UndefinedError: 'value_json' is undefined 2023-11-17 17:05:26.911 ERROR (SyncWorker_7) [homeassistant.components.command_line.utils] Timeout for command: curl -k -s 'https://IP/tiko.php?hash=token' 2023-11-17 17:05:26.912 WARNING (MainThread) [homeassistant.components.command_line] Empty reply found when expecting JSON data 2023-11-17 17:05:26.931 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_1] sync_temp_piece_1: Error executing script. Invalid data for call_service at pos 1: expected float for dictionary value @ data['temperature'] 2023-11-17 17:05:26.931 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_2] sync_temp_piece_2: Error executing script. Invalid data for call_service at pos 1: expected float for dictionary value @ data['temperature'] 2023-11-17 17:05:26.932 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_3] sync_temp_piece_3: Error executing script. Invalid data for call_service at pos 1: expected float for dictionary value @ data['temperature'] 2023-11-17 17:05:26.932 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_4] sync_temp_piece_4: Error executing script. Invalid data for call_service at pos 1: expected float for dictionary value @ data['temperature'] 2023-11-17 17:05:26.934 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_1] Error while executing automation automation.sync_temp_piece_1: expected float for dictionary value @ data['temperature'] 2023-11-17 17:05:26.935 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_2] Error while executing automation automation.sync_temp_piece_2: expected float for dictionary value @ data['temperature'] 2023-11-17 17:05:26.935 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_3] Error while executing automation automation.sync_temp_piece_3: expected float for dictionary value @ data['temperature'] 2023-11-17 17:05:26.935 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_4] Error while executing automation automation.sync_temp_piece_4: expected float for dictionary value @ data['temperature'] 2023-11-17 17:21:15.226 ERROR (SyncWorker_4) [homeassistant.components.command_line.utils] Timeout for command: curl -k -g 'https://IP/tiko.php?hash=token' 2023-11-17 17:21:15.229 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{% if (value_json.disableHeating) %} mdi:radiator-off {% else %} mdi:radiator-off {% endif %}' 2023-11-17 17:21:15.230 ERROR (MainThread) [homeassistant.helpers.switch] Error rendering icon template for switch.radiateurs_on_off: UndefinedError: 'value_json' is undefined 2023-11-17 17:21:15.262 ERROR (SyncWorker_2) [homeassistant.components.command_line.utils] Timeout for command: curl -k -g 'https://IP/tiko.php?hash=token' 2023-11-17 17:21:15.264 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{% if (value_json.disableHeating) %} mdi:radiator-off {% else %} mdi:radiator-off {% endif %}' 2023-11-17 17:21:15.264 ERROR (MainThread) [homeassistant.helpers.switch] Error rendering icon template for switch.radiateurs_off: UndefinedError: 'value_json' is undefined 2023-11-17 17:21:15.265 ERROR (SyncWorker_0) [homeassistant.components.command_line.utils] Timeout for command: curl -k -g 'https://IP/tiko.php?hash=token' 2023-11-17 17:21:15.268 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{% if (value_json.boost) %} mdi:sun-thermometer {% else %} mdi:lightning-bolt-outline {% endif %}' 2023-11-17 17:21:15.269 ERROR (MainThread) [homeassistant.helpers.switch] Error rendering icon template for switch.radiateurs_boost: UndefinedError: 'value_json' is undefined 2023-11-17 17:21:15.273 ERROR (SyncWorker_8) [homeassistant.components.command_line.utils] Timeout for command: curl -k -g 'https://IP/tiko.php?hash=token' 2023-11-17 17:21:15.275 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{% if (value_json.absence) %} mdi:door-closed-lock {% else %} mdi:door {% endif %}' 2023-11-17 17:21:15.275 ERROR (MainThread) [homeassistant.helpers.switch] Error rendering icon template for switch.radiateurs_absence: UndefinedError: 'value_json' is undefined 2023-11-17 17:21:15.279 ERROR (SyncWorker_15) [homeassistant.components.command_line.utils] Timeout for command: curl -k -g 'https://IP/tiko.php?hash=token' 2023-11-17 17:21:15.281 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{% if (value_json.frost) %} mdi:snowflake-thermometer {% else %} mdi:snowflake-thermometer {% endif %}' 2023-11-17 17:21:15.281 ERROR (MainThread) [homeassistant.helpers.switch] Error rendering icon template for switch.radiateurs_hors_gel: UndefinedError: 'value_json' is undefined 2023-11-17 17:21:26.918 ERROR (SyncWorker_3) [homeassistant.components.command_line.utils] Timeout for command: curl -k -s 'https://IP/tiko.php?hash=token' 2023-11-17 17:21:26.920 WARNING (MainThread) [homeassistant.components.command_line] Empty reply found when expecting JSON data 2023-11-17 17:21:26.950 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_1] sync_temp_piece_1: Error executing script. Invalid data for call_service at pos 1: expected float for dictionary value @ data['temperature'] 2023-11-17 17:21:26.951 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_2] sync_temp_piece_2: Error executing script. Invalid data for call_service at pos 1: expected float for dictionary value @ data['temperature'] 2023-11-17 17:21:26.951 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_3] sync_temp_piece_3: Error executing script. Invalid data for call_service at pos 1: expected float for dictionary value @ data['temperature'] 2023-11-17 17:21:26.952 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_4] sync_temp_piece_4: Error executing script. Invalid data for call_service at pos 1: expected float for dictionary value @ data['temperature'] 2023-11-17 17:21:26.957 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_1] Error while executing automation automation.sync_temp_piece_1: expected float for dictionary value @ data['temperature'] 2023-11-17 17:21:26.957 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_2] Error while executing automation automation.sync_temp_piece_2: expected float for dictionary value @ data['temperature'] 2023-11-17 17:21:26.957 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_3] Error while executing automation automation.sync_temp_piece_3: expected float for dictionary value @ data['temperature'] 2023-11-17 17:21:26.957 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_4] Error while executing automation automation.sync_temp_piece_4: expected float for dictionary value @ data['temperature']

phid78 avatar Nov 17 '23 17:11 phid78

si, a tout hazard, tu peux en profiter pour rajouter le mode boost, hors-gel, absence par piece et une petite temperature max, ce serait cool :-))

phid78 avatar Nov 17 '23 20:11 phid78

si ca peut t'aider, j'ai recuperer ca sur leur app en ligne : operationName: "GET_PROPERTY_MODE_AND_ROOMS" query: "query GET_PROPERTY_MODE_AND_ROOMS($id: Int!, $excludeRooms: [Int]) {\n property(id: $id) {\n id\n mode\n mboxDisconnected\n rooms(excludeRooms: $excludeRooms) {\n id\n name\n type\n color\n heaters\n hasTemperatureSchedule\n currentTemperatureDegrees\n targetTemperatureDegrees\n humidity\n sensors\n mode {\n boost\n absence\n frost\n disableHeating\n __typename\n }\n ...Status\n __typename\n }\n __typename\n }\n}\n\nfragment Status on RoomType {\n status {\n disconnected\n heaterDisconnected\n heatingOperating\n sensorBatteryLow\n sensorDisconnected\n temporaryAdjustment\n __typename\n }\n __typename\n}" variables: {id: ID HOUSE} id: ID HOUSE reponse: "data": { "property": { "id": ID HOUSE, "mode": { "boost": false, "frost": false, "absence": false, "disableHeating": false }, "mboxDisconnected": false, "rooms": [ { "id": ID ROOM, "name": "piece 1", "type": 0, "color": "#00BCFD", "heaters": 1, "hasTemperatureSchedule": true, "currentTemperatureDegrees": 18.7, "targetTemperatureDegrees": 17.0, "humidity": null, "sensors": 0, "mode": { "boost": false, "absence": true, "frost": false, "disableHeating": false, "__typename": "RoomModeType" }, "status": { "disconnected": false, "heaterDisconnected": false, "heatingOperating": false, "sensorBatteryLow": false, "sensorDisconnected": true, "temporaryAdjustment": false, "__typename": "RoomStatusType" }, "__typename": "RoomType" },

Passage sans mode : operationName : "SET_ROOM_MODE" query : "mutation SET_ROOM_MODE($propertyId: Int!, $roomId: Int!, $mode: String!) {\n setRoomMode(input: {propertyId: $propertyId, roomId: $roomId, mode: $mode}) {\n id\n mode {\n boost\n absence\n frost\n disableHeating\n __typename\n }\n __typename\n }\n}" variables: {propertyId: xxxx, roomId: xxxx, mode: false} mode: false propertyId : xxxx roomId : xxxx

reponse { "data": { "setRoomMode": { "id": ID ROOM, "mode": { "boost": false, "absence": false, "frost": false, "disableHeating": false, "__typename": "RoomModeType" }, "__typename": "RoomType" } } }

passage en mode absence {operationName: "SET_ROOM_MODE",…} operationName: "SET_ROOM_MODE" query: "mutation SET_ROOM_MODE($propertyId: Int!, $roomId: Int!, $mode: String!) {\n setRoomMode(input: {propertyId: $propertyId, roomId: $roomId, mode: $mode}) {\n id\n mode {\n boost\n absence\n frost\n disableHeating\n __typename\n }\n __typename\n }\n}" variables: {propertyId: xxxxx, roomId: xxxxx, mode: "absence"} mode: "absence" propertyId: xxxxxx roomId: xxxxxx

reponse { "data": { "setRoomMode": { "id": ROOM ID, "mode": { "boost": false, "absence": true, "frost": false, "disableHeating": false, "__typename": "RoomModeType" }, "__typename": "RoomType" } } }

phid78 avatar Nov 18 '23 18:11 phid78

bonjour @noiwid, je viens aux nouvelles, as tu pu avancer ?

phid78 avatar Nov 21 '23 09:11 phid78

ateur, mais dans la minu

Salut, c'est étrange mais je n'ai aucun problème de ce type de mon côté. Tout fonctionne comme attendu si je change des ordres depuis HA, ils sont valide jusqu'au prochain changement programmé dans Tiko. tu as quelle programmation côté Tiko pour tes pièces ?

SylvainDx avatar Nov 24 '23 12:11 SylvainDx

salut, que veux tu dire ? Tu n'as pas de message d'erreur dans tes logs ?

phid78 avatar Nov 24 '23 12:11 phid78

Non, je n'ai pas de problème de réinitialisation de la consigne quand je ma modifie par HA Si je change la température dans HA elle est correctement remonté dans Tiko. Je suis pas dev mais a la lecture de tes erreurs je me demande si la page tiko.php est bien joignable de ton HA ? (tout les : Timeout for command: curl -k -g 'https://ip/tiko.php?hash=token')

SylvainDx avatar Nov 24 '23 12:11 SylvainDx

Alors, dans le doute, j'ai tout desinstallé de HA, detruit mon sous domaine et tout recrée. l'acces a mon nouveau php n'était pas validé en "exectition" je lui ai donné les droits et apres 20 min de test tout fonctionne. Mes seules erreurs :

TemplateError('TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'') while processing template 'Template<template=({% set last_month_value = state_attr('sensor.tiko_consumption', 'last_month_total_same_day_wh') %} {{ (((state_attr('sensor.tiko_consumption', 'this_month_total_wh') - last_month_value) / last_month_value) * 100)|round(0) if last_month_value != 0 else 0 }}) renders=8>' for attribute '_attr_native_value' in entity 'sensor.tiko_consumption_vs_lastmonth' 14:45:18 – (ERREUR) Template - message survenu pour la première fois à 14:15:11 et apparu 8 fois. Error while processing template: Template<template=({% set last_month_value = state_attr('sensor.tiko_consumption', 'last_month_total_same_day_wh') %} {{ (((state_attr('sensor.tiko_consumption', 'this_month_total_wh') - last_month_value) / last_month_value) * 100)|round(0) if last_month_value != 0 else 0 }}) renders=2> 14:45:18 – (ERREUR) helpers/template.py - message survenu pour la première fois à 14:15:12 et apparu 4 fois.

mais noiwid avait dit que c'était normal de memoire.

Pour le forcage de la temperature min/max, j'ai rajouter ca dans le yaml: sous target_sensor: sensor.piece_temperature min_temp: 7 max_temp: 22 Ca fonctionne

Pour l'instant plus de message d'erreur et bonne prise en compte des ordres donnés

Détails du journal (AVERTISSEMENT) Logger: homeassistant.components.command_line Source: components/command_line/switch.py:218 Integration: Command Line (documentation, issues) First occurred: 15:23:37 (10 occurrences) Last logged: 17:53:05

Updating Command Line Switch Radiateurs on/off took longer than the scheduled update interval 0:01:00

phid78 avatar Nov 24 '23 15:11 phid78

retour des erreurs :

2023-11-25 05:26:08.065 ERROR (SyncWorker_3) [homeassistant.components.command_line.utils] Timeout for command: curl -k -g 'https://IP/tiko.php?hash=TOKEN'
2023-11-25 05:26:08.546 ERROR (SyncWorker_0) [homeassistant.components.command_line.utils] Timeout for command: curl -k -g 'https://IP/tiko.php?hash=TOKEN'
2023-11-25 05:26:08.547 ERROR (SyncWorker_8) [homeassistant.components.command_line.utils] Timeout for command: curl -k -g 'https://IP/tiko.php?hash=TOKEN'
2023-11-25 05:26:08.685 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{% if (value_json.disableHeating) %} mdi:radiator-off {% else %} mdi:radiator-off {% endif %}'
2023-11-25 05:26:08.686 ERROR (MainThread) [homeassistant.helpers.switch] Error rendering icon template for switch.radiateurs_on_off: UndefinedError: 'value_json' is undefined
2023-11-25 05:26:08.693 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{% if (value_json.disableHeating) %} mdi:radiator-off {% else %} mdi:radiator-off {% endif %}'
2023-11-25 05:26:08.694 ERROR (MainThread) [homeassistant.helpers.switch] Error rendering icon template for switch.radiateurs_off: UndefinedError: 'value_json' is undefined
2023-11-25 05:26:08.695 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{% if (value_json.boost) %} mdi:sun-thermometer {% else %} mdi:lightning-bolt-outline {% endif %}'
2023-11-25 05:26:08.695 ERROR (MainThread) [homeassistant.helpers.switch] Error rendering icon template for switch.radiateurs_boost: UndefinedError: 'value_json' is undefined
2023-11-25 05:26:12.779 ERROR (SyncWorker_10) [homeassistant.components.command_line.utils] Timeout for command: curl -k -s 'https://IP/tiko.php?hash=TOKEN'
2023-11-25 05:26:12.780 WARNING (MainThread) [homeassistant.components.command_line] Empty reply found when expecting JSON data
2023-11-25 05:26:12.797 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_1] sync_temp_piece_1: Error executing script. Invalid data for call_service at pos 1: expected float for dictionary value @ data['temperature']
2023-11-25 05:26:12.798 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_2] sync_temp_piece_2: Error executing script. Invalid data for call_service at pos 1: expected float for dictionary value @ data['temperature']
2023-11-25 05:26:12.799 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_3] sync_temp_piece_3: Error executing script. Invalid data for call_service at pos 1: expected float for dictionary value @ data['temperature']
2023-11-25 05:26:12.799 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_4] sync_temp_piece_4: Error executing script. Invalid data for call_service at pos 1: expected float for dictionary value @ data['temperature']
2023-11-25 05:26:12.800 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_1] Error while executing automation automation.sync_temp_piece_1: expected float for dictionary value @ data['temperature']
2023-11-25 05:26:12.800 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_2] Error while executing automation automation.sync_temp_piece_2: expected float for dictionary value @ data['temperature']
2023-11-25 05:26:12.800 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_3] Error while executing automation automation.sync_temp_piece_3: expected float for dictionary value @ data['temperature']
2023-11-25 05:26:12.800 ERROR (MainThread) [homeassistant.components.automation.sync_temp_piece_4] Error while executing automation automation.sync_temp_piece_4: expected float for dictionary value @ data['temperature']

Pour le timeout, le fichier .php n'avait plus la coche "exectuer", je viens de redonner les droits.

phid78 avatar Nov 25 '23 11:11 phid78

Hello, effectivement sans droits d'exécution c'est compliqué 😅 est ce réglé de ton côté? 🤔

noiwid avatar Nov 25 '23 11:11 noiwid

J'ai demandé un changement de température, pour le moment pas d'erreur. Il faudrait savoir pourquoi le fichier .php perd ses droits

phid78 avatar Nov 25 '23 11:11 phid78

où heberges tu cette page web?

Le sam. 25 nov. 2023, 12:37, phid78 @.***> a écrit :

J'ai demandé un changement de température, pour le moment pas d'erreur. Il faudrait savoir pourquoi le fichier .php perd ses droits

— Reply to this email directly, view it on GitHub https://github.com/noiwid/tiko_heating_api/issues/12#issuecomment-1826287852, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFML5AZDRJVWT5SF35OOUU3YGHKALAVCNFSM6AAAAAA7NZYMXSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRWGI4DOOBVGI . You are receiving this because you were mentioned.Message ID: @.***>

noiwid avatar Nov 25 '23 11:11 noiwid

o2switch un sous domaine de mon site principal

phid78 avatar Nov 25 '23 11:11 phid78

je ne connais pas cet hebergeur, mais sans erreur de manipulation il n'y a aucune raison qu'un script PHP perde tout seul ses droits...

ça devrait donc rester stable si tu n'y touches plus 😅

Le sam. 25 nov. 2023, 12:49, phid78 @.***> a écrit :

o2switch un sous domaine de mon site principal

— Reply to this email directly, view it on GitHub https://github.com/noiwid/tiko_heating_api/issues/12#issuecomment-1826289460, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFML5A67S6ZHLOFWK2CG37TYGHLLDAVCNFSM6AAAAAA7NZYMXSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRWGI4DSNBWGA . You are receiving this because you were mentioned.Message ID: @.***>

noiwid avatar Nov 25 '23 12:11 noiwid

Ton HA n'est pas hébergé en local chez toi ? Pourquoi mettre le script via un accès externe ?

SylvainDx avatar Nov 25 '23 13:11 SylvainDx

il est sur une vm de la delta box. J'ai suivi le tuto, mais si tu peux m'indiquer une autre methode sylvain stp, je prends.

Retour des erreurs suite a changement de temperature (bien pris en compte depuis 1h), le fichier php a bien tout ces droits et je n'ai rien touché...

phid78 avatar Nov 25 '23 16:11 phid78

Bonjour à tous, J'ai trouvé une solution permettant d'héberger le fichier tiko.php directement via H.A, en passant par un addon Apache2 🔥🔥🔥 :) Ca permet d'héberger en local le gateway PHP qui va vers leur API, et évite ainsi un rebond inutile...

Voici une procédure qui fonctionne ;

L'idéer est d'installer cet add-on : https://github.com/FaserF/hassio-addons/tree/master/apache2 pour servir les pages web.

*** Pour y parvenir, vous devez avoir installé au préalable les Addons suivant : - File editor - Terminal & SSH

Pour installer l'ADD-ON Apache2:

  1. Ajouter le repository sur HAOS, en cliquant ici : https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2FFaserF%2Fhassio-addons, puis modifier l'URL de son serveur HA (en oubliant pas le port 8123)

  2. Une fenêtre de votre H.A s'ouvre avec l'URL "https://github.com/alexbelgium/hassio-addons", faire entrée pour valider l'ajout puis fermer la popup

  3. Depuis la page "Add-on store" (normallement en dessous), rechercher "Apache2 minimal with MariaDB Client", et cliquer sur le bouton "INSTALL"

Ensuite, configurez l'ADD-ON :

  1. Ouvrir l'Add-on "File editor", et créer dans le dossier courant (config/) un nouveau fichier "tiko.php", dans lequel il faut coller l'ensemble du contenu de la dernière version du fichier tiko.php, puis enregistrer le fichier

  2. Ouvrir l'ADD-on "Terminal & SSH", et saisir les unes à la suite des autres les commandes suivantes :

    mkdir share/htdocs
    touch share/htdocs/index.php
    mkdir share/htdocs/tiko
    mv config/tiko.php share/htdocs/tiko/
    chmod 777 share/htdocs/tiko
    
  3. Ouvrir l'onglet configuration de l'add-on "Apache2 Minimal with MariaDB Client", et modifier les infos suivantes :

    website name : Tiko (ou autre..)
    ssh : à désactiver si vous ne voyez pas de quoi il s'agit
    

    puis cliquer sur SAVE

  4. Basculez sur l'onglet Info de l'add-on Apache2, et cliquez sur START, normallement il devrait se lancer (visible par l'icone verte en haut à droite de la page)

L'URL d'installation du package TIKO devrait ensuite être disponible via : http://votreip/tiko/tiko.php

noiwid avatar Nov 26 '23 17:11 noiwid

Merci pour ce tuto tres clair, par contre, j'ai une erreur: quand je tapais http://votreip/tiko/tiko.php, j'avais une erreur 404. J'ai donc ouvert le port 8324 sur la box et rajouter le port dans l'adresse : https://votreip:8324/tiko/tiko.php J'ai désormais cette erreur : Pré-requis 1 Erreur : le dossier /share/htdocs/tiko/ n'est pas autorisé en écriture.

Je suis sincerement desolé de t'embeter noiwid, je sais pas où j'ai merdé

les logs apache : s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started No username and/or password was provided. Skipping account set up. You have activated SSL. SSL Settings will be applied Here is your web file architecture. total 4 -rw-r--r-- 1 root root 0 Nov 26 20:09 index.php drwxrwx--x 2 root root 4096 Nov 26 20:10 tiko Starting Apache2... [Sun Nov 26 20:38:07.464665 2023] [mpm_prefork:notice] [pid 78] AH00163: Apache/2.4.58 (Unix) PHP/8.1.26 mod_wsgi/4.9.4 Python/3.11 OpenSSL/3.1.4 configured -- resuming normal operations

phid78 avatar Nov 26 '23 19:11 phid78

cette commande depuis le terminal :

chmod 777 share/htdocs/tiko

devrait donner les droits appropriés... si tu ouvres l'add on terminal, et tappes cette commande, que se passe il ?

as-tu bien tappé les autres commandes?

noiwid avatar Nov 26 '23 20:11 noiwid

Je l'avais pourtant taper image

Quand je recharge, j'ai toujours les erreurs habituelles

phid78 avatar Nov 26 '23 21:11 phid78