I’m trying to set up automation that changes the saturation of a Tasmota controlled RGB LED. I need to know what the current Saturation is - ie have it as a numeric (0-100) value in an Entity. Every 5 minutes, Tasmota reports the State and the JSON payload contains an HSBColor element structured like this with 25 being the saturation in this example
Thanks Sir_Goodenough
No. That gives me the second character ie 7 from the example above.
Interestingly, another element in the MQTT message is Channel which has a pair of square brackets around another list of 3 numbers.
I’m no expert but I think that defines a list and so your idea would work in that case.
Edit - I just checked and your method does work for Channel with its square brackets in the json string. Still haven’t cracked the HSBColor Saturation though!
Thanks parautenbach
I tried your suggestion but it’s not working. Maybe I got the syntax wrong.
Here’s what I had in my yaml file to create the entity originally with just the [1] based on Sir_Goodenough’s suggestion. It returned the second character of the string as the entity value
Following the next MQTT message the value remained Unknown.
For context, this is the Glass Ball thing in question. It has 3 RGB LED driven by Tasmota using scheme 2 (which cycles through the colours). I want to change the Saturation at a much slower rate than the colour change.