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

Climate and Window Compatibility, If I can help ;) #13

Open TRSATOC opened 4 years ago

TRSATOC commented 4 years ago

I have 4 temperature controls and 10 Windows detectors. I want to help you, just tell me what to do ;)

tonioa commented 4 years ago

Same here how can we help to integer temperature controls and Windows detectors ?

mrwiwi commented 4 years ago

Hi guys, i will try to guide you, take a MQTT climate element from Home Assistant https://www.home-assistant.io/integrations/climate.mqtt/

Try to link which attributes are associate with the data from the plugin (you can use the plugin by mgrear to easely send commands to your tydom box and have a lot of data, or just use my plugin and check the logs.

Then we have to create a new part of the function de parse data and a climate.py class for the MQTT part (copy-paste the cover.py and adapt it).

I still don't have time but i can review and integrate code if you produce some (again i'm just a nurse anybody can do it :))

mrwiwi commented 4 years ago

Windows detector probably just need a little integration to binary sensor, do you have some data part for them ?

mrwiwi commented 4 years ago

Use https://github.com/mgcrea/node-tydom-client and generate a file, i will try to check it

tonioa commented 4 years ago

Hi,

Thanks for helping us ! i am not a developper, i am trying to do my best Here is the generate file for 3 Climate and 14 Windows detectors

tydom_output.txt

NB: Je pense que cela intéresse particulièrement les français qui utilisent du Delta Dore, merci pour ton aide :-)

mrwiwi commented 3 years ago

