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

Outdoor temp. sensor not detected #24

Closed hercule115 closed 3 years ago

hercule115 commented 3 years ago

Hi, My Deltadore outdoor temperature sensor is not "detected" by the add-on and thus not available in MQTT and Hassio. I have already investigated the issue and would like to share the output as it could help others.

I found out the issue was due to a "last usage" attribute not supported. My outdoor temp sensor is listed as: { “name”: “Heating 1”, “anticipation_start”: false, “id_endpoint”: 1591364989, “picto”: “picto_thermometer”, “id_device”: 1591364989, “last_usage”: “electric”, “first_usage”: “hvac” },

by the Tydom browser.

The parser in tydomMessageHandler.py does not take into account the “electric” last usage. To fix the issue, I added the following block of code (line ~#210):

    if i["last_usage"] == 'electric':
        device_name[i["id_endpoint"]] = i["name"]
        device_type[i["id_device"]] =  'boiler'
        device_endpoint[i["id_device"]] = i["id_endpoint"]

Now the device is correctly detected and managed by the parser as a boiler type device and MQTT and HASSIO do manage it correctly.

I hope you will introduce my fix in a next release of the add-on. Rgds,

mrwiwi commented 3 years ago

Thanks a lot ! :)