-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[TS011F_2_gang_power] unable to turn on or off sockets remotely #23402
Comments
Same problem, it added correctly out of box. |
That would mean that it has nothing to do with my pairing it and performing the OTA update prior to it being supported. |
I presume there's a slight difference between model, our model is the universal plug type. |
Hoping someone has an idea about errors relating to |
I have the same issue. It seems that it is due to the payload for device is changed.
it use state_left and state_right. I am trying to study how to add the coverter "state_left" and "state_left" or remap the "state_l1" to "state_left" and "state_right". |
I have followed the issue #22981 to create the external converters I have added the following code in configuration.yaml in zigbee2mqtt
Here is the file content of TS011F.js
The external converter is loaded But I still can't control it. May I know if any incorrect in my external converter file? |
With reference to the file src/devices/tuya.ts (line 3169 - 3180)
It seems that the endpointName defined l1 and l2. However, the device is only left and right for the endpointName. In issue#22981, the endpointName is also left and right. Can we change it to left and right? |
I have used mosquitto_pub command, it can change the power socket on/off Client null received PUBLISH (d0, q0, r0, m0, 'zigbee2mqtt/Socket', ... (148 bytes)) but the problem is that both left and right will be changed too. At this moment, I created MQTT switch to remote control both sockets. |
Sorry, finally found time to do a bit of troubleshooting.
I tried creating the same converter file as @beginner2047 did above with the exception of the name of the model and named it Then I saw something about const {} = require('zigbee-herdsman-converters/lib/modernExtend');
// Add the lines below
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const ota = require('zigbee-herdsman-converters/lib/ota');
const utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const e = exposes.presets;
const ea = exposes.access;
const {deviceEndpoints, identify, onOff, electricityMeter} = require('zigbee-herdsman-converters/lib/modernExtend');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const definition = {
// Since a lot of Tuya devices use the same modelID, but use different datapoints
// it's necessary to provide a fingerprint instead of a zigbeeModel
fingerprint: [
{
// The model ID from: Device with modelID 'TS0601' is not supported
// You may need to add \u0000 at the end of the name in some cases
modelID: 'TS011F_2_gang_power',
// The manufacturer name from: Device with modelID 'TS0601' is not supported.
manufacturerName: '_TZ3000_bep7ccew',
},
],
model: 'TS011F_2_gang_power', // Update this with the real model of the device (written on the device itself or product page)
vendor: 'Tuya', // Update this with the real vendor of the device (written on the device itself or product page)
description: '2 Gang Socket with power monitoring and USB', // Description of the device, copy from vendor site.
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
configure: tuya.configureMagicPacket,
extend: [deviceEndpoints({"endpoints":{"left":1,"right":2}}), onOff({"powerOnBehavior":false,"endpointNames":["left","right"]}), identify(), electricityMeter()],
meta: {multiEndpointSkip: ['current', 'voltage', 'power', 'energy']},
};
module.exports = definition; However, I still get very similar logs to before I modified the codes. I don't know where to go from here. root@zigbee2mqtt:/opt/zigbee2mqtt/data# cat log/2024-11-27.12-59-25/log.log | grep -i converter | grep -i ts011f
[2024-11-27 12:59:25] info: z2m: Loaded external converter 'TS011F_2_gang_power.js'
[2024-11-27 13:00:17] debug: z2m: No converter available for 'TS011F_2_gang_power' with cluster '57344' and type 'raw' and data '{"data":[8,113,10,1,208,72,2,0,6],"type":"Buffer"}'
[2024-11-27 13:00:17] debug: z2m: No converter available for 'TS011F_2_gang_power' with cluster '57344' and type 'raw' and data '{"data":[8,113,10,1,208,72,2,0,6],"type":"Buffer"}'
[2024-11-27 13:00:17] debug: z2m: No converter available for 'TS011F_2_gang_power' with cluster '57344' and type 'raw' and data '{"data":[8,113,10,1,208,72,2,0,6],"type":"Buffer"}'
[2024-11-27 13:00:17] debug: z2m: No converter available for 'TS011F_2_gang_power' with cluster '57344' and type 'raw' and data '{"data":[8,113,10,1,208,72,2,0,6],"type":"Buffer"}'
[2024-11-27 13:00:17] debug: z2m: No converter available for 'TS011F_2_gang_power' with cluster '57344' and type 'raw' and data '{"data":[8,113,10,1,208,72,2,0,6],"type":"Buffer"}'
[2024-11-27 13:00:18] debug: z2m: No converter available for 'TS011F_2_gang_power' with cluster '57344' and type 'raw' and data '{"data":[8,114,10,2,208,72,2,0,10],"type":"Buffer"}'
[2024-11-27 13:00:18] debug: z2m: No converter available for 'TS011F_2_gang_power' with cluster 'manuSpecificTuya_3' and type 'attributeReport' and data '{"53248":0,"53249":0,"53250":2619665,"53251":123,"53252":11944,"53253":1374,"powerOnBehavior":2,"switchType":0}'
[2024-11-27 13:00:18] debug: z2m: No converter available for 'TS011F_2_gang_power' with cluster 'manuSpecificTuya_3' and type 'attributeReport' and data '{"powerOnBehavior":2}' |
I can also confirm that I have the same issue as @beginner2047 with the mosquitto_pub command. |
@beginner2047 was right. I manually changed the endpointNames to "left" and "right" from "l1" and "l2" respectively in the /opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/devices/tuya.js file in my Z2M container. {
fingerprint: tuya.fingerprint('TS011F', ['_TZ3000_bep7ccew']),
model: 'TS011F_2_gang_power',
vendor: 'Tuya',
description: '2 gang socket with power monitoring and USB',
extend: [
(0, modernExtend_1.deviceEndpoints)({ endpoints: { left: 1, right: 2 }, multiEndpointSkip: ['current', 'voltage', 'power', 'energy'] }),
(0, modernExtend_1.onOff)({ powerOnBehavior: false, endpointNames: ['left', 'right'] }),
(0, modernExtend_1.identify)(),
(0, modernExtend_1.electricityMeter)(),
],
}, The states now correctly show OFF/ON toggles in the Z2M frontend and will trigger the sockets. However, when I turn either one of them on/off, both will be triggered simultaneously. |
I had the same problem. In home assistant, I fixed mine using the terminal this way: get into the container containing zigbee2mqtt
Edit the expanded javascript file
Under fingerprint: tuya.fingerprint('TS011F', ['_TZ3000_bep7ccew']), I changed this line:
to:
exit the container
restart the docker container
The on off can now be controlled. @Koenkk it seems like this commit is the cause of the problem: I don't know if there are other devices with the name 'l1' and 'l2' endpoints, but mine definitely used 'left' and 'right':
|
Fixed the issue, thanks! Changes will be available in the dev branch in a few hours from now. Note that the dev branch currently contains breaking changes, see #24198 |
@sleepypig2003 after the fix, are you able to control the switches individually? In my case, every time I turn one on or off, the other one will follow. |
Yes and no. I was able to individually control left and right for the socket I am testing nearest my zigbee coordinator. On the swtich where it works, turning the switch on/off would send only one log message in the z2m logs:
But, I have several other sockets installed on the wall further from the coordinator, so I'm guessing these go through a router, and those seem to always turn on and off together like you said. When I turn on one switch through the exposed z2m device menu, I get three log messages at once one after the other. Here's an example when I pressed the left "on" in Z2M: the first few logs seem like the correct state, but the last one shows both turned on.
Update: When pressing the buttons on the physical socket itself, it always generates one on and off message (so the message from the device works. But when pressing the on/off using the Zigbee2MQTT device "expose" menu to the device, the duplicate messages starts to appear. I tried using the throttle and debounce options, but the second message would always appear after the debounce/throttle timeout regardless. |
@hanifsuandy pushed a fix to allow separate control, let me know if it works, after updating you need to re-configure the device via the frontend (yellow refresh button) Changes will be available in the dev branch in a few hours from now. Note that the dev branch currently contains breaking changes, see #24198 |
Thanks @Koenkk! I can control the sockets separately now. However, I have another issue. I have 3 of these devices and only 1 of them has an Energy reading while the other 2 have |
Thank you for your help. May I know how to apply the new fix? I have clicked the yellow button (reconfigure) and click "OK" for the confirmation prompt (Are you sure?). But there is no change and only have the following error
|
To apply the changes temporarily I used the same steps as I did above, but edit it so that these two lines are changed. Change these lines in the running tuya.js:
Restart the container as above, then click reconfigure on the device with the yellow button. Note: editing this in the running container does not survive a reboot, you'd have to edit the docker image for that. If the container is restarted with a different ID, then you have to re-edit the changes in the running container. Until the changes makes it into stable production, I probably need to configure [an external definition] ( https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html#_2-creating-the-external-definition ) I tried this on mine and it works. It looks like mine also doesn't get the energy meter readings and give this error on trying to configure it:
So I also removed the electricityMeter(), line as above and the error message above disappears. Unsure if I should also remove "multiEndpointSkip: ['current', 'voltage', 'power', 'energy']})" as well. But overall, now my devices are usable. Thanks Koenkk! |
Thanks @sleepypig2003 and @Koenkk I have updated the tuya.js on HAOS (i.e. /var/lib/docker) directly because I don't want update it again after reboot. I also keep electricityMeter because I would like to keep the 'current', 'voltage', 'power', 'energy'. If removed, it will not show those value although they are total value from left and right. I am not sure if the power monitor can be split into left and right too. |
i have another minor issue after updated. I found that the right will be turn on and left will be turn off after z2m restarted. I don't know how to keep the existing status after power outage? |
What happened?
https://vi.aliexpress.com/item/1005006518819987.html?spm=a2g0o.order_list.order_list_main.27.6b9c1802XQByqA&gatewayAdapt=glo2vnm
I bought a few 2 gang power sockets a while back and had them installed and paired. Initially, they were identified as single gang plugs and I could only remotely turn on and off 1 of the sockets. I found that there was an OTA update so I got them updated, however, the issue remained the same.
Upon further research, it seemed that this device was not yet supported but was in the process of being added. Shortly after (lucky me), it was added so I updated Z2M and the device turned up properly. However, I am not able to turn on or off either sockets remotely and was met with
z2m: No converter available for 'state_l1' ("ON")
error.Has it got to do with me performing OTA update while it was detected as a single gang plug? If so, is it possible to somehow reset the OTA update?
What did you expect to happen?
Expected to be able to turn on and off both sockets remotely.
How to reproduce it (minimal and precise)
Zigbee2MQTT version
1.39.0 commit: 0326926
Adapter firmware version
20230507
Adapter
SLZB-06
Setup
(Proxmox VE)
HAOS VM
Z2M LXC
Mosquitto LXC
Debug log
No response
The text was updated successfully, but these errors were encountered: