NodeRed / MQTT update switches

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

Post Reply
OedzesG
Posts: 106
Joined: Monday 11 March 2019 0:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

NodeRed / MQTT update switches

Post by OedzesG »

Hallo,

Hope there is someone out here how can help me with updating switches from MQTT domoticz in.

I succeed connecting Domoticz with MQTT, also with dummy devices to gave my control to my light group.

But for some light groups i not only use Domoticz but also the philips HUE remote dimmer.
The binding is happening in the Zigbee2mqtt frontend (web ui) this all works amazing!

But after changing the state with the remote dimmer, the dummy state in Domoticz is not up to date.

I tried in node-red to let the group trigger a flow and send then the correct "new" data back to Domoticz, but when the dummy is updating it also activates the flow for controling the group.. so i smash everything in a loop... :o :shock:

Also i tried to use the uservariables and then with dzvents update the dummy switch and thinking maybe i could use .siltent() but i guess becouse node-red is outsite of domoticz .siltent is not working and the loop started again.

So every solution to update the switch without trigger would be wonderfull!!!

The 2nd question is about converting values.
The Domoticz dummy uses:

0 - 100% for brightness
0 - 255 for color_temp

node red uses:

0 - 255 for brightness
0 * 500 for color_temp

at the moment i succeed with this:

Code: Select all

	{msg.payload = {"state": "ON",
					 "brightness": msg.payload.Level*2.55,
					 "color_temp": msg.payload.Color.ww*1.96};
But i think there is maybee a better way to do this?

thnx in advance!!
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: NodeRed / MQTT update switches

Post by waaren »

OedzesG wrote: Wednesday 16 December 2020 11:22 I tried in node-red to let the group trigger a flow and send then the correct "new" data back to Domoticz, but when the dummy is updating it also activates the flow for controling the group.. so i smash everything in a loop... :o :shock:
You should be able to prevent a (MQTT) loop in the settings of your MQTT hardware module in domoticz.
MQTT.png
MQTT.png (86.94 KiB) Viewed 1046 times
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest