Page 1 of 1

MQTT Advice / Tips

Posted: Saturday 16 December 2017 17:29
by JoshDinsdale
Hi All

I have been using Domoticz for a couple of years now, but I now find myself needing to get involved with MQTT.

I am using Domoticz on a Pi with the built in MQTT and Node Red setup.

I am using Chris Mullins very cool ESP Milight controller https://github.com/sidoh/esp8266_milight_hub to control a number of Milight Bulbs and LED strips, which works very well in Domoticz via the controllers Milight gateway emulator.

What I'd like to do now, is to use my Milight remote to control the bulbs via domoticz, this will enable everything to stay in-state. This is doable via MQTT as the controller can listen for Milight signals (from the remote) and then forward those as MQTT messages. I have this working.

The issue that I have is that the format of the messages isnt in a format Domoticz can interprete, it is JSON, but doesnt have the right tags, (IDX etc). From what I understand, i should use Node Red in between to parse the messages so that Domotivz can understand them? Is this a correct assumption?

If so, does anyone have any links to any beginners guides to using Node Red to achieve such a solution?

Many thanks

Josh

Re: MQTT Advice / Tips

Posted: Thursday 01 February 2018 13:53
by aalwash
Use Node-RED, to convert the Milight JSON to a understandable Domoticz JSON (including IDX) and publish that on MQTT or do a HTTP-JSON call

Either using the build in 'split' blocks or make a simple JS function that returns the correct JSON format that Domoticz understands

Here are some examples how to use the functions-node in NodeRED https://nodered.org/docs/writing-functions