Over complicated a simple thing?

Hi,

I’ve been fiddling with some AliExpress Open/Close RF sensors, which only send ON/ON
Because i want to know what kind of state a window of door is in at this moment, i’ve written the below config.

It does work, however. i think i might have over complicated things a bit.
Reason why i’ve added so many aliases to a sensor is because every time it sends a different signal…

Does someone have a very bright idea how to make this cleaner?

binary_sensor:
- platform: rflink
  devices:
    Nummer7Open:
      name: Nummer7Open
      off_delay: 1
      force_update: true
      aliases:
        - selectplus_00a9f5_02
        - selectplus_0054fa_02
        - ev1527_02f560_0a
    Nummer7Dicht:
      name: Nummer7Dicht
      off_delay: 1
      force_update: true
      aliases:
        - selectplus_00a9f1_02
        - selectplus_0054f8_02
        - ev1527_02f560_0e  
- platform: template
  sensors:
    nummer7status:
      value_template: "{{ states.input_boolean.sensor_nummer7.state == 'on' }}"
      entity_id: input_boolean.sensor_nummer7
      device_class: door

input_boolean:
  sensor_nummer7:
  name: Sensor nummer 7
  initial: off
  icon: mdi:door

automation:
- id: 'Nummer7_deur_gaat_Open'
  alias: Nummer7_deur_gaat_Open
  trigger:
  - entity_id: binary_sensor.nummer7open
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      entity_id: input_boolean.sensor_nummer7
    service: input_boolean.turn_on
- id: 'Nummer7_deur_gaat_Dicht'
  alias: Nummer7_deur_gaat_Dicht
  trigger:
  - entity_id: binary_sensor.nummer7dicht
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      entity_id: input_boolean.sensor_nummer7
    service: input_boolean.turn_off

Hi Arthur,
Perhaps I’m a little bit late at this party but I think this should work for you:
`binary_sensor:

  • platform: template
    sensors:
    nummer7status:
    value_template: >
    {% if is_state(“binary_sensor.Nummer7Open”, “on”) %}
    dicht
    {% elif is_state(“binary_sensor.Nummer7Dicht”, “on”) %}
    open
    {% endif %}
    device_class: door`