Cover | on-off reversed (yes, I know...)

Hi,

I know this question has been asked (and answered) several times but, as a new HA user, I’m lost in the lexicon.

Sooo, I have an RFXCom device, that talks to a little relay that talks to an electric motor to open and close a moving “wall”.
This, in French is called my “Cloison”.
Anyway, it works in HA, except the control are reversed. It shows open when closed and vice-versa.
I read the instruction about the cover template to turn it around but I can not manage to make it work.
For the record, I’m very new to HA. I was a Domoticz user for years.

I tried to follow the documentation (Template cover - Home Assistant) but I don’t understand what are the name of the device (that I need to adapt to my situation) and the internal HA name (that are supposed to stay put in my situation)
In my setup, I currently have a “cover.cloison” that works to open/close the thing.
I also have a “binary_sensor.cloison” that doesn’t change at all if I open or close the cover.

By the way, I only have a UP and Down command. I do not have a Stop in HA. I don’t know if it is important.

Any help would be appreciated :slight_smile:

Thanks a lot in advance

PS : Sorry to ask a question that is already answered but I’m struggling with the terminology.

Here we are, I figured it out :smiley:

So, if you are in need of the same setup, here is what I did and the explanation.

First, to make my life easier, I installed the Studio Code Server addon
image

Using the Studio Code Server, I then edited the configuration.yaml to add

cover: !include covers.yaml

I created the covers.yaml file in the same directory as configuration.yaml and edited it.

The content is

- platform: template
  covers:
    cloison:
      friendly_name: Cloison
      unique_id: cover.cloison
      icon_template: mdi:archive
      device_class: shutter
      open_cover:
        service: cover.close_cover
        data:
          entity_id: cover.cloison_inv
      close_cover:
          service: cover.open_cover
          data:
            entity_id: cover.cloison_inv

Here are the keyword to understand WHAT we are doing.
In the following code, you will find
[EXISTING_ENTITY] : The device you base your new device on. You need to “create” your new inverted blind (for instance) in relation with an existing one.
[NEW_ENTITY] : The new inverted device.

- platform: template
  covers:
    [NEW_ENTITY]:
      friendly_name: [New Entity Friendly Name]
      unique_id: [New Entity Unique ID]
      icon_template: [New Entity Icon]
      device_class: [New Entity Device Class]
      open_cover:
        service: cover.close_cover
        data:
          entity_id: cover.[EXISTING_ENTITY]
      close_cover:
          service: cover.open_cover
          data:
            entity_id: cover.[EXISTING_ENTITY]
      stop_cover:
          service: cover.stop_cover
          data:
            entity_id: cover.[EXISTING_ENTITY]

[New Entity Friendly Name] can be what you want as display Name
[New Entity Unique ID] is a unique ID assigne to your entity. In our case, cover.[new_entity] could be a good id as soon as it is not already in use.
[New Entity Icon] can be selected here : Icons - Home Assistant
[New Entity Device Class] can be selected here : Cover - Home Assistant

Once you edited your covers.yaml file, go to Developer Tools > YAML > CHECK CONFIGURATION

If you don’t have any error, reload the configuration.

You should find your new entity in the list :smiley:

I hope it will help my fellow HA users to achieve the cover inversion :smiley: