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

Tydom lights #4

Closed nnospam closed 4 years ago

nnospam commented 4 years ago

Hi,

I have downloaded your code and been able to get it working with covers. I have some more devices (lights and one gate). This is what I get in the first message exchange (msg_config) on top of all the covers.

{ 'last_usage' : 'light', 'id_endpoint' : 1572022259, 'name' : 'Luz Sotano', 'id_device' : 1572022259, 'first_usage' : 'light', 'picto' : 'picto_lamp' }

{ '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'

}

It did not work with these devices for several reasons. The list of devices is retrieved using a 'msg_config' incoming data and this needed some amendment, otherwise the data is classified as msg_data. This made it work.

    # Detect type of incoming data
    if (data != ''):
        if ("id_catalog" in first):
            print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
            print('Incoming message type : data detected')
            msg_type = 'msg_config'
        elif ("id" in first):
            print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
            print('Incoming message type : data detected')
            msg_type = 'msg_data'
        elif ("date" in first):

Then, there is a device type alarm_control_panel and cover. A light may be needed. For the device 1572022259 (light) I get these attributes. { 'id' : 1572022259, 'endpoints' : [{ 'id' : 1572022259, 'error' : 0, 'data' : [{ 'name' : 'thermicDefect', 'validity' : 'upToDate', 'value' : False }, { 'name' : 'level', 'validity' : 'upToDate', 'value' : 0 }, { 'name' : 'onFavPos', 'validity' : 'upToDate', 'value' : False } ] } ] }

If needed, I could provide you with json samples of these devices or any log output. For instance, mqtt topics, etc.

mrwiwi commented 4 years ago

I will check that when i got time !

MinePlugins commented 4 years ago

Any update ? I have light if you want we can exchange to add light to your addon

MinePlugins commented 4 years ago

I have open a PR with light

mrwiwi commented 4 years ago

Thanks a lot, merged PR :) I don't have a lot of time...