switchbot-mqtt icon indicating copy to clipboard operation
switchbot-mqtt copied to clipboard

Is it possible to update state when curtains are moved by remote or physical movement of the curtains?

Open stridger opened this issue 4 years ago • 9 comments

Switchbot Curtain can be controlled by using the Switchbot remote or by physically pulling the curtain. Is it possible for switchbot-mqtt to pick up on such actions and update the mqtt state accordingly?

stridger avatar Mar 11 '21 14:03 stridger

This project is based on the PySwitchbot library

Unfortunaley, PySwitchbot does not yet provide state information: https://github.com/Danielhiversen/pySwitchbot/blob/0.9.1/switchbot/init.py#L132

As soon as PySwitchbot supports reporting of states, I can implement reporting in switchbot-mqtt.

Upstream issue: https://github.com/Danielhiversen/pySwitchbot/issues/18

fphammerle avatar Mar 11 '21 18:03 fphammerle

That makes sense, thank you!

stridger avatar Mar 11 '21 19:03 stridger

relevant pull request: https://github.com/Danielhiversen/pySwitchbot/pull/21

fphammerle avatar Apr 06 '21 15:04 fphammerle

Hi, it seems the upstream pull request mentioned has been merged :-) I'm eager to see if it will work, hope you have some time to update it on your end.

PS, I;''m running a RBPi3B+ with the 0.6.0-armv6 docker container, seems to work ok :)

oetelaar24 avatar Apr 21 '21 07:04 oetelaar24

Hi, we'll need a new release containing that MR first: https://github.com/Danielhiversen/pySwitchbot/releases

fphammerle avatar Apr 21 '21 15:04 fphammerle

It's here :) https://github.com/Danielhiversen/pySwitchbot/releases/tag/0.10.0

oetelaar24 avatar May 12 '21 21:05 oetelaar24

Hi, is there any plan to update the state along with motor position? Currently it seems to get stuck on closing.

toddrob99 avatar Mar 15 '22 00:03 toddrob99

Hi, plans yes, but it hasn't been implemented yet.

fphammerle avatar Mar 15 '22 19:03 fphammerle

for reference: SwitchbotCurtain.get_basic_info returns a boolean "inMotion", which could be used for updating the device state: https://github.com/Danielhiversen/pySwitchbot/blob/0.13.3/switchbot/init.py#L709 should be added here: https://github.com/fphammerle/switchbot-mqtt/blob/v3.0.0/switchbot_mqtt/_actors/init.py#L160

fphammerle avatar Apr 02 '22 13:04 fphammerle