MQTT Advice / Tips

Moderator: leecollings

Post Reply
JoshDinsdale
Posts: 29
Joined: Monday 24 February 2014 14:31
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

MQTT Advice / Tips

Post 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
aalwash
Posts: 6
Joined: Saturday 06 January 2018 11:17
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9168
Contact:

Re: MQTT Advice / Tips

Post 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
RPi3 , Xiaomi Door Window sensors, Xiaomi Temp+Humidity sensors, Zigbee2MQTT (Zigbee CC2531), Hacked Toon
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest