Fix curtain control module state "unknown" #1681
Replies: 3 comments 5 replies
-
This is incorrect. If a device has a dp that reports the current position of the curtain, it is handled in the block above that. The changes you have made are based on the last position the user requested the curtain to move to, which is often not updated at all, and may have been several commands ago. The only thing you can determine from such a curtain device is that the state is unknown. |
Beta Was this translation helpful? Give feedback.
-
This is intended to be handled by listing dp 2 as both position and current_position in the config. I have added It may apply to all QS C01 curtains, but my experience with Tuya curtains is that there are many variations in behaviour with the same dps mapping, so I thought it will be better to make a separate config. |
Beta Was this translation helpful? Give feedback.
-
Hi Jason,
This device (NH-ZS 108) doesn't have a specific dp for "current position".
It got only 5 dps:
1. control (open, stop, close)
2. percent_control (percantage)
3. cur_calibration (start, end)
8. Motor direction (control_back_mode)
10. Calibration time (tr_timecon)
You get "current position" from dp 2.
This is a module for push button switch. Meaning that the stop command is
handled by the module in order to stop operation (either at a certain
percentage or at the end of opening or closing by duration time calibrated).
So the only way to determine "is_closed" is by checking the combination of
0 percent (100 percent in case of inversion) position and cmd is "stop".
Thanks,
Naftali
…On Sun, Feb 25, 2024, 06:39 Jason Rumney ***@***.***> wrote:
This is incorrect. If a device has a dp that reports the current position
of the curtain, it is handled in the block above that. The changes you have
made are based on the last position the user requested the curtain to move
to, which is often not updated at all, and may have been several commands
ago. The only thing you can determine from such a curtain device is that
the state is unknown.
—
Reply to this email directly, view it on GitHub
<#1681 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALPSH2BI53OKVZGLL4Z72ITYVK57JAVCNFSM6AAAAABDYKVF4WVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DKOBQG4YDK>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
On cover.py _current_state function, "stop" command is not handled for devices with _control_dp, and therefore when curtain get the stop command it's state is not updated.
Fix-
Edit cover.py under tuya_local custom components and add the following lines at the end of the _current_state function under self._control_dp if statement (after line 154):
elif cmd == "stop":
if pos == 0:
return "closed"
else:
return "opened"
I hope the developers will include this in future releases.
Beta Was this translation helpful? Give feedback.
All reactions