hi, i have setup template lights, i can control my lights also externally, so the state of a light/switch changes when my sensor changes, every 30 secs , so thats working fine
see below
the only disadvantage, if i turn on the light from within in HA, the state of the icon doesnt change instantly, only after 30 seconds, not a big deal, but i wanted to change it instanly, its nicer …
so i have setup CURL shell commands, that only change the state of the ICON, not actually turning on/off the light, but is a CURL command the only option to change states?
i want to get rid of my curl/shell commands …
shell:
state_wc_on: "curl -k POST -d '{\"state\": \"on\",\"attributes\": {\"assumed_state\": true,\"friendly_name\": \"WC\",\"icon\": \"mdi:lightbulb-on\"}}' https://127.0.0.1:8123/api/states/light.wc"
state_wc_off: "curl -k POST -d '{\"state\": \"off\",\"attributes\": {\"assumed_state\": true,\"friendly_name\": \"WC\",\"icon\": \"mdi:lightbulb-on\"}}' https://127.0.0.1:8123/api/states/light.wc"
wc:
friendly_name: "WC"
value_template: "{{ states.sensor.Prog.state[44:46] == '01' }}"
turn_on:
- service: switch.turn_on
data:
entity_id: switch.light14
- service: shell_command.state_wc_on
turn_off:
- service: switch.turn_off
data:
entity_id: switch.light14
- service: shell_command.state_wc_off