mrwiwi / tydom2mqtt

Link between a Delta Dore's Tydom Hub and and a MQTT broker, unofficial of course.
MIT License
28 stars 17 forks source link

Cannot parse response ! Error : string indices must be integers #12

Open nnospam opened 4 years ago

nnospam commented 4 years ago

Hello,

just installed latest release (release_0.93) and installed in Home Assistant 0.106.5 / Supervisor 220 version 209 / Operating System 3.13 version 3.11, by adding the addon from repository.

This is what I see in the logs, maybe related to the issue I opened a while ago. As you can see, the light devices are raising msg_data error in parsing.

Maybe the messages you are seeing are different from the ones I get from my devices.

-------- CUT HERE --------

Subscribing to :  +/tydom/#
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
TYDOM WEBSOCKET CONNECTION INITIALISING....                     
Building headers, getting 1st handshake and authentication....
Upgrading http connection to websocket....
Attempting websocket connection with tydom hub.......................
Host Target :
192.168.1.39
Tydom Client is connected to websocket and ready !
Requesting 1st data...
>>>>>>>>>> Sending to tydom client..... GET /info
##################################
##################################
>>>>>>>>>> Sending to tydom client..... POST /refresh/all
>>>>>>>>>> Sending to tydom client..... GET /configs/file
>>>>>>>>>> Sending to tydom client..... GET /devices/data
<<<<<<<<<< Receiving from tydom_client...
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Incoming message type : Info detected
Incoming data parsed successfully !
<<<<<<<<<< Receiving from tydom_client...
<<<<<<<<<< Receiving from tydom_client...
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Incoming message type : data detected
Cannot parse response !
Error :  string indices must be integers
{'id_catalog': 'F2BD90F93B888DA02C54980F11AE4796DFCC98F447CD3FE326F5A3A964C939BF', 'old_tycam': False, 'moments': [{'id': 2003226986, 'color': 9813268, 'name': 'Nuevo momento'}], 'version': '1.0.1', 'os': 'ios', 'camera_install_date': 0, 'groups': [{'id': 772986772, 'usage': 'light', 'picto': 'picto_lamp', 'name': 'TOTAL', 'group_all': True}, {'picto': 'picto_shutter', 'group_all': True, 'name': 'TOTAL', 'id': 283040358, 'usage': 'shutter'}, {'group_all': True, 'usage': 'awning', 'name': 'TOTAL', 'picto': 'picto_awning_awning', 'id': 766844488}], 'scenarios': [], 'date': 1582657187, 'endpoints': [{'last_usage': 'light', 'id_endpoint': 1572022259, 'name': 'Baño Sotano', 'id_device': 1572022259, 'first_usage': 'light', 'picto': 'picto_lamp'}, {'id_device': 1572021524, 'id_endpoint': 1572021524, 'picto': 'picto_lamp', 'name': 'Bajo Mueble Cocina', 'first_usage': 'light', 'last_usage': 'light'}, {'first_usage': 'light', 'name': 'Jardin', 'last_usage': 'light', 'id_device': 1572021908, 'id_endpoint': 1572021908, 'picto': 'picto_lamp'}, {'picto': 'picto_lamp', 'id_endpoint': 1572022068, 'first_usage': 'light', 'id_device': 1572022068, 'last_usage': 'light', 'name': 'Escalera Sótano'}, {'id_device': 1572021946, 'name': 'Led Entrada', 'id_endpoint': 1572021946, 'first_usage': 'light', 'last_usage': 'light', 'picto': 'picto_lamp'}, {'last_usage': 'light', 'id_device': 1572022393, 'name': 'Dindel Garaje', 'picto': 'picto_lamp', 'id_endpoint': 1572022393, 'first_usage': 'light'}, {'last_usage': 'light', 'id_device': 1572021662, 'id_endpoint': 1572021662, 'picto': 'picto_lamp', 'name': 'Recibidor', 'first_usage': 'light'}, {'picto': 'picto_lamp', 'last_usage': 'light', 'first_usage': 'light', 'id_endpoint': 1572022173, 'name': 'Distribuidor Sotano', 'id_device': 1572022173}, {'picto': 'picto_lamp', 'id_device': 1572022300, 'id_endpoint': 1572022300, 'first_usage': 'light', 'name': 'Espejo Baño Sotano', 'last_usage': 'light'}, {'first_usage': 'light', 'picto': 'picto_lamp', 'id_endpoint': 1572022434, 'id_device': 1572022434, 'last_usage': 'light', 'name': 'Garaje'}, {'name': 'Led Terraza Delanter', 'picto': 'picto_lamp', 'first_usage': 'light', 'id_device': 1572021825, 'id_endpoint': 1572021825, 'last_usage': 'light'}, {'id_device': 1572021575, 'picto': 'picto_lamp', 'first_usage': 'light', 'last_usage': 'light', 'name': 'Led Salon', 'id_endpoint': 1572021575}, {'last_usage': 'light', 'id_endpoint': 1572021988, 'id_device': 1572021988, 'picto': 'picto_lamp', 'name': 'Led Zaguan', 'first_usage': 'light'}, {'id_device': 1572021707, 'first_usage': 'light', 'last_usage': 'light', 'id_endpoint': 1572021707, 'picto': 'picto_lamp', 'name': 'Baño PB'}, {'id_device': 1572022027, 'first_usage': 'light', 'name': 'Terraza Trasera', 'last_usage': 'light', 'id_endpoint': 1572022027, 'picto': 'picto_lamp'}, {'id_device': 1572022123, 'picto': 'picto_lamp', 'last_usage': 'light', 'name': 'Escalera P1', 'id_endpoint': 1572022123, 'first_usage': 'light'}, {'name': 'Lavadero', 'last_usage': 'light', 'picto': 'picto_lamp', 'id_device': 1572022218, 'id_endpoint': 1572022218, 'first_usage': 'light'}, {'name': 'Dormitorio Sotano', 'id_device': 1572022346, 'first_usage': 'light', 'last_usage': 'light', 'picto': 'picto_lamp', 'id_endpoint': 1572022346}, {'id_endpoint': 1572021614, 'first_usage': 'light', 'last_usage': 'light', 'id_device': 1572021614, 'picto': 'picto_lamp', 'name': 'Cocina'}, {'id_device': 1572021773, 'id_endpoint': 1572021773, 'last_usage': 'light', 'picto': 'picto_lamp', 'name': 'Espejo Baño PB', 'first_usage': 'light'}, {'name': 'Piscina', 'last_usage': 'light', 'id_endpoint': 1572021868, 'id_device': 1572021868, 'picto': 'picto_lamp', 'first_usage': 'light'}, {'id_endpoint': 1572022585, 'id_device': 1572022585, 'picto': 'picto_shutter', 'first_usage': 'shutter', 'last_usage': 'shutter', 'name': 'Persiana Cocina 1'}, {'id_device': 1572022623, 'first_usage': 'shutter', 'last_usage': 'shutter', 'id_endpoint': 1572022623, 'name': 'Persiana Cocina 2', 'picto': 'picto_shutter'}, {'id_device': 1572022670, 'picto': 'picto_shutter', 'first_usage': 'shutter', 'id_endpoint': 1572022670, 'last_usage': 'shutter', 'name': 'Persiana Baño PB'}, {'last_usage': 'garage_door', 'id_endpoint': 1572022498, 'id_device': 1572022498, 'first_usage': 'garage_door', 'picto': 'picto_sectional_door', 'name': 'Garaje'}, {'id_endpoint': 1572022541, 'id_device': 1572022541, 'first_usage': 'gate', 'last_usage': 'gate', 'name': 'Portal ', 'picto': 'picto_gate'}], 'version_application': '3.6.0 (246)'}
Incoming data parsed successfully !
<<<<<<<<<< Receiving from tydom_client...
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Incoming message type : data detected
msg_data error in parsing !
1572021524
msg_data error in parsing !
1572021575
msg_data error in parsing !
1572021614
msg_data error in parsing !
1572021662
msg_data error in parsing !
1572021707
msg_data error in parsing !
1572021773
msg_data error in parsing !
1572021825
msg_data error in parsing !
1572021868
msg_data error in parsing !
1572021908
msg_data error in parsing !
1572021946
msg_data error in parsing !
1572021988
msg_data error in parsing !
1572022027
msg_data error in parsing !
1572022068
msg_data error in parsing !
1572022123
msg_data error in parsing !
1572022173
msg_data error in parsing !
1572022218
msg_data error in parsing !
1572022259
msg_data error in parsing !
1572022300
msg_data error in parsing !
1572022346
msg_data error in parsing !
1572022393
msg_data error in parsing !
1572022434
msg_data error in parsing !
1572022498
msg_data error in parsing !
1572022541
msg_data error in parsing !
1572022585
msg_data error in parsing !
1572022623
msg_data error in parsing !
1572022670
Incoming data parsed successfully !
>>>>>>>>>> Sending to tydom client..... POST /refresh/all
<<<<<<<<<< Receiving from tydom_client...
>>>>>>>>>> Sending to tydom client..... POST /refresh/all
<<<<<<<<<< Receiving from tydom_client...
>>>>>>>>>> Sending to tydom client..... POST /refresh/all
<<<<<<<<<< Receiving from tydom_client...
>>>>>>>>>> Sending to tydom client..... POST /refresh/all
<<<<<<<<<< Receiving from tydom_client...
>>>>>>>>>> Sending to tydom client..... POST /refresh/all
<<<<<<<<<< Receiving from tydom_client...

-------- CUT HERE --------

If I subscribe to +/tydom/# in MQTT developer tools I get to see traffic, so I guess its not a connectivity/configuration issue but rather a message format thing.