-
Notifications
You must be signed in to change notification settings - Fork 414
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
1/2/3/4 Buttons Switch #253
Comments
Sure, some powerstrips are supported already. But there is no consistency over how the dps are laid out, so yours may not be compatible with one of the existing ones. If you configure as a simple switch, then download the diagnostics for the device the full dps layout will be visible (from Settings/Devices, selecting your device from inside the Tuya Local section and there should be a menu option to download diagnostics). That doesn't tell the meaning of the dps, but for switches it is usually quite obvious, as there are booleans for the switches, and potentially integers for timers and/or voltage/current/power/energy readings. |
Thank you very much. The following is for a 1 Gang switch: The following is for a 2 Gang switch: The following is for a 3 Gang switch: The following is for a 4 Gang switch: |
- 1/2 gang added as specific devices, as they contain backlight control, timers and initial state configuration. - 3/4 gang added as generic devices, as they simply contain the switches with no other features, and are likely to match other similar devices (even as partial matches if the other devices have more features). Issue #253
Just tried to setup a 1-Gang and 2-Gang switches. |
Despite being listed in the tuya portal, this does not appear in the local data. It may be a write-only dp, but these are not supported. Issue #253
It looks like the dpId 14 that is listed in the tuya portal is missing from the local data. I assume this is the same case for the single switch as well. |
I have just updated the files and added the 2-gang switch with no issues, detected both gangs, background light and timer. |
```
"cached_state": {
"1": false,
"updated_at": 1667296757.625818
},
That looks like it is just a simple switch, there are no extra features to
expose. I'll leave the config there in case there is a variant of this
that matches the iot.tuya.com documentation.
|
That is what I thought. The switches are probably different. A small edit: Do you have a clue what could be the issue? |
Just tested a bit more. |
Delays in getting data from devices are a general problem, with local tuya connections, since the state needs to be polled from the device. Many devices refuse connections or reboot and misbehave if polled too quickly, so for stability this integration polls only every 30 seconds. Previously we did try polling at 10s intervals, but some devices had problems at that rate. |
Got the point. |
The update speed already has its own issue open at #176. I just had a look at localtuya's internal modified pytuya implementation, and I think I understand how they are using persistent connections to get timely updates. |
Same problem: Are detected as 1gang switch. |
Same problem with Aubess 2 gang Switch (v. 3.4). |
Should be a fairly common config, so implemented as generic. Issue #253
Hmmm, for me the problem is relevant. With Aubess 2 gang Switch and v. 0.20.3.
|
Now it works, thanks a lot! |
- 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
Hi,
Switches with 1 gang are detected as simple switch and work fine.
Switches with 2/3/4 gangs are detected as simple switch as well, and do not work.
Is there an option to add 2/3/4 gang switches support?
Thanks.
The text was updated successfully, but these errors were encountered: