Skip to content
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

Zemismart Smart Curtain Rail #249

Closed
Fannangir opened this issue Oct 22, 2022 · 5 comments
Closed

Zemismart Smart Curtain Rail #249

Fannangir opened this issue Oct 22, 2022 · 5 comments

Comments

@Fannangir
Copy link

Fannangir commented Oct 22, 2022

I have added Zemismart Curtain into the integration, it has detected the type automatically.
The control (arrows) and the position control works, but it does not provide feedback of the position bar, if moved using the arrows.
I have looked into dpids in tuya cloud platform, it uses dpid 1 for basic control, dpid 2 for position control, dpid 3 for current position.
Does the integration implement dpid 3 to read current curtain position?

Information from cloud platform:
{
"result": {
"category": "cl",
"functions": [
{
"code": "control",
"dp_id": 1,
"type": "Enum",
"values": "{"range":["open","stop","close"]}"
},
{
"code": "percent_control",
"dp_id": 2,
"type": "Integer",
"values": "{"unit":"%","min":0,"max":100,"scale":0,"step":1}"
},
{
"code": "control_back",
"dp_id": 5,
"type": "Boolean",
"values": "{}"
}
],
"status": [
{
"code": "control",
"dp_id": 1,
"type": "Enum",
"values": "{"range":["open","stop","close"]}"
},
{
"code": "percent_control",
"dp_id": 2,
"type": "Integer",
"values": "{"unit":"%","min":0,"max":100,"scale":0,"step":1}"
},
{
"code": "percent_state",
"dp_id": 3,
"type": "Integer",
"values": "{"unit":"%","min":0,"max":100,"scale":0,"step":1}"
},
{
"code": "control_back",
"dp_id": 5,
"type": "Boolean",
"values": "{}"
},
{
"code": "work_state",
"dp_id": 7,
"type": "Enum",
"values": "{"range":["opening","closing"]}"
}
]
},

@make-all
Copy link
Owner

There is no specific support for this device. I think it has detected the simple blinds controller, which is missing dp id 3.

@Fannangir
Copy link
Author

OK, understood.
Is there a chance you could add it please?

@Fannangir
Copy link
Author

@make-all, could you please look into it?
The issue is that I loose synchronization between the actual position when I pull the curtain, to its state in HomeKit.
When I pull the curtain by hand, it moves all the way, and the synchronization lost.
Thanks.

@make-all make-all added the new device Unsupported device label Oct 27, 2022
make-all added a commit that referenced this issue Oct 30, 2022
@make-all make-all added awaiting confirmation Wating for confirmation the issue is solved unreleased Will be in next release and removed new device Unsupported device unreleased Will be in next release labels Oct 30, 2022
@Fannangir
Copy link
Author

@make-all, confirmed working.
Thank you very much.
Just one thing that I have noticed, the response seems to be slow.
Meaning, when I open or close the curtain (using the open/close arrows), and decide tp stop, it takes about 2~4 seconds until it actually stops.
Regarding status, same phenomenon, but seems like the delay is a bit bigger.
It could take above 5 seconds to update actual curtain position.
Is there something that could be configured to reduce the delay?
Thanks.

@make-all
Copy link
Owner

make-all commented Nov 3, 2022

For update speed, see #176

@make-all make-all closed this as completed Nov 3, 2022
@make-all make-all removed the awaiting confirmation Wating for confirmation the issue is solved label Nov 3, 2022
make-all added a commit that referenced this issue Jan 11, 2023
  - create a loop for reading from the persistent connection.
  - read from that loop in a separate async task
  - register links back to entities from the device so that we can asynchronously inform HA of updates
  - remove the old poll mechanism
  - make some old synchronous methods asynchronous, remove duplicates where there were both
  - use asyncio.sleep instead of a separate Timer thread to send with delay
  - send things without waiting for replies (as the reply will come through the read loop)
  - keep track of what was sent and avoid sending it again while we are keeping it to reflect in state.
  - call the api asynchronously in the retry method to avoid blocking the event thread, and return the return value.
  - use HomeAssistant lifecycle events to avoid delaying startup and shutdown

    Issue #92, #146, #176, #231, #249, #253, #277, #286, #311, #330
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants