machgo / fellerwiserhomeassistant

Integration to support Feller Wiser in HomeAssistant
21 stars 8 forks source link

Cover state inverted #2

Closed dtmichel closed 7 months ago

dtmichel commented 7 months ago

Thank you for this interesting custom integration. I installed it in my Home Assistant and tested it. What I noticed is that the state of the cover seems to be inverted.

Cover Status: 100% shows as "Closed" Cover Status: 0% shows as "Open"

100% in my setup means that the covers are all the way up, so open. 0% in my setup means that the covers are all the way down, so closed.

Starting with 100% and setting a value of 50% changes the status label from "Closed" over "Closing" to "Open". Going all the way down to 0% is still shown as "Open". Instead it should show "Open" over "Closing" to "Closed".

Did I maybe miss a configuration variable to change this behaviour?

kess78 commented 7 months ago

So I'm not the only one who had to change the states for open/closed positions.

I've made a PR for that issue, this is perfectly working for my setup at home. https://github.com/machgo/fellerwiserhomeassistant/pull/3

BTW, @machgo thank you very much for your work !

neokrunch commented 7 months ago

Hello, I would also like to thank @machgo for this integration, it works well on my installation (42 entities with 17 blinds and 25 lights). I have the same problem with the blinds: closed and open states are reversed.

machgo commented 7 months ago

Hi all, thanks for your feedback. I'll check the PR in the evening.

eugsterli commented 7 months ago

@kess78 not sure if you need this modification....i had the same issue some weeks ago when i started to use this integration.. the problem was only the updateExternal method...

something like this:

def updateExternal(self, position, moving): self._position = 100-(self._position/100)

ATM i have no access to my HA

dtmichel commented 7 months ago

I only inverted True and False in covers.py (twice):

if self._position >= 100:
   self._is_closed = True
else:
   self._is_closed = False

to:

if self._position >= 100:
   self._is_closed = False
else:
   self._is_closed = True
kess78 commented 7 months ago

@eugsterli The PR I submitted is probably not mandatory for everyone. There are status updates for every single state I personally use for me at home. It could be simplified for the most of the users, but in my situation it works just perfectly.

I'm sure @machgo will look into that as soon as he finds time. It's up to him to decide what to do with his own code. Perhaps he'll integrate my PR, perhaps he'll write something better...

machgo commented 7 months ago

the PR looked good for me, so I merged it. Now the integration shows the cover as open until it is at 0% (fully closed). Let me know if this makes sense for everyone or if we should have a different solution. Thanks again for your help :)

dtmichel commented 7 months ago

Thank you! Seems to work fine.