-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added moving state to home assistant for TS130F Curtain/blind switch #15555
Conversation
dc20650
to
d4139ad
Compare
Can you remove the |
1f1b440
to
fa23b5c
Compare
Sure, just removed it. I went a bit further, but don't know if you want so many changes. If you like it, I can commit and push it, if not, just leave the PR the way it is.... |
What extra functionality does this bring? |
When you use only the 'moving' property of the device, you force the Home Assistant to make a prediction of the state when the cover is stopped, that's called the optimistic approach. And has an impact on performance, not that you'll notice, but it's there. |
Ah...forget about the try...catch thing, it does nothing, what I'm talking about is only related to the 'openState' and 'closeState'. |
Sounds good! Please add it to the pr |
584510c
to
357d99a
Compare
357d99a
to
ec9cedd
Compare
done {
...
"state_closed": "CLOSE",
"state_closing": "DOWN",
"state_open": "OPEN",
"state_opening": "UP",
"value_template": "{{ value_json.moving if value_json.moving and value_json.moving != 'STOP' else value_json.state }}",
} |
Thanks! |
@cmiguelcabral, would you consider expanding the PR to devices that are nearly identical, but currently do not benefit from this change? As it stands, the PR doesn't fix the behavior of these modules. |
Hi, Actually, I just ordered two of those. :-) |
Thanks for the prompt response! |
I had to revert this PR since it broke some Xiaomi covers: #15873 |
Looks like those covers report stopped instead of stop. |
Or maybe another fix could be making it as it did at first and using only the moving property. |
Curtain/blind switches like TS130F (https://www.zigbee2mqtt.io/devices/TS130F.html#tuya-ts130f) do not show the moving status on the home assistant. This happens because they use a different property to report the moving state, this property is called 'moving'.
This PR reuses the logic for the 'motorState' property (that some other cover switches might use) to report the cover moving state to the home assistant. It was already tested and it's working.
Also, I made some minor adjustments to the docker-compose file to make it possible to build the image directly using it.
Feel free to change something that you don't like or prefer in a different way, or just leave comments and I'll do it.