vdomos / domogik-plugin-mqtt

Domogik Plugin for send or receive MQTT messages
2 stars 0 forks source link

Dimmer support #2

Closed jschaeke closed 7 years ago

jschaeke commented 7 years ago

Hi, For a friend, I am opening up the QBUS (eqoweb) domotics by giving it an MQTT interface for receiving commands / broadcasting state (not yet on github, but will publish it later). Next step for me is to integrate these QBUS relais and dimmers (and later on sonoff switches) with their MQTT api in domogik with this plugin. I had some good results with arduino mqtt integration with this plugin; thanks for that! Unfortunately, I see the dimmer support is not yet in here. Would it be possible to add this? If it is too much trouble, I will try to do it myself and create a prq.

vdomos commented 7 years ago

Hi, Sorry, I don't understand.

In the MQTT plugin like other Domogik plugins, I can only add device with datatype like DT_Number, DT_Temp, DT_String ...

You can see datatypes here:
https://github.com/domogik/domogik/blob/develop/src/domogik/common/datatypes.json

tikismoke commented 7 years ago

For relays a dt_switch and for dimmers a dt_scaling.

jschaeke commented 7 years ago

Well I have dimmers for the Velbus plugin, it works with DT_SCALING, would like the same now for the QBUS dimmers (that I wrap with MQTT)... https://github.com/Cereal2nd/domogik-plugin-velbus/blob/master/info.json

vdomos commented 7 years ago

You can use a "mqtt.sensor_number" device and change datatype in configuration to a DT_Scaling. But there was a bug for that, I do not know anymore if it was fixed (I change it directly in DB).

If you want a DT_Scaling command , I could add the sensor and command if you want.

jschaeke commented 7 years ago

Yes you can as I will need it as soon as I start the integration probably next week... But if it ain't done yet I will do it and open a prq. There were indeed last year some issues with the dimmer when I integrated my own velbus dimmers, but we got that resolved.

vdomos commented 7 years ago

Added DT_Scaling sensor and command I just do a little test to verify

jschaeke commented 7 years ago

Finally I could test it; a corrupt sdcard was the culprit for the delay; but good news the first MQTT slider test I did was successful. I need however to translate a 0-100 value from the slider to a 0-255 value in MQTT but that I can handle myself. Thanks a lot!

tikismoke commented 7 years ago

Normally with dt_scalling you can set a Min/max value in in the sensor/command information, have a look at it in Domogik directly. It should be handle by client correctly (domoweb/domodroid)