This code I have for a label won’t show up in the UI as there must be an error in it:
label: '[[[ return "Upstrs Hlwy: " + ((float(states["sensor.hallway_shelly_motion_2_temperature"].state) * 9/5) + 32) | round(1) + "°F" ]]]'
However, this works perfectly in Developer-> templates:
{{ ((float(states["sensor.hallway_shelly_motion_2_temperature"].state) * 9/5) + 32) | round(1) }}
FYI, this does not work either:
label: '[[[ return "Upstrs Hlwy: " + {{ ((float(states["sensor.hallway_shelly_motion_2_temperature"].state) * 9/5) + 32) | round(1) }} + "°F" ]]]'
But, this does work (but shows it in centrigrade!):
label: '[[[ return "Upstrs Hlwy: " + states["sensor.hallway_shelly_motion_2_temperature"].state + "°F" ]]]'
Strangely, I have the settings on the Shelly Motion 2 set to display in F but in code in HA it stil shows in C!
So how do I convert it within a label (as X * 9/5 + 32 is the correct formula) . Where is my syntax wrong?