fmartinou / tydom2mqtt

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

Error on parsing tydom response ('id') #151

Open Boscarato opened 8 months ago

Boscarato commented 8 months ago

Hello, it seems the connection is working, since I get incoming data, but it doesn't manage to correctly parse it.

2023-11-04 15:35:55,738 - tydom.TydomClient    - INFO    - Connecting to tydom
2023-11-04 15:35:57,169 - mqtt.MqttClient      - INFO    - Connected to mqtt broker
2023-11-04 15:35:58,114 - tydom.TydomClient    - INFO    - Connected to tydom
2023-11-04 15:35:58,114 - tydom.TydomClient    - INFO    - Setup tydom client
2023-11-04 15:35:58,287 - tydom.MessageHandler - ERROR   - Error on parsing tydom response ('id')
2023-11-04 15:35:58,288 - tydom.MessageHandler - ERROR   - Incoming data ({"version":"1.0.1","os":"android","date":1699090463,"old_tycam":false,"endpoints":[{"id_device":1669116769,"id_endpoint":1669116769,"name":"Producthvac Primo Piano","picto":"default_device","first_usage":"hvac","last_usage":"hvac"},{"id_device":1669117007,"id_endpoint":1669117007,"name":"Producthvac Sala","picto":"default_device","first_usage":"hvac","last_usage":"hvac"},{"id_device":1669117052,"id_endpoint":1669117052,"name":"Producthvac Entrata","picto":"default_device","first_usage":"hvac","last_usage":"hvac"}],"scenarios":[],"moments":[{"id":1438303786,"name":"Moment EcoAterno","color":0},{"id":1509252612,"name":"Moment EcoAterno","color":0},{"id":1416152666,"name":"Moment EcoAterno","color":0},{"id":1411648711,"name":"Moment EcoAterno","color":0},{"id":1414034699,"name":"Moment EcoAterno","color":0},{"id":797157908,"name":"Moment EcoAterno","color":0},{"id":197496879,"name":"Moment EcoAterno","color":0},{"id":490063480,"name":"Moment EcoAterno","color":0}],"groups":[{"id":294521352,"name":"Primo Piano","picto":"","usage":"hvac","type":"setpoint","group_all":false},{"id":1054802191,"name":"Pian Terreno","picto":"","usage":"hvac","type":"setpoint","group_all":false},{"id":1451176205,"name":"Total","picto":"default_device","usage":"light","group_all":true},{"id":1977448231,"name":"Total","picto":"default_device","usage":"shutter","group_all":true},{"id":1186087334,"name":"Total","picto":"default_device","usage":"awning","group_all":true}]})
2023-11-04 15:35:58,288 - tydom.MessageHandler - ERROR   - 'id'
Traceback (most recent call last):
  File "/app/tydom/MessageHandler.py", line 360, in parse_response
    await self.parse_devices_data(parsed=parsed)
  File "/app/tydom/MessageHandler.py", line 474, in parse_devices_data
    await self.parse_endpoint_data(parsed, parsed["id"])
                                           ~~~~~~^^^^^^
KeyError: 'id'
2023-11-04 15:35:58,333 - tydom.MessageHandler - WARNING - Unknown device name (1669116769_1669116769)
2023-11-04 15:35:58,333 - tydom.MessageHandler - WARNING - Unknown device type (1669116769_1669116769)
2023-11-04 15:35:58,333 - tydom.MessageHandler - INFO    - Device update (id=1669116769, endpoint=1669116769, name=, type=)
2023-11-04 15:35:58,333 - tydom.MessageHandler - WARNING - Unknown device name (1669117007_1669117007)
2023-11-04 15:35:58,333 - tydom.MessageHandler - WARNING - Unknown device type (1669117007_1669117007)
2023-11-04 15:35:58,333 - tydom.MessageHandler - INFO    - Device update (id=1669117007, endpoint=1669117007, name=, type=)
2023-11-04 15:35:58,334 - tydom.MessageHandler - WARNING - Unknown device name (1669117052_1669117052)
2023-11-04 15:35:58,334 - tydom.MessageHandler - WARNING - Unknown device type (1669117052_1669117052)
2023-11-04 15:35:58,334 - tydom.MessageHandler - INFO    - Device update (id=1669117052, endpoint=1669117052, name=, type=)
2023-11-04 15:35:58,345 - tydom.MessageHandler - WARNING - Unknown message type received ([]

)
Elringer commented 5 months ago

Same for me The connection is ok but it seems that there is something wrong.

AttributeError: 'NoneType' object has no attribute 'publish'
2024-02-02 14:50:02,201 - tydom.MessageHandler - ERROR   - Error on parsing tydom response ('NoneType' object has no attribute 'publish')
2024-02-02 14:50:02,201 - tydom.MessageHandler - ERROR   - Incoming data ([{"id": 1706004890, "endpoints": [{"id": 1706004889, "error": 0, "data": [{"name": "temperature", "validity": "upToDate", "value": 20.05}]}]}])
2024-02-02 14:50:02,201 - 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 709, in parse_endpoint_data
    await new_sh_hvac.update()
  File "/app/sensors/Boiler.py", line 115, in update
    await self.setup()
  File "/app/sensors/Boiler.py", line 110, in setup
    self.mqtt.mqtt_client.publish(
LaeeTii commented 3 months ago

Same for me too with a Calybox 230 on my Tydom 1.0:

2024-03-24 16:05:11,770 - tydom.MessageHandler - INFO    - Device update (id=1711205676, endpoint=1711205676, name=Thermique 1, type=boiler)
2024-03-24 16:05:11,770 - tydom.TydomClient    - DEBUG   - get presets
2024-03-24 16:05:11,770 - tydom.MessageHandler - ERROR   - Error on parsing tydom response ('NoneType' object has no attribute 'publish')
2024-03-24 16:05:11,770 - tydom.MessageHandler - ERROR   - Incoming data ([{"id": 1711205676, "endpoints": [{"id": 1711205676, "error": 0, "data": [{"name": "thermicLevel", "validity": "upToDate", "value": "COMFORT"}]}]}])
2024-03-24 16:05:11,770 - 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 709, in parse_endpoint_data
    await new_sh_hvac.update()
  File "/app/sensors/Boiler.py", line 120, in update
    await self.setup()
  File "/app/sensors/Boiler.py", line 115, in setup
    self.mqtt.mqtt_client.publish(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'publish'
Boscarato commented 3 months ago

Same for me too with a Calybox 230 on my Tydom 1.0:

2024-03-24 16:05:11,770 - tydom.MessageHandler - INFO    - Device update (id=1711205676, endpoint=1711205676, name=Thermique 1, type=boiler)
2024-03-24 16:05:11,770 - tydom.TydomClient    - DEBUG   - get presets
2024-03-24 16:05:11,770 - tydom.MessageHandler - ERROR   - Error on parsing tydom response ('NoneType' object has no attribute 'publish')
2024-03-24 16:05:11,770 - tydom.MessageHandler - ERROR   - Incoming data ([{"id": 1711205676, "endpoints": [{"id": 1711205676, "error": 0, "data": [{"name": "thermicLevel", "validity": "upToDate", "value": "COMFORT"}]}]}])
2024-03-24 16:05:11,770 - 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 709, in parse_endpoint_data
    await new_sh_hvac.update()
  File "/app/sensors/Boiler.py", line 120, in update
    await self.setup()
  File "/app/sensors/Boiler.py", line 115, in setup
    self.mqtt.mqtt_client.publish(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'publish'

I'm on a Tydom 1.0 as well, it may be a common denominator