Closed mcmanigle closed 6 months ago
States are strings. Should be converted to numbers first. Any math operations with strings may give unpredicted results. Try
from: ${parseFloat(TARGET_TEMP) - 10}
Thank you! Added parseFloat
to the variable declaration and it indeed works fine.
Checklist:
Release with the issue: 1.3.6 running on HA 2024.1.3 via HACS
Last working release (if known): N/A
Browser and Operating System: MacOS 14.0 running Safari 17.0
Description of problem: There seems to be an odd bug where addition in the templated fields doesn't work (but subtraction does). For example, trying to make a gauge card with a target temperature:
The above does not work (shows the last segment at the value of
TARGET_TEMP
, while the below works just fine:Note the second-to-last line of each YAML chunk.
Javascript errors shown in the web inspector (if applicable): None
Additional information: