home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.72k stars 30.45k forks source link

Shelly cover position not working #52088

Closed Ababuy78 closed 3 years ago

Ababuy78 commented 3 years ago

The problem

I had to change the cover.py file to make the roller shutter position work. Updated the set_cover_position function as below:

    def set_cover_position(self, **kwargs):
        """Move the cover to a specific position."""
        pos = kwargs.get(ATTR_POSITION) #[ATTR_POSITION]
        self._dev.set_position(pos)
        self._position = pos
        self._update_ha_state()

What is version of Home Assistant Core has the issue?

core-2021.6.6

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Shelly

Link to integration documentation on our website

https://www.home-assistant.io/integrations/shelly/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

probot-home-assistant[bot] commented 3 years ago

Hey there @balloob, @bieniu, @thecode, @chemelli74, mind taking a look at this issue as its been labeled with an integration (shelly) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

chemelli74 commented 3 years ago

Hi @Ababuy78, did you calibrate the device ?

Simone

Ababuy78 commented 3 years ago

Hello @chemelli74,

Yes I did calibrate it prior to installing Shelly on Home Assistant.

Maybe I did not explain the issue fully, my bad.

It was't working through the HomeKit integration, on the Home Assistant interface it worked correctly. Somehow changing the method for getting the position attribute and rebooting Home Assistant got it to work correctly both in Home Assistant and the HomeKit integration.

thecode commented 3 years ago

@Ababuy78 looking at your code it looks like you modified a function from ShellyForHass and not from core Shelly integration. Are you sure you are using the Shelly integration, the Shelly integration does not have set_cover_position it has async_set_cover_position instead.

Ababuy78 commented 3 years ago

Oh, I see.

I installed and uninstalled ShellyForHass from Hacs trying to make it work, maybe something was left behind.

I will make a fresh install of Hass and configure everything again.

Thanks for the heads up!