Hi, I have 2 thermostatic valve in one room (Eurotronics Sprint, zwave) and I want to syncrozies them, meaning, if I change manually valve1 that the settemp is sent to valve2. It is possible to set a value via script but not the value from an anther on?
alias: Testscript
sequence:
- service: climate.set_temperature
entity_id: climate.thermostat_valve_2
data_template:
temperature: 20
mode: single
works perfectly, but here
alias: Testscript
sequence:
- service: climate.set_temperature
entity_id: climate.thermostat_valve_2
data_template:
temperature: {{ state_attr("climate.thermostatic_valve","temperature") }}
mode: single
the value of the attribute is not recognized / empty. The template works fine in dev.-tool / template. Any hint?
Maybe this is a string and then you need to the int filter:
{{ state_attr(āclimate.thermostatic_valveā,ātemperatureā) | int }}
You can try it in the developer tools, there is a section to develop templates
pedolsky
(Pedolsky)
January 15, 2022, 8:08am
4
Wrap it with quotes:
temperature: "{{ state_attr('climate.thermostatic_valve', 'temperature') }}"
Edit: Corrected wrong quotes
Thank you for tip, but unfortunately no change. Both things I tested in develop templeates. It seems to me, that this expression is ignored. If I would test it in script editor, the expression will be changed to {}
pedolsky
(Pedolsky)
January 15, 2022, 9:00am
6
{{ state_attr('climate.thermostatic_valve', 'temperature') }}
What is the result of the above in Dev Tools? If it is ānoneā, it is not an attribute. Check it under Dev Tools ā States
The result is the desired set temperture:
So the value looks correct now but itās still not working to set it to valve_2 ?
No, unfortunately not: āError rendering data template: Result is not a Dictionaryā
pedolsky
(Pedolsky)
January 15, 2022, 11:05am
10
This works for me: (and note the different quotes)
service: climate.set_temperature
target:
entity_id: climate.ir_heizung_wz
data:
temperature: "{{ state_attr('climate.ir_heizung_sz', 'temperature') |float}}"
Thank you, thatās it! I did in this way and it works now: