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.
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: