Create a Binary Sensor that is on if a bunch of other binary sensors are all off

Hello you all,

I want to create a binary sensor that is on, if a bunch of other binary sensors are all off. As soon as one of the other sensors is on, my binary sensor should be off. How can I do that?

Example:
binary.sensor.wp_1
binary.sensor.wp_2
binary.sensor.wp_3

new sensor:
binary_sensor.wp_alloff

Thank you in advance!

template:
  - binary_sensor:
      - name: WP AllOff
        state: >
          {{ ['binary.sensor.wp_1', 'binary.sensor.wp_2', 'binary.sensor.wp_3'] 
          | select('is_state', 'off')| list | count == 3 }}
1 Like