Beginner: Binary Sensor to follow the state of a Toggle helper

Hi
currently going round in circles.
I am trying to create a binary sensor helper that reads a toggle switch position, I’ve seen many discussions about making toggles follow a binary sensor value but not the other way round.

I have a device for blind control that only takes the Binary Sensor values.
I’ve then creating a Binary Sensor Template and fix it to my toggle Switch

binary_sensor:
platform: template
sensors:
opening_lounge_Center:
friendly_name: (LC) Custom Position Full Open Sensor
device_class: Opening
value_template: “{{ is_state(‘input_boolean.lc_blind_open’,‘on’) }}”

this is what i’ve found from searching around.
but when I toggle the switch the sensor stays closed.

am I missing something?

First of all you are using old style format so need to update to new style as per https://www.home-assistant.io/integrations/template/#binary-sensor

If you put your code inside tags (</> button) if will be structured and much better readable for help.
Note that spacing is of importance with yaml code.

# Example state-based configuration.yaml entry
template:
  - binary_sensor:
      - name: Sun Up
        state: >
          {{ is_state("sun.sun", "above_horizon") }}

Just to add to the previous post… you are no longer limited to doing this in YAML since Template Binary Sensors can be created through the Helpers menu as well:

1 Like

ah brilliant thank you very much all working now :slight_smile: