I am trying to use blueprint for Sensor Light, however in triggers section I am supposed to use a binary sensor.
So I am trying to create a binary sensor using templates. I have a wall switch that doesn’t have on and off state, but instead it has action, which is null, but when I press a button, it changes to single_l1 for a short period of time.
I’d like to use this short change of action to toggle the binary sensor from on/off and vice versa. I’m new to home assistant and I haven’t been able to find out how to do that.
# configuration.yaml
template:
- trigger:
- platform: state
entity_id: sensor.living_room_switch_action
to: "single_l1"
binary_sensor:
- name: "My Light State" # or whatever you want to call it
state: "{{ not this.state if this.state is defined else false }}"