Alaramo: add tuya shutters (covers) as sensors

what is the easiest way to do that?

I know templates but it is a huge work for a simple task especially if you have many covers

template:
  - binary_sensor:
         - name: "covers Alarmo"
            state: "{{ is_state('cover.open_cover', 'opened') }}"
            state: "{{ is_state('cover.close_cover', 'closed') }}"
            device_class: window

is this right?

No it is not. Only one state option per binary sensor is allowed and the state of the entity is incorrect. Try this:

template:
  - binary_sensor:
      - name: "covers Alarmo"
        state: "{{ is_state('cover.open_cover', 'open') }}"
        device_class: window

thanks a lot… I have 5 covers will this work as a generic for all of them or such I change the - name: “covers Alarmo”. to each cover speratly?

You will need to create a binary sensor for each cover.

template:
  - binary_sensor:
      - name: "covers Alarmo 1"
        state: "{{ is_state('cover.open_cover_1', 'open') }}"
        device_class: window
      - name: "covers Alarmo 2"
        state: "{{ is_state('cover.open_cover_2', 'open') }}"
        device_class: window
      - name: # etc...

Copy and paste should make light work of it.

1 Like

on a previous code on the state was “opened”. not “open” also I renamed the name to show the open close

1 Like

To know for sure, the only place you can check the real state that is not “translated” by the front end to look pretty is Developer Tools → States

that was very helpful

1 Like