-
Notifications
You must be signed in to change notification settings - Fork 413
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
New Device Request: Avatto Curtain switch #292
Comments
These additional data:
|
Hi @make-all, The opening and closing buttons do not control the wall switch. Only the STOP button works properly. |
This device doesn't seem to report enough info to reliably track its state. I see from the screenshot that the open button is disabled. But if the curtain is not fully open, then that is incorrect. Also, the info on the Tuya portal may not be correct - if you can capture the device diagnostics while the curtain is in different states, it might help figure out how exactly it is behaving and what it expects I'm not sure about the meaning of your statement about the backlight. Do you mean the backlight is now working, while it didn't previously? |
How to capture the device diagnostic? Normal operation: if I turn off the backlight, only the LEDs turn off. Nothing else happens. |
The stop button flashing is probably indicating an error, or a sign that the device is crashing due to its poor error handling. Device diagnostics are available under Settings / Devices and Services / Tuya local - your device / 1 device / inside the Device Info panel. |
It's here too!
|
The same as previous commit for is_closed - as these three are used in combination to determine whether the state is open, we should only return any of them when the state can be determined. Issue #292
I think I understand what is going on. The HA cover API includes is_closed, is_opening and is_closing. If all three of these return False, then it assumes it is open. But in case of this device, the state cannot be determined, so we need to return None instead of False from these three functions to let Home Assistant know that it can't use that process of elimination to work out the state. |
The switch doesn't know what position the shutter is in or what the last action was. The up and down button is active for 30-45 seconds from the moment you press it. The shutter motor knows the end positions, so it can't overrun. |
I made some changes to the cover implementation so that Home Assistant should not disable the open button now. It is not in the release, but you can try it out by using "Redownload" in HACS and selecting "main" as the version to install. |
I downloaded it again, added the switch again, but it still doesn't work. How else can I help? |
Reviewing the comments in devices/README.md about cover devices, I think it is not possible to support a curtain switch without any feedback as a cover device in Home Assistant. Instead, I think it will need to be changed to a select entity with the three command values. That is probably not the best representation in the UI though, so I suggest putting buttons with an action to call the select.select_option service with appropriate parameters. |
cover entity requires some feedback about curtain position. Without it, Home Assistant considers the whole entity to be unavailable. Instead, implement as a select entity. Issue #292
Another Local Tuya app managed this device properly. Its type was a shutter instead of a curtain. |
Hi @make-all, It doesn't work with the new method. After a few tries, the switch became inaccessible. (The backlight switch doesn't work either.) How can I help your work? |
I see from the log messages that you are bombarding the device with commands every 3 seconds. Tuya devices are very low powered and cannot handle much network load at all. It looks like the device is getting overloaded and shutting down the network for a while (either deliberately to cope or some internal crash/watchdog). |
Closing, as the device appears to be working as well as Tuya devices ever do. |
Reopening as I think this device may be a good test candidate for the button entity type requested in #244. This would provide a better UI than the current select entity. |
OK thank you. I didn't describe the error exactly in the previous post. The shutter movement did not work, no matter how many times I clicked the buttons. Then they became unavailable. |
I suspect there may be an issue with using select in that it will not send any command if you select the same option as previously selected, maybe even if done through a service call rather than the UI. I'm also not sure whether it reads the current option from the device, or maybe it is intended as a purely write only UI control. Using separate button entities for each command should avoid this, as the buttons are stateless, so should send the corresponding command each time they are pressed. Beware though that Tuya devices are low powered and easily overrun if you send multiple commands in quick succession. I am not sure that the protections against this will work across multiple entities, but they are anyway not 100% effective, as there is a trade-off between protecting against the worst case and having a reasonably responsive average case. |
Hi,
The integration didn't recognize the device, the log shows:
Device matches None with quality of 0%. DPS: {'1': 'stop', '101': True, 'updated_at': 1669631896.6501718}
Link: https://www.aliexpress.com/item/4000206502719.html
Response
Thanks,
The text was updated successfully, but these errors were encountered: