I tried the above config, with the math being "old value - old min, * new max - newmin) / old max - old min) (see this SO link which should convert mired to kelvin (even if the color bars are in revers).
but when I reload the configuration and try adjusting the slider, I still see see mired values being passed to mqtt bridge:
info: Incoming message from MQTT: smartthings/LIFX livingroom/colorTemperature = 500
info: Skipping duplicate message from: smartthings/LIFX livingroom/colorTemperature = 500
info: Incoming message from MQTT: smartthings/LIFX livingroom/switch = on
info: Skipping duplicate message from: smartthings/LIFX livingroom/switch = on
info: Incoming message from MQTT: smartthings/LIFX livingroom/colorTemperature = 186
info: Incoming message from MQTT: smartthings/LIFX livingroom/switch = on
info: Skipping duplicate message from: smartthings/LIFX livingroom/switch = on
info: Incoming message from MQTT: smartthings/LIFX livingroom/colorTemperature = 153
am i doing something wrong, or is it completely impossible to translate to kelvin? this seems like a flaw in the design of HA, since most bulbs have a kelvin value. Thanks in advance
There has to be a way to force values back out rather than what the slider is providing, is there some debug log i can turn on or something? maybe it should be “value.color_temperature” or something and not just value…
I’ve only added the Int, I’ve not actually checked the validity of your formula.
Having had another look, you’ve defined color_temp_template yet the docs define this as color_temp_value_template?
I’ll look into that. Thanks…for now i found this which seems that it was never solved… with the template i posted aove the slider moves when i change kelvin in smartthings app, but it doesn’t work in reverse, still get mired values being sent out.