mak-gitdev / HA_enoceanmqtt

Home Assistant wrapper for enocean-mqtt (https://github.com/embyt/enocean-mqtt)
GNU General Public License v3.0
54 stars 14 forks source link

Issue with D2-05-00 cover position #94

Open mak-gitdev opened 8 months ago

mak-gitdev commented 8 months ago

Discussed in https://github.com/mak-gitdev/HA_enoceanmqtt/discussions/93

Originally posted by **didi31** November 13, 2023 I would like to move from Domoticz to Home assistant. I have 3 covers module EVOLOGY (Leroy merlin) which are provided by Nodon and Nodon told me that they are exactly the same than the Nodon ones. I got the identity of each module from the enocean hardware of Domoticz. Contact switch are working perfectly. I did the following for the cover. - Set the conf: [Volet/chambre] address = 0x05A21EE5 rorg = 0xD2 func = 0x05 type = 0x00 - Switch the learn button to On - Follow the procedure for pairing. The module does not react as written In the EVOLOGY procedure but I can move the cover up with HA. However as soon as the cover is open, the arrow to move the cover down is greyed and I cannot close it. Is there something wrong in what I did?
mak-gitdev commented 8 months ago

This issue might be related to some previously reported issues in the discussion panel: https://github.com/mak-gitdev/HA_enoceanmqtt/discussions/36#discussioncomment-4788409 https://github.com/mak-gitdev/HA_enoceanmqtt/discussions/36#discussioncomment-5688532 https://github.com/mak-gitdev/HA_enoceanmqtt/discussions/65

In fact the position reported from the EEP is 0 when the cover is open and 100 when the cover is closed. But HA expect 0 when the cover is closed and 100 when the cover is open.

The mapping below will be added to create a second cover entity to fix that:

            - component: "cover"
              name: "cover2"
              config:
                 command_topic: "req"
                 payload_open: >-
                    {"CMD":"1","POS":"0","ANG":"127","REPO":"0","LOCK":"0","CHN":"0","send":"clear"}
                 payload_close: >-
                    {"CMD":"1","POS":"100","ANG":"127","REPO":"0","LOCK":"0","CHN":"0","send":"clear"}
                 payload_stop: >-
                    {"CMD":"2","CHN":"0","send":"clear"}
                 position_topic: "CMD4"
                 position_open: 0
                 position_closed: 100
                 position_template: "{{ value_json.POS }}"
                 set_position_topic: "req"
                 set_position_template: >-
                    {"CMD":"1","POS":"{{ 100 - position }}","ANG":"127","REPO":"0","LOCK":"0","CHN":"0","send":"clear"}
                 tilt_status_topic: "CMD4"
                 tilt_status_template: "{{ value_json.ANG }}"
                 tilt_command_topic: "req"
                 tilt_command_template: >-
                    {"CMD":"1","POS":"127","ANG":"{{ tilt_position }}","REPO":"0","LOCK":"0","CHN":"0","send":"clear"}

I won't replace the existing cover entity for the moment as it seems to work in some cases. I will recommend every users with that issue to migrate to use this cover2 entity instead of using custom mapping file.

olivierkeke commented 8 months ago

Thanks! I confirm cover position is now correct with suggested cover2 code and NODON/ubiwiz rollershutter modules.