New release is up if you can try, thx to bb076 for the PR (i can't test here no such sensors)

tonioa commented 3 years ago

Hi, i have updated but it's not working, here is the log

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.5 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', 'os': 'ios', 'groups': [{'usage': 'window', 'picto': 'picto_window', 'group_all': False, 'id': 1293446020, 'name': 'Baie Est Droite'}, {'picto': 'picto_window', 'name': 'Baie Est Gauche', 'usage': 'window', 'id': 910283753, 'group_all': False}, {'usage': 'window', 'name': 'Baie Nord', 'picto': 'picto_window', 'id': 575301829, 'group_all': False}, {'name': 'TOTAL', 'picto': 'picto_lamp', 'usage': 'light', 'group_all': True, 'id': 1668318474}, {'name': 'TOTAL', 'id': 258981127, 'usage': 'shutter', 'picto': 'picto_shutter', 'group_all': True}, {'name': 'TOTAL', 'picto': 'picto_awning_awning', 'id': 1865462383, 'usage': 'awning', 'group_all': True}, {'name': 'Bureau Droite', 'picto': 'picto_window', 'id': 716588285, 'group_all': False, 'usage': 'window'}, {'usage': 'window', 'group_all': False, 'widget_behavior': {'inversionState': 'disabled'}, 'name': 'Bureau Gauche', 'id': 1980812653, 'picto': 'picto_window'}, {'picto': 'picto_window', 'usage': 'window', 'id': 455540512, 'group_all': False, 'name': 'Salle de bain'}, {'picto': 'picto_window', 'group_all': False, 'usage': 'window', 'id': 1982748604, 'name': 'Chambre Constance'}, {'name': 'WC', 'picto': 'picto_window', 'usage': 'window', 'id': 1165069053, 'group_all': False, 'widget_behavior': {'inversionState': 'disabled'}}, {'usage': 'window', 'id': 570421109, 'name': 'Cuisine', 'picto': 'picto_window', 'group_all': False}, {'group_all': False, 'picto': 'picto_window', 'id': 1640813503, 'name': 'Chambre Charlotte', 'usage': 'window'}, {'id': 1245751637, 'name': 'Salon gauche', 'usage': 'window', 'picto': 'picto_window', 'group_all': False}, {'name': 'Salon droit', 'picto': 'picto_window', 'group_all': False, 'id': 1020521302, 'usage': 'window'}, {'name': 'Chambre amis droite', 'usage': 'window', 'group_all': False, 'id': 12139290, 'picto': 'picto_window'}], 'scenarios': [], 'version_application': '3.10.0 (323)', 'areas': [], 'version': '1.0.1', 'date': 1601913550, 'endpoints': [{'id_device': 1589883539, 'picto': 'picto_window', 'name': 'Battant droit ', 'anticipation_start': False, 'last_usage': 'window', 'id_endpoint': 1589883539, 'first_usage': 'window'}, {'id_device': 1589883713, 'anticipation_start': False, 'picto': 'picto_window', 'id_endpoint': 1589883713, 'first_usage': 'window', 'name': 'Battant gauche', 'last_usage': 'windowFrench'}, {'name': 'CG_DD_USAGE_WINDOWFRENCH_NEW 2', 'id_endpoint': 1589883816, 'picto': 'picto_window', 'anticipation_start': False, 'first_usage': 'window', 'last_usage': 'windowFrench', 'id_device': 1589883816}, {'first_usage': 'window', 'last_usage': 'window', 'id_device': 1589883930, 'id_endpoint': 1589883930, 'name': 'Fenêtre ', 'picto': 'picto_window', 'anticipation_start': False}, {'first_usage': 'hvac', 'last_usage': 'boiler', 'id_endpoint': 1589902721, 'picto': 'picto_thermometer', 'name': 'Séjour', 'id_device': 1589902721, 'anticipation_start': False}, {'picto': 'picto_window', 'first_usage': 'window', 'id_device': 1589884607, 'anticipation_start': False, 'last_usage': 'windowFrench', 'name': 'WC', 'id_endpoint': 1589884607}, {'id_device': 1589884784, 'picto': 'picto_window', 'name': 'Battant droit', 'first_usage': 'window', 'anticipation_start': False, 'id_endpoint': 1589884784, 'last_usage': 'windowFrench'}, {'picto': 'picto_window', 'first_usage': 'window', 'last_usage': 'windowFrench', 'name': 'Battant gauche ', 'id_endpoint': 1590779132, 'anticipation_start': False, 'id_device': 1590779132}, {'first_usage': 'window', 'last_usage': 'window', 'anticipation_start': False, 'id_endpoint': 1589885658, 'id_device': 1589885658, 'name': 'Battant droit', 'picto': 'picto_window'}, {'first_usage': 'window', 'last_usage': 'window', 'anticipation_start': False, 'name': 'Battant droit', 'picto': 'picto_window', 'id_endpoint': 1589885757, 'id_device': 1589885757}, {'last_usage': 'window', 'id_device': 1589885896, 'picto': 'picto_window', 'name': 'Battant droit', 'anticipation_start': False, 'id_endpoint': 1589885896, 'first_usage': 'window'}, {'picto': 'picto_window', 'anticipation_start': False, 'name': 'Battant gauche', 'last_usage': 'window', 'id_device': 1589886026, 'first_usage': 'window', 'id_endpoint': 1589886026}, {'id_device': 1589886161, 'picto': 'picto_window', 'anticipation_start': False, 'id_endpoint': 1589886161, 'first_usage': 'window', 'name': 'Battant droit', 'last_usage': 'window'}, {'id_device': 1589902483, 'name': 'Chambre d’amis', 'first_usage': 'hvac', 'picto': 'picto_thermometer', 'id_endpoint': 1589902483, 'last_usage': 'boiler', 'anticipation_start': False}, {'id_device': 1589902673, 'name': 'Etage', 'last_usage': 'boiler', 'id_endpoint': 1589902673, 'first_usage': 'hvac', 'anticipation_start': False, 'picto': 'picto_thermometer'}, {'name': 'Porte ', 'id_device': 1590768079, 'anticipation_start': False, 'picto': 'picto_belmdoor', 'last_usage': 'belmDoor', 'first_usage': 'belmDoor', 'id_endpoint': 1590768079}, {'first_usage': 'window', 'name': 'Battant droit', 'id_endpoint': 1590827319, 'anticipation_start': False, 'picto': 'picto_window', 'last_usage': 'windowFrench', 'id_device': 1590827319}], 'moments': [], 'old_tycam': False} Incoming data parsed successfully ! <<<<<<<<<< Receiving from tydom_client...

Incoming message type : data detected msg_data error in parsing ! 1589883539 msg_data error in parsing ! 1589883816 msg_data error in parsing ! 1589883930 msg_data error in parsing ! 1589884607 msg_data error in parsing ! 1589884784 msg_data error in parsing ! 1589885658 msg_data error in parsing ! 1589885757 msg_data error in parsing ! 1589885896 msg_data error in parsing ! 1589886026 msg_data error in parsing ! 1589886161 msg_data error in parsing ! 1589902483 msg_data error in parsing ! 1589902673 msg_data error in parsing ! 1589902721 msg_data error in parsing ! 1590768079 msg_data error in parsing ! 1590779132 msg_data error in parsing ! 1590827319 Incoming data parsed successfully ! Sending to tydom client..... POST /refresh/all <<<<<<<<<< Receiving from tydom_client... <<<<<<<<<< Receiving from tydom_client...

Incoming message type : data detected msg_data error in parsing ! 1589902483

mrwiwi commented 3 years ago

New release with PR merge from bbo76, thx man !

gus8313 commented 3 years ago

Hello, I have started to work on it for climate. Now I am able to command and monitor heater part of my Calybox 2020 WT (electrical heaters + thermostat + out temperature sensor). How can I propose my modifications?

mrwiwi commented 3 years ago

Hi ! And thanks, if you started from the current files just make a pull request from GitHub UI or git cli, you can make a fork just before also.

Did you tested covers and alarm and sensors too ? (Just check for new errors)

Glad to see more people to continue the work, it's great !

gus8313 commented 3 years ago

Done, if it still works for other devices, I will improve to distinguish electrical heaters from thermostat

cob94440 commented 3 years ago

Hello Here is my error message

`"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Attempting MQTT connection... MQTT host : 10.0.0.45 MQTT user : chris ################################## 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 : 10.0.0.66 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 : config detected Configuration updated Incoming data parsed successfully ! <<<<<<<<<< Receiving from tydom_client...

Incoming message type : data detected 1611158459 not in dic device_name 1611158459 not in dic device_type 1611158635 not in dic device_name 1611158635 not in dic device_type 1611160882 not in dic device_name 1611160882 not in dic device_type 1611160982 not in dic device_name 1611160982 not in dic device_type 1611161035 not in dic device_name 1611161035 not in dic device_type 1611161112 not in dic device_name 1611161112 not in dic device_type 1611170124 not in dic device_name 1611170124 not in dic device_type 1611170391 not in dic device_name 1611170391 not in dic device_type Incoming data parsed successfully ! <<<<<<<<<< Receiving from tydom_client... !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! receiveMessage error RAW : b'PUT /devices/install HTTP/1.1\r\nServer: Tydom-001A25049F3B\r\ncontent-type: application/json\r\nTransfer-Encoding: chunked\r\n\r\n29\r\n{"protocol":"X3D","installStatus":"idle"}\r\n0\r\n\r\n' Incoming payload : None Error : PUT /devices/install HTTP/1.1 Exiting to ensure systemd restart.... Starting /opt/tydom2mqtt/main.py`

TRSATOC commented 3 years ago

Windows (K-Line) sensors are OK now, thanks for your work!