fmartinou / tydom2mqtt

Deltadore Tydom to MQTT Bridge
https://fmartinou.github.io/tydom2mqtt/
MIT License
98 stars 57 forks source link

Error on parsing tydom response #176

Open beavis6511 opened 9 months ago

beavis6511 commented 9 months ago

Hello,

I'm testing tydom2mqtt but I have an error at startup:

2024-02-19 20:04:29,562 - tydom.MessageHandler - ERROR - Error on parsing tydom response ('>' not supported between instances of 'float' and 'NoneType') 2024-02-19 20:04:29,563 - tydom.MessageHandler - ERROR - Incoming data ([{"id":1594190006,"endpoints":[{"id":1594190006,"error":0,"data":[{"name":"authorization","validity":"upToDate","value":"STOP"},{"name":"setpoint","validity":"upToDate","value":null},{"name":"thermicLevel","validity":"upToDate","value":"STOP"},{"name":"hvacMode","validity":"upToDate","value":"NORMAL"},{"name":"timeDelay","validity":"upToDate","value":0},{"name":"temperature","validity":"upToDate","value":21.090},{"name":"tempoOn","validity":"upToDate","value":false},{"name":"antifrostOn","validity":"upToDate","value":false},{"name":"loadSheddingOn","validity":"upToDate","value":false},{"name":"openingDetected","validity":"upToDate","value":false},{"name":"presenceDetected","validity":"upToDate","value":false},{"name":"absence","validity":"upToDate","value":false},{"name":"productionDefect","validity":"upToDate","value":false},{"name":"batteryCmdDefect","validity":"upToDate","value":false},{"name":"tempSensorDefect","validity":"upToDate","value":false},{"name":"tempSensorShortCut","validity":"upToDate","value":false},{"name":"tempSensorOpenCirc","validity":"upToDate","value":false},{"name":"boostOn","validity":"upToDate","value":false},{"name":"anticipCoeff","validity":"upToDate","value":30}]}]},{"id":1594190079,"endpoints":[{"id":1594190079,"error":0,"data":[{"name":"authorization","validity":"upToDate","value":"STOP"},{"name":"setpoint","validity":"upToDate","value":null},{"name":"thermicLevel","validity":"upToDate","value":"STOP"},{"name":"hvacMode","validity":"upToDate","value":"STOP"},{"name":"timeDelay","validity":"upToDate","value":0},{"name":"temperature","validity":"upToDate","value":20.320},{"name":"tempoOn","validity":"upToDate","value":false},{"name":"antifrostOn","validity":"upToDate","value":false},{"name":"loadSheddingOn","validity":"upToDate","value":false},{"name":"openingDetected","validity":"upToDate","value":false},{"name":"presenceDetected","validity":"upToDate","value":false},{"name":"absence","validity":"upToDate","value":false},{"name":"productionDefect","validity":"upToDate","value":false},{"name":"batteryCmdDefect","validity":"upToDate","value":false},{"name":"tempSensorDefect","validity":"upToDate","value":false},{"name":"tempSensorShortCut","validity":"upToDate","value":false},{"name":"tempSensorOpenCirc","validity":"upToDate","value":false},{"name":"boostOn","validity":"upToDate","value":false},{"name":"anticipCoeff","validity":"upToDate","value":30}]}]},{"id":1594190137,"endpoints":[{"id":1594190137,"error":15,"data":[{"name":"authorization","validity":"expired","value":null},{"name":"setpoint","validity":"expired","value":null},{"name":"thermicLevel","validity":"expired","value":null},{"name":"hvacMode","validity":"expired","value":null},{"name":"timeDelay","validity":"expired","value":null},{"name":"temperature","validity":"expired","value":null},{"name":"tempoOn","validity":"expired","value":false},{"name":"antifrostOn","validity":"expired","value":false},{"name":"loadSheddingOn","validity":"expired","value":false},{"name":"openingDetected","validity":"expired","value":false},{"name":"presenceDetected","validity":"expired","value":false},{"name":"absence","validity":"expired","value":false},{"name":"productionDefect","validity":"expired","value":false},{"name":"batteryCmdDefect","validity":"expired","value":false},{"name":"tempSensorDefect","validity":"expired","value":false},{"name":"tempSensorShortCut","validity":"expired","value":false},{"name":"tempSensorOpenCirc","validity":"expired","value":false},{"name":"boostOn","validity":"expired","value":false},{"name":"anticipCoeff","validity":"upToDate","value":30}]}]},{"id":1594190476,"endpoints":[{"id":1594190476,"error":0,"data":[{"name":"authorization","validity":"upToDate","value":"STOP"},{"name":"setpoint","validity":"upToDate","value":null},{"name":"thermicLevel","validity":"upToDate","value":"STOP"},{"name":"hvacMode","validity":"upToDate","value":"STOP"},{"name":"timeDelay","validity":"upToDate","value":0},{"name":"temperature","validity":"upToDate","value":20.320},{"name":"tempoOn","validity":"upToDate","value":false},{"name":"antifrostOn","validity":"upToDate","value":false},{"name":"loadSheddingOn","validity":"upToDate","value":false},{"name":"openingDetected","validity":"upToDate","value":false},{"name":"presenceDetected","validity":"upToDate","value":false},{"name":"absence","validity":"upToDate","value":false},{"name":"productionDefect","validity":"upToDate","value":false},{"name":"batteryCmdDefect","validity":"upToDate","value":false},{"name":"tempSensorDefect","validity":"upToDate","value":false},{"name":"tempSensorShortCut","validity":"upToDate","value":false},{"name":"tempSensorOpenCirc","validity":"upToDate","value":false},{"name":"boostOn","validity":"upToDate","value":false},{"name":"anticipCoeff","validity":"upToDate","value":30}]}]},{"id":1594190528,"endpoints":[{"id":1594190528,"error":0,"data":[{"name":"authorization","validity":"upToDate","value":"STOP"},{"name":"setpoint","validity":"upToDate","value":null},{"name":"thermicLevel","validity":"upToDate","value":"STOP"},{"name":"hvacMode","validity":"upToDate","value":"STOP"},{"name":"timeDelay","validity":"upToDate","value":0},{"name":"temperature","validity":"upToDate","value":20.320},{"name":"tempoOn","validity":"upToDate","value":false},{"name":"antifrostOn","validity":"upToDate","value":false},{"name":"loadSheddingOn","validity":"upToDate","value":false},{"name":"openingDetected","validity":"upToDate","value":false},{"name":"presenceDetected","validity":"upToDate","value":false},{"name":"absence","validity":"upToDate","value":false},{"name":"productionDefect","validity":"upToDate","value":false},{"name":"batteryCmdDefect","validity":"upToDate","value":false},{"name":"tempSensorDefect","validity":"upToDate","value":false},{"name":"tempSensorShortCut","validity":"upToDate","value":false},{"name":"tempSensorOpenCirc","validity":"upToDate","value":false},{"name":"boostOn","validity":"upToDate","value":false},{"name":"anticipCoeff","validity":"upToDate","value":30}]}]},{"id":1707832490,"endpoints":[{"id":1707832490,"error":0,"data":[{"name":"authorization","validity":"upToDate","value":"HEATING"},{"name":"setpoint","validity":"upToDate","value":null},{"name":"thermicLevel","validity":"upToDate","value":"STOP"},{"name":"hvacMode","validity":"upToDate","value":"STOP"},{"name":"timeDelay","validity":"upToDate","value":0},{"name":"temperature","validity":"upToDate","value":20.970},{"name":"tempoOn","validity":"upToDate","value":false},{"name":"antifrostOn","validity":"upToDate","value":true},{"name":"loadSheddingOn","validity":"upToDate","value":false},{"name":"openingDetected","validity":"upToDate","value":false},{"name":"presenceDetected","validity":"upToDate","value":false},{"name":"absence","validity":"upToDate","value":false},{"name":"productionDefect","validity":"upToDate","value":false},{"name":"batteryCmdDefect","validity":"upToDate","value":false},{"name":"tempSensorDefect","validity":"upToDate","value":false},{"name":"tempSensorShortCut","validity":"upToDate","value":false},{"name":"tempSensorOpenCirc","validity":"upToDate","value":false},{"name":"boostOn","validity":"upToDate","value":false},{"name":"jobs","validity":"upToDate","value":37},{"name":"antiSeizurePeriod","validity":"upToDate","value":0},{"name":"maintenanceNeeded","validity":"upToDate","value":false},{"name":"jobsMP","validity":"upToDate","value":4121},{"name":"indexTimeOn","validity":"upToDate","value":2026},{"name":"activationIndex","validity":"upToDate","value":5},{"name":"timeOnCpt","validity":"upToDate","value":2026},{"name":"activationCpt","validity":"upToDate","value":5},{"name":"softVersion","validity":"upToDate","value":"01.01.00"},{"name":"softPlan","validity":"upToDate","value":"26.51.00.10"},{"name":"anticipCoeff","validity":"upToDate","value":30}]}]},{"id":1707832687,"endpoints":[{"id":1707832687,"error":0,"data":[{"name":"authorization","validity":"upToDate","value":"HEATING"},{"name":"setpoint","validity":"upToDate","value":20.500},{"name":"thermicLevel","validity":"upToDate","value":null},{"name":"hvacMode","validity":"upToDate","value":"NORMAL"},{"name":"timeDelay","validity":"upToDate","value":0},{"name":"temperature","validity":"upToDate","value":21.100},{"name":"tempoOn","validity":"upToDate","value":false},{"name":"antifrostOn","validity":"upToDate","value":false},{"name":"loadSheddingOn","validity":"upToDate","value":false},{"name":"openingDetected","validity":"upToDate","value":false},{"name":"presenceDetected","validity":"upToDate","value":false},{"name":"absence","validity":"upToDate","value":false},{"name":"productionDefect","validity":"upToDate","value":false},{"name":"batteryCmdDefect","validity":"upToDate","value":false},{"name":"tempSensorDefect","validity":"upToDate","value":false},{"name":"tempSensorShortCut","validity":"upToDate","value":false},{"name":"tempSensorOpenCirc","validity":"upToDate","value":false},{"name":"boostOn","validity":"upToDate","value":false},{"name":"anticipCoeff","validity":"upToDate","value":30}]}]},{"id":1707832743,"endpoints":[{"id":1707832743,"error":0,"data":[{"name":"authorization","validity":"upToDate","value":"HEATING"},{"name":"setpoint","validity":"upToDate","value":19.500},{"name":"thermicLevel","validity":"upToDate","value":null},{"name":"hvacMode","validity":"upToDate","value":"NORMAL"},{"name":"timeDelay","validity":"upToDate","value":0},{"name":"temperature","validity":"upToDate","value":19.780},{"name":"tempoOn","validity":"upToDate","value":false},{"name":"antifrostOn","validity":"upToDate","value":false},{"name":"loadSheddingOn","validity":"upToDate","value":false},{"name":"openingDetected","validity":"upToDate","value":false},{"name":"presenceDetected","validity":"upToDate","value":false},{"name":"absence","validity":"upToDate","value":false},{"name":"productionDefect","validity":"upToDate","value":false},{"name":"batteryCmdDefect","validity":"upToDate","value":false},{"name":"tempSensorDefect","validity":"upToDate","value":false},{"name":"tempSensorShortCut","validity":"upToDate","value":false},{"name":"tempSensorOpenCirc","validity":"upToDate","value":false},{"name":"boostOn","validity":"upToDate","value":false},{"name":"anticipCoeff","validity":"upToDate","value":30}]}]}] ) 2024-02-19 20:04:29,565 - tydom.MessageHandler - ERROR - '>' not supported between instances of 'float' and 'NoneType' Traceback (most recent call last): File "/app/tydom/MessageHandler.py", line 362, in parse_response await self.parse_devices_data(parsed=parsed) File "/app/tydom/MessageHandler.py", line 472, in parse_devices_data await self.parse_endpoint_data(endpoint, i["id"]) File "/app/tydom/MessageHandler.py", line 709, in parse_endpoint_data await new_sh_hvac.update() File "/app/sensors/Boiler.py", line 163, in update "idle" if self.current_temp > self.current_setpoint else "heating", ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: '>' not supported between instances of 'float' and 'NoneType' 2024-02-19 20:04:29,572 - tydom.MessageHandler - WARNING - Unknown message type received ([] )

