Hi!
I’m trying to get my 433 MHz magnetic sensor to change the state for one of my switches (i.e. when I open a door the switch will turn on). I’m using a Tellstick Duo and I’ve managed to make the system register when I open/close the sensor (now it is actually a switch and not a sensor).
I tried to use the “Copy switch” example from https://home-assistant.io/components/switch.template/ but I have problem understanding the " value_template: ‘{{ states.switch.source.state }}’" part of it.
switch:
platform: template
switches:
copy:
value_template: '{{ states.magnetic.switch.switch_31.state }}'
turn_on:
service: switch.turn_on
entity_id: switch.magnetic
turn_off:
service: switch.turn_on
entity_id: switch.switch_31
So what I’m trying to do is to get switch.switch_31 to turn on when switch.magnetic goes from the state off to the state on. Am I doing it the wrong way? How does the "value_template: "-part work?
Also, i get this error message in the log: “homeassistant.components.switch.template: Received invalid switch is_on state: . Expected: on, off, true, false”
//F