fphammerle / switchbot-mqtt

MQTT client controlling SwitchBot button automators & curtain motors, compatible with Home Assistant :house_with_garden: 🐳
https://pypi.org/project/switchbot-mqtt/
GNU General Public License v3.0
51 stars 9 forks source link

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

Open stridger opened 3 years ago

stridger commented 3 years ago

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?

fphammerle commented 3 years ago

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

stridger commented 3 years ago

That makes sense, thank you!

fphammerle commented 3 years ago

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

oetelaar24 commented 3 years ago

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 :)

fphammerle commented 3 years ago

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

oetelaar24 commented 3 years ago

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

toddrob99 commented 2 years ago

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

fphammerle commented 2 years ago

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

fphammerle commented 2 years ago

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