StyraHem / ShellyForHASS

Shelly smart home platform for Home Assistant
MIT License
621 stars 112 forks source link

[FR] Add last_direction attribute for covers #505

Open tomtoump opened 3 years ago

tomtoump commented 3 years ago

Is your feature request related to a problem? Please describe.

I have a remote control and I want to assign one button to open/stop/close a roller shutter. Having this attribute exposed in HA, will make my Node-RED flow simpler.

Describe the solution you'd like

This attribute is already present in the API, and I can see some mentions below, but it isn't exposed to HA as far as I can see. https://github.com/StyraHem/ShellyForHASS/blob/6feec4debdfa575504373ae3b1c45d3e2d600734/custom_components/shelly/cover.py#L119

Describe alternatives you've considered

I already replicate the last_direction with Node-RED, but it's adding complexity that isn't necessary.

Additional context

-

mbaluda commented 3 years ago

I also need this feature to control a roller shutter with one wireless button using shelly 2.5 I'd like the same behavior I get with the physical button connected in toggle mode

The HA API has the service cover.toggle that could be implemented to allow the loop open-stop-close-stop

wauswaus commented 3 years ago

Are input boolean helpers within Home Assistant not a solution for this? You can save the last direction yourself within an automation.

tomtoump commented 3 years ago

As I mention in the issue that's what I already do, but since this info is provided by the API it could be exposed through the integration.