Hello, I am currently trying to have a script triggered by a button. Only I need here service_template or similar. This seems not to work directly on the button. The script should definitely not be outsourced. Does anyone have an idea?
As soon as I use service_template instead of service_data I get the error message: Error when calling the service climate/set_temperature. must contain at least one of temperature, target_temp_high, target_temp_low.
Unfortunately, this is not an alternative. So I would have to create an almost identical script about 30 times. That would be the horror. I try my luck with the button card. Maybe it works by button_template.
There’s still plenty of ways to get what you want probably but you only asked about this single button. What is your intentions with all your buttons? Because you can tailor your script to run anything.
Thanks Petro four your quick feedback , Indeed it would’ve been possible and more flexible if we’re able to template the whole data_template (similarly to the service_template) which means :
sequence:
service_template: >
{% if states("media_player.googlehome7136") in ["off","on"] %}
servicea
{% else %}
serviceb
{% endif %}
data_template: >
{% if states("media_player.googlehome7136") in ["off","on"] %}
data.a1 = xxxx
data.a2= yyyy
{% else %}
data.b = zzzz
{% endif %}
currently we’re only able to template the values in the dictionnary in data-template