I have an MQTT sensor that publishes a color as a string in the format “#GGRRBB”. In other words pure green would be #FF0000. I would like to convert that to 3 ints. I’ve be futzing around with the template in the developer tools, but I can’t even get slice to work.
{{states('sensor.maintank_color")}} displays #ffffef which is correct. Is there a way with templates to convert that to 3 ints?
The end goal is ultimately mostly pointless. It will allow me to plot the RGB values separately. That said, I have a better understanding of what I was doing wrong and hopefully I’ll be able to apply that in the future. Thanks!