DaveTiff
(Dave T)
August 2, 2023, 8:11pm
1
Hi I am playing around with the Template editor trying to learn. This works and prints on the screen the correct value
{% set myvalue = (states('input_number.value_one')|float-1) %}
{{ myvalue}}
But I want to set another helper from this helper and this does not work
{% set (states('input_number.value_two') = (states('input_number.value_one')|float-1) %}
What am I doing wrong, simple I know but I want to lean
Re Dave
You can’t change the state value from a template alone, you need to use a Service call… for example in an automation, script, or the Services tool in Developer Tools.
service: input_number.set_value
target:
entity_id: input_number.value_two
data:
value: "{{ states('input_number.value_one') | float - 1 %}"
DaveTiff
(Dave T)
August 3, 2023, 7:21am
3
Many thanks for taling the time to reply, always learning