Hi!
still pretty new to HA, I hope, this question is not already answered (I could not find anything tough).
After successfully setting up some milights using mqtt, I am now trying to setup a more comlpex light (esp-rgbww from fhem) in HA.
But I am a little bit lost.
This controller wants to get a json message like this:
where h, s and v are the most interesting parts of the story.
(To turn it off, v has to be 0, as there seems to be no off command).
Could please anyone give me a hint how to tell HA to send a json message like that while setting H, S and V correctly?
Best regards and thanks in advance,
Otto
I don’t know how you’ll be sending this (e.g. publishing the message yourself to your broker), but this would be the general pattern in a template:
{% set d = {"foo": "bar", "bas": -1} %}
{{ d | to_json }}
Depending how you’ll be using this, e.g. if you will have the same basic structure for different commands, and need to parameterise some keys, a Jinja macro would be useful.