I’m new to Home Assistant/MQTT and all this other wonderful HA stuff. I’m having some trouble getting a light to work via MQTT.
Here’s my setup:
I have Hue Bulb (connected via ST Hub).
HA is running on Raspbian Jessie using the one-click installer. The only mod is that I switched to mysql db.
ST is connected to HA via ‘smartthings-mqtt-bridge’, which I have running in the background.
MQTT messages are being successfully sent from HA -> ST.
MQTT messages are being successfully received from ST -> HA.
The problem I am trying to figure out right now is the color temperature situation. From what I read here on the forums is that HA uses the Mired scale. Well, the Hue on ST uses the Kelvin scale. I am able to use templating to convert the incoming Kelvin scale to the Mired scale for HA.
However, I don’t know how to convert the outgoing Mired scale to Kelvin for ST. Yes, I know, just divide it by 1e7 again. But I don’t know where to plug this in. The documentation for MQTT_Light shows color_temp_value_template but from what I gather, that is the templating for incoming data, not outgoing.
Me too. Sylvania Lightify RGBW Bulbs, SmartThings Hub using MQTT bridge. I feel like I’m going to run into the same issue with the RGB side of things too, since the Lightify bulb expects /hue and /saturation topics.
Hi. I have a similar question, so I thought I’d add here rather than post a fresh topic…
I need to set a particular format for brightness changes, like: $hardware/status/reset {"brightness": 89}
but my HA MQTT light sends just: $hardware/status/reset 89
So all I need is to wrap that brightness value in a string…
I found mqtt_template light platform, but it only has on/off templates, not templates for other outgoing commands like brightness.
Is this just not possible at the moment, or am I missing something to make it possible?
Jared,
Where did you end up landing with this? I’m considering making a PR for a new MQTT Light component that supports the hue/saturation channels since I’m in the same boat. I would love to see your code if you have it pushed somewhere.
I also started a GitHub issue to get feedback before I start my own endeavor.
could you please elaborate what you have done? as far as I can see there is no HSL in mqtt yet - as I am also using ST I am surely interested in getting this to work
I modified the mqtt.light platform and made a custom component - that way you don’t need to alter core scripts.
The only quirk is that the mired values HA uses goes down to 2000 Kelvin equivalent. Assigning a value lower than the 2700 my bulbs use just results in the bulbs going to 2700 and the slider’s effective minimum isn’t absolute 0 on the slider.
This post is very old, and the mqtt light component that my example is built off is equally as old. It will not work on newer versions.
However, the change to the code remains the same to this day. I can post my most recent version, I think I’m a few versions back. it’s as easy as copying my modifications to the same spot in the most recent version of the mqtt light code
Unless someone wants to integrate this into the platform, perhaps with a conditional flag on the devices themselves for this conversion, it will remain clumsy. I’m not really source savvy.