Thanks for your help :)

breizhdude commented 8 months ago

I got the exact same issue for the last two weeks: 2024-03-14 08:08:16,419 - tydom.MessageHandler - INFO - Device update (id=1388534424, endpoint=1388534411, name=Tyxal Alarm, type=alarm) 2024-03-14 08:08:16,420 - tydom.MessageHandler - ERROR - Error in alarm parsing ! 2024-03-14 08:08:16,421 - tydom.MessageHandler - ERROR - 'NoneType' object has no attribute 'publish' 2024-03-14 08:08:16,422 - tydom.MessageHandler - INFO - Device update (id=1616710619, endpoint=1616710619, name=Salon N, type=shutter) 2024-03-14 08:08:16,422 - tydom.MessageHandler - ERROR - Error on parsing tydom response ('NoneType' object has no attribute 'publish') 2024-03-14 08:08:16,423 - tydom.MessageHandler - ERROR - Incoming data ([{"id":1388534424,"endpoints":[{"id":1388534411,"error":0,"data":[{"name":"alarmState","validity":"upToDate","value":"OFF"},{"name":"alarmMode","validity":"upToDate","value":"OFF"},{"name":"alarmTechnical","validity":"upToDate","value":false},{"name":"alarmSOS","validity":"upToDate","value":false},{"name":"unitAutoProtect","validity":"upToDate","value":false},{"name":"unitBatteryDefect","validity":"upToDate","value":false},{"name":"unackedEvent","validity":"upToDate","value":false},{"name":"systAutoProtect","validity":"upToDate","value":false},{"name":"systBatteryDefect","validity":"upToDate","value":true},{"name":"systSupervisionDefect","validity":"upToDate","value":true},{"name":"systOpenIssue","validity":"upToDate","value":false},{"name":"systSectorDefect","validity":"upToDate","value":false},{"name":"systTechnicalDefect","validity":"upToDate","value":false},{"name":"videoLinkDefect","validity":"upToDate","value":false},{"name":"remoteSurveyDefect","validity":"upToDate","value":false},{"name":"simDefect","validity":"upToDate","value":false},{"name":"networkDefect","validity":"upToDate","value":false},{"name":"inactiveProduct","validity":"upToDate","value":false},{"name":"liveCheckRunning","validity":"upToDate","value":false},{"name":"zone1State","validity":"upToDate","value":"UNUSED"},{"name":"zone2State","validity":"upToDate","value":"UNUSED"},{"name":"zone3State","validity":"upToDate","value":"UNUSED"},{"name":"zone4State","validity":"upToDate","value":"UNUSED"},{"name":"zone5State","validity":"upToDate","value":"UNUSED"},{"name":"zone6State","validity":"upToDate","value":"UNUSED"},{"name":"zone7State","validity":"upToDate","value":"UNUSED"},{"name":"zone8State","validity":"upToDate","value":"UNUSED"},{"name":"outTemperature","validity":"upToDate","value":13.000},{"name":"gsmLevel","validity":"upToDate","value":7},{"name":"irv1State","validity":"upToDate","value":"AVAILABLE"},{"name":"irv2State","validity":"upToDate","value":"UNAVAILABLE"},{"name":"irv3State","validity":"upToDate","value":"UNAVAILABLE"},{"name":"irv4State","validity":"upToDate","value":"UNAVAILABLE"},{"name":"kernelUpToDate","validity":"upToDate","value":true},{"name":"preAlarm","validity":"expired","value":false}]}]},{"id":1616710619,"endpoints":[{"id":1616710619,"error":0,"data":[{"name":"thermicDefect","validity":"upToDate","value":false},{"name":"position","validity":"upToDate","value":100},{"name":"onFavPos","validity":"upToDate","value":false},{"name":"upDefect","validity":"upToDate","value":false},{"name":"downDefect","validity":"upToDate","value":false},{"name":"obstacleDefect","validity":"upToDate","value":false},{"name":"intrusion","validity":"upToDate","value":false},{"name":"battDefect","validity":"upToDate","value":false}]}]},{"id":1616710620,"endpoints":[{"id":1616710619,"error":0,"data":[{"name":"thermicDefect","validity":"upToDate","value":false},{"name":"position","validity":"upToDate","value":100},{"name":"onFavPos","validity":"upToDate","value":false}]}]},{"id":1616710622,"endpoints":[{"id":1616710619,"error":0,"data":[{"name":"thermicDefect","validity":"upToDate","value":false},{"name":"position","validity":"upToDate","value":0},{"name":"onFavPos","validity":"upToDate","value":false}]}]},{"id":1616710623,"endpoints":[{"id":1616710619,"error":0,"data":[{"name":"thermicDefect","validity":"upToDate","value":false},{"name":"position","validity":"upToDate","value":0},{"name":"onFavPos","validity":"upToDate","value":false}]}]},{"id":1616710625,"endpoints":[{"id":1616710619,"error":0,"data":[{"name":"thermicDefect","validity":"upToDate","value":false},{"name":"position","validity":"upToDate","value":100},{"name":"onFavPos","validity":"upToDate","value":false}]}]},{"id":1616710626,"endpoints":[{"id":1616710619,"error":0,"data":[{"name":"thermicDefect","validity":"upToDate","value":false},{"name":"position","validity":"upToDate","value":100},{"name":"onFavPos","validity":"upToDate","value":false},{"name":"upDefect","validity":"upToDate","value":false},{"name":"downDefect","validity":"upToDate","value":false},{"name":"obstacleDefect","validity":"upToDate","value":false},{"name":"intrusion","validity":"upToDate","value":false},{"name":"battDefect","validity":"upToDate","value":false}]}]},{"id":1616710627,"endpoints":[{"id":1616710619,"error":0,"data":[{"name":"thermicDefect","validity":"upToDate","value":false},{"name":"position","validity":"upToDate","value":0},{"name":"onFavPos","validity":"upToDate","value":false}]}]},{"id":1616710628,"endpoints":[{"id":1616710619,"error":0,"data":[{"name":"thermicDefect","validity":"upToDate","value":false},{"name":"position","validity":"upToDate","value":0},{"name":"onFavPos","validity":"upToDate","value":false}]}]},{"id":1616710630,"endpoints":[{"id":1616710619,"error":0,"data":[{"name":"thermicDefect","validity":"upToDate","value":false},{"name":"position","validity":"upToDate","value":100},{"name":"onFavPos","validity":"upToDate","value":false},{"name":"upDefect","validity":"upToDate","value":false},{"name":"downDefect","validity":"upToDate","value":false},{"name":"obstacleDefect","validity":"upToDate","value":false},{"name":"intrusion","validity":"upToDate","value":false},{"name":"battDefect","validity":"upToDate","value":false}]}]},{"id":1689658770,"endpoints":[{"id":1689658770,"error":0,"data":[{"name":"thermicDefect","validity":"upToDate","value":false},{"name":"position","validity":"upToDate","value":100},{"name":"onFavPos","validity":"upToDate","value":false},{"name":"obstacleDefect","validity":"upToDate","value":false},{"name":"intrusion","validity":"upToDate","value":false},{"name":"battDefect","validity":"upToDate","value":false}]}]},{"id":1689659053,"endpoints":[{"id":1689659053,"error":0,"data":[{"name":"thermicDefect","validity":"upToDate","value":false},{"name":"position","validity":"upToDate","value":100},{"name":"onFavPos","validity":"upToDate","value":false},{"name":"obstacleDefect","validity":"upToDate","value":false},{"name":"intrusion","validity":"upToDate","value":false},{"name":"battDefect","validity":"upToDate","value":false}]}]},{"id":1689659154,"endpoints":[{"id":1689659154,"error":0,"data":[{"name":"thermicDefect","validity":"upToDate","value":false},{"name":"position","validity":"upToDate","value":100},{"name":"onFavPos","validity":"upToDate","value":false},{"name":"obstacleDefect","validity":"upToDate","value":false},{"name":"intrusion","validity":"upToDate","value":false},{"name":"battDefect","validity":"upToDate","value":false}]}]}] ) 2024-03-14 08:08:16,424 - tydom.MessageHandler - ERROR - 'NoneType' object has no attribute 'publish' Traceback (most recent call last): File "/app/tydom/MessageHandler.py", line 362, in parse_response await self.parse_devices_data(parsed=parsed) File "/app/tydom/MessageHandler.py", line 472, in parse_devices_data await self.parse_endpoint_data(endpoint, i["id"]) File "/app/tydom/MessageHandler.py", line 686, in parse_endpoint_data await new_cover.update() File "/app/sensors/Cover.py", line 73, in update await self.setup() File "/app/sensors/Cover.py", line 68, in setup self.mqtt.mqtt_client.publish( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

relief-melone commented 7 months ago

same issue here as well. so either message format changed or a rollback to an older version should help?

r0m1CH commented 7 months ago

Same issue here but for my heating system (detected as boiler). I don't know why. in the code it seems that current_temp is checked for NoneType before but it goes into it.

Here the error if it helps:

stderr 04/04/2024 09:55:20 AM 2024-04-04 09:55:20,054 - tydom.MessageHandler - ERROR - Error on parsing tydom response ('>' not supported between instances of 'float' and 'NoneType') stderr 04/04/2024 09:55:20 AM 2024-04-04 09:55:20,054 - tydom.MessageHandler - ERROR - Incoming data ([{"id": 1695751186, "endpoints": [{"id": 1695751188, "error": 0, "data": [{"name": "setpoint", "validity": "upToDate", "value": null}, {"name": "thermicLevel", "validity": "upToDate", "value": "STOP"}, {"name": "antifrostOn", "validity": "upToDate", "value": true}]}]}]) stderr 04/04/2024 09:55:20 AM 2024-04-04 09:55:20,054 - tydom.MessageHandler - ERROR - '>' not supported between instances of 'float' and 'NoneType' stderr 04/04/2024 09:55:20 AM Traceback (most recent call last): stderr 04/04/2024 09:55:20 AM File "/app/tydom/MessageHandler.py", line 362, in parse_response stderr 04/04/2024 09:55:20 AM await self.parse_devices_data(parsed=parsed) stderr 04/04/2024 09:55:20 AM File "/app/tydom/MessageHandler.py", line 472, in parse_devices_data stderr 04/04/2024 09:55:20 AM await self.parse_endpoint_data(endpoint, i["id"]) stderr 04/04/2024 09:55:20 AM File "/app/tydom/MessageHandler.py", line 709, in parse_endpoint_data stderr 04/04/2024 09:55:20 AM await new_sh_hvac.update() stderr 04/04/2024 09:55:20 AM File "/app/sensors/Boiler.py", line 163, in update stderr 04/04/2024 09:55:20 AM "idle" if self.current_temp > self.current_setpoint else "heating", stderr 04/04/2024 09:55:20 AM ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ stderr 04/04/2024 09:55:20 AM TypeError: '>' not supported between instances of 'float' and 'NoneType'