Hi, i have this switch template and i need help to do a flow.
script:
tv_cozinha_on:
sequence:
- service: broadlink.send
data:
host: 192.168.1.87
packet:
- 'JgBYAAABJZQRExESEhISEhISEhISNhISEhISEhISEhIRExETETcSEhISEjYSEhI3EhIRExESEhISNxISETcSEhI3ETcSNxI2EgAGDgABJkoSAAxCAAElShIADQU='
tv_cozinha_off:
sequence:
- service: broadlink.send
data:
host: 192.168.1.87
packet:
- 'JgBYAAABJZQRExESEhISEhISEhISNhISEhISEhISEhIRExETETcSEhISEjYSEhI3EhIRExESEhISNxISETcSEhI3ETcSNxI2EgAGDgABJkoSAAxCAAElShIADQU='
switch:
- platform: template
switches:
tv_cozinha:
friendly_name: "Tv Cozinha"
value_template: '{% if states.sensor.ldrtvcozinha.state|int > 400 %}on{% else %} off {% endif %}'
turn_on:
service: script.tv_cozinha_on
entity_id: script.tv_cozinha_on
turn_off:
service: script.tv_cozinha_off
entity_id: script.tv_cozinha_off
icon_template: mdi:television