mnordseth / enet-homeassistant

Enet Smart Home integration for Home Assistant
Apache License 2.0
26 stars 7 forks source link

Blinds show wrong state #15

Closed joergpichler closed 1 year ago

joergpichler commented 1 year ago

Hello Magnus,

I have Jung Blinds actuators and they show the wrong state using this integration. When they are fully openend they show up as fully closed. I guess the problem is that in the code 100 is mapped to fully open which is the other way round for my blinds actuators.

I could provide any debug information if needed.

Regards Jörg

mnordseth commented 1 year ago

Hi Jörg,

I do not have any blind actuators in my setup, so any help debugging this would be appreciated.

Can you provide a table where you set the blind from the enet app to Closed, Open and show the corresponding state in Home Assistant?

Thanks, Magnus

joergpichler commented 1 year ago

Heres a quick table I created, the values in Home Assistant are inverted and can even go beyond 100%

eNet App Home Assistant
0% (open) Closed
15% 216%
35% 165%
59% 104%
83% 43%
97% 7%
100% (closed) Opened
mnordseth commented 1 year ago

Thanks!

Can you also test the other way around, ie set it from HA and read the state in the enet app?

joergpichler commented 1 year ago

Sure

Home Assistant eNet App Value shown in Home Assistant once it reaches destination
Closed 0% (open in reality) Closed
83% 68% 81%
57% 78% 56%
17% 94% 15%
Open 100% (closed in reality) Open

Also the UI control does not match the physical reality.

grafik The blind in the control is dragged fully down but it says open? Should be the extact opposite...not sure if this is related to the underlying issue

mnordseth commented 1 year ago

I just pushed a new release that I hope should resolve this. Please test it and let me know.

joergpichler commented 1 year ago

Unfortunately the values are still all over the place. I did some testing in a fork an just changed stuff in those 2 methods around and added some debug logging. I found out that the range from 0-255 is incorrect and it should be 0-100. But I cannot get the UI to function properly. I tried 0-100 and inverting it. Open is still closed and closed is still open. I guess blinds in Home Assistant are not the same as blinds in Germany...

mnordseth commented 1 year ago

Great that you have it running with debug. I am very much in the blind here... Did you remember to change the is_open() function as well?

joergpichler commented 1 year ago

That fixed the open / closed confusion. Now just the UI still needs to be fixed. Any hints on how to make the blind closed (i.e. fully down) when it's closed and vice versa? grafik grafik

mnordseth commented 1 year ago

Great progress! My guess would be that is_open() is what drives the label / text, and that the UI is from the integer value.

joergpichler commented 1 year ago

I tinkered with the code a bit and finally found the solution for my shutters / blinds. I really do not know the best english word for german "Rollladen", which is something that rolls down outsied over the windows.

mnordseth commented 1 year ago

Thanks for figuring this out. I have merged your pull request and published a new version. Looking at the description of device classes at https://www.home-assistant.io/integrations/cover/ the shade may sound most like what you describe.