Hi,
I’ve set up a template sensor like this:
{% set zone0 = states('sensor.ac_enabled_zone_0') %}
{% set zone1 = states('sensor.ac_enabled_zone_1') %}
{% set zone2 = states('sensor.ac_enabled_zone_2') %}
{% set zone3 = states('sensor.ac_enabled_zone_3') %}
{% set zone4 = states('sensor.ac_enabled_zone_4') %}
{% set zone5 = states('sensor.ac_enabled_zone_5') %}
{% set zone6 = states('sensor.ac_enabled_zone_6') %}
{% set zone7 = states('sensor.ac_enabled_zone_7') %}
{{ zone0+","+zone1+","+zone2+","+zone3+","+zone4+","+zone5+","+zone6+","+zone7 }}
The message on the template says:
This template listens for the following state changed events:
- Entity: sensor.ac_enabled_zone_0
- Entity: sensor.ac_enabled_zone_1
- Entity: sensor.ac_enabled_zone_2
- Entity: sensor.ac_enabled_zone_3
- Entity: sensor.ac_enabled_zone_4
- Entity: sensor.ac_enabled_zone_5
- Entity: sensor.ac_enabled_zone_6
- Entity: sensor.ac_enabled_zone_7
So ideally, all I have to do is set up 8 button cards, one for each zone, and when one of the buttons is pressed, it toggles the state of the zone between 0 and 1 and the template returns the latest states of the zones and I can just send it to the server using a REST PUT command.
I guess I can get the buttons to call a script but how do I set the value of the sensors in a script?
Thanks.