[BUG] TS011F (by _TZ3000_u5u4cakc) can't set power recovery state via power_on_state attribute
See original GitHub issueDescribe the bug There is no way for me to change the default power behaviour, the plug is by default set to power off on restore, meaning that the devices connected to it will not power back on without intervention. This is an issue as I use this plug for my freezer too, meaning that on a few seconds of electricity disruption, my freezer will defrost unless I manually enable the plug again on time.
To Reproduce Steps to reproduce the behavior:
- Unplug plug
- It will not turn on
OR:
- In Clusters select the cluster Tuya ZBOnOffAttributeCluster (0x0006), try to change the power_on_state (0x8002) attribute. Right now this says “PowerOnState.Off”, which means the plug defaults to Off. 0x02 should be “Restore” and 0x01 “On”.
- Submit either 1 or 2 to the cluster attribute, no change can be observed after getting the attribute. The following error is shown in the ZHA log:
[0xB69B:1:0x0006] Failed to convert attribute 0x8002 from PowerOnState.Off (<class 'str'>) to type <enum 'PowerOnState'>: invalid literal for int() with base 10: 'PowerOnState.Off'
[0xB69B:1:0x0006] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=True, direction=<Direction.Server_to_Client: 0>, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True, *is_reply=False), manufacturer=2, tsn=191, command_id=<GeneralCommand.Write_Attributes: 2>, *direction=<Direction.Server_to_Client: 0>, *is_reply=False)
[0xB69B:1:0x0006] Sending request: Write_Attributes(attributes=[])
[0xB69B:1:0x0006] Received ZCL frame: b'\x0c\x02\x00\xbf\x0b\x02\x80'
[0xB69B:1:0x0006] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=True, direction=<Direction.Client_to_Server: 1>, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True, *is_reply=True), manufacturer=2, tsn=191, command_id=11, *direction=<Direction.Client_to_Server: 1>, *is_reply=True)
[0xB69B:1:0x0006] Decoded ZCL frame: TuyaZBOnOffAttributeCluster:Default_Response(command_id=2, status=<Status.MALFORMED_COMMAND: 128>)
[0xB69B](TS011F): set: PowerOnState.Off for attr: 32770 to cluster: 6 for ept: 1 - res: Default_Response(command_id=2, status=<Status.MALFORMED_COMMAND: 128>)
Set attribute for: cluster_id: [6] cluster_type: [in] endpoint_id: [1] attribute: [32770] value: [PowerOnState.Off] manufacturer: [2] response: [Default_Response(command_id=2, status=<Status.MALFORMED_COMMAND: 128>)]
Expected behavior The plug should have a user friendly option in ZHA for this, zigbee2mqtt does have it for this plug. If no user friendly option is available, I should at least be able to configure The power_on_state attribute manually.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
[Device Support Request] TS011F 4 plugs surge protector
I need an ability to change behavior after power outage. ... """Tuya 4 outlet + 2 USB surge protector with restore power state...
Read more >PowerEdge Server : AC Recovery Last Power State Behavior
If the power state is set to last, and a forced shutdown event occurs, the system will power back on if the AC...
Read more >PowerOnState - Tasmota
During any a device restart, the relay power feedback state is scanned according to the setting of SetOption63 . Scanning the relay state...
Read more >ZHA Hue Bulbs restore state on power on - Zigbee
Hello! I'm transitioning my Hue Bulbs to from Hue Bridge to ZHA and I wonder how do I set it to “Recover state...
Read more >Setting the automatic power-on state
From the System Utilities screen, select System Configuration > BIOS/Platform Configuration (RBSU) > Server Availability > Automatic Power-On and press Enter.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Oh oh, I feel a little bit stupid right now. That fixed it. It’s now reporting PowerOnState.LastState
So sorry for wasting everyones time!
Don’t worry. With an UI control it would be more easy, but not implemented yet. There is still a lot to improve, but it is a lot of work and few hands.