Edge Driver or Device Handeler for a TUYA (Zemismart) Zigbee plug with energy mesurment capabilities

I tested here again. With only one condition. Nothing happened until I “refreshed” the device on the Smartthings app. I entered on history of the trigger device, scrolled up maximum and only the it triggered the routine. Without refreshing nothing happened during 5 minutes. And i didn’t want to wait more.

I don’t quite understand what’s happening to you.

If the routine is activated, it is because the driver has enitted the power event.
In the history of the device it may take the event to appear from instantaneous to hours, depending of the delay of the history server.

When it appears, it will have the event in the history with the original broadcast time and you will be able to see how long it took for the event to be broadcast from the previous value.

1 Like

Still, the 1w or higher and 1w or lower are not happening instantaneously at all. Do you have one of these devices?

Hi @Noe_Bailly

I don’t have any of those devices, But there are multiple users with those devices and I am not aware of any delays in power and energy reporting.

I know there were problems with the update of the android app to show the power information, but they have already solved it.

If you have the CLI installed, you can see exactly the time since you send the On command and how long it takes for the device to respond and for the On status and the power and energy event to be emitted.

You can also see the time since the device connected to the socket begins to consume energy and the response of the socket to the driver.

Without see concrete data I cannot help you diagnose what is happening.

1 Like

I don’t know waht is the CLI to install it. I will research.

Install CLI on your computer:
• You have to download from this link lastet release of the compressed file smartthings-win.zip, if you use windows or the one necessary for your operating system
• In that link you also have installation help, use and all the commands you can use

smartthings-cli/packages/cli at master · SmartThingsCommunity/smartthings-cli - smartthings edge:channels:update [ID]

• Unzip it and move the smartthings.exe file to a folder on your computer from where it will be used. for example to a new folder in documents/CLI
• You have to open the windows powerShell terminal window and you have to go to the directory (folder) where the smarttings.exe file is.
• Use the DOS commands “cd…” to move down directory and “cd directory name” to move to that directory. This is an example of my folder for CLI or VSC folder

• the first time you type a CLI command it will take you to the smartthing page to authorize your account.
• type .\smartthings edge:drivers:logcat
• enter the IP of your HUB, you can see it in IDE
• It will show you the list of drivers installed on your HUB
• type the number corresponding to the driver you want to see
• It will show you the activity of the device connected to that driver

3 Likes

Seems to be pretty scary but I will try to do it on the weekend. Tks for all your support to our comunity!

2 Likes

Hi @Mariano_Colmenarejo

Your edge driver “zigbee-switch-power-v5”…
I am sure that energy measurement works fine (tested in 4 devices).

But, does it provide measurement data for ST/Life’s Energy Smartapp?
I have all my Samsung ACs there, and plugs also were able to send data before edge update.
I’d like only to be sure with you if it is or not working.
Thanks!

Hi @allmac

That app is not available in my region and therefore I don’t know how it works or what devices work.

The driver uses the powerMeter and energyMeter stock capabilities, I don’t know if they don’t work in the app because they are the edge drive type instead of DTH

1 Like

Hi @allmac,

I try to use on mine. Unfortunately doesn’t shows on St Energy Life app.

@Mariano_Colmenarejo here a got the same problem reported by @Noe_Bailly.

Could you help with it?

This is my CLI report:

2022-08-30T13:51:14.295473987+00:00 DEBUG Zigbee Switch Power Mc driver device thread event handled
2022-08-30T13:51:27.614948322+00:00 PRINT Virtual Calendar Mc <<<< sun_rise_Offset: 271 Min
2022-08-30T13:51:27.621610655+00:00 PRINT Virtual Calendar Mc <<<< sun_set_offset: -424 Min
2022-08-30T13:51:27.631123655+00:00 INFO Virtual Calendar Mc <Device: cf2df8dd-6392-431b-abe4-c3748087ec2a (My Calendar)> emitting event: {“attribute_id”:“sunRiseOffset”,“capability_id”:“legendabsolute60149.sunRiseOffset1”,“component_id”:“main”,“state”:{“value”:271},“visibility”:{“displayed”:false}}
2022-08-30T13:51:27.658140655+00:00 INFO Virtual Calendar Mc <Device: cf2df8dd-6392-431b-abe4-c3748087ec2a (My Calendar)> emitting event: {“attribute_id”:“sunSetOffset”,“capability_id”:“legendabsolute60149.sunSetOffset1”,“component_id”:“main”,“state”:{“value”:-424},“visibility”:{“displayed”:false}}
2022-08-30T13:51:27.685918988+00:00 INFO Virtual Calendar Mc <Device: cf2df8dd-6392-431b-abe4-c3748087ec2a (My Calendar)> emitting event: {“attribute_id”:“localDate”,“capability_id”:“legendabsolute60149.localDate”,“component_id”:“main”,“state”:{“value”:“2022/08/30 10:51”},“visibility”:{“displayed”:false}}
2022-08-30T13:51:27.711333655+00:00 INFO Virtual Calendar Mc <Device: cf2df8dd-6392-431b-abe4-c3748087ec2a (My Calendar)> emitting event: {“attribute_id”:“localHour”,“capability_id”:“legendabsolute60149.localHour”,“component_id”:“main”,“state”:{“value”:1051},“visibility”:{“displayed”:false}}
2022-08-30T13:51:27.736654322+00:00 INFO Virtual Calendar Mc <Device: cf2df8dd-6392-431b-abe4-c3748087ec2a (My Calendar)> emitting event: {“attribute_id”:“localHourTwo”,“capability_id”:“legendabsolute60149.localHourTwo”,“component_id”:“main”,“state”:{“value”:1051},“visibility”:{“displayed”:false}}
2022-08-30T13:51:27.759291322+00:00 DEBUG Virtual Calendar Mc My Calendar device thread event handled
2022-08-30T13:51:31.364785322+00:00 ERROR Zigbee Siren Mc driver thread encountered error: [string “st/zigbee/device_management.lua”]:136: attempt to call a nil value (method ‘check_monitored_attributes’)
2022-08-30T13:51:32.983366655+00:00 DEBUG ST Zigbee Button Mc driver device thread event handled
2022-08-30T13:51:35.418465989+00:00 INFO Zigbee Motion Sensor Frient Doing health check read for [17B5]:0500:0002
2022-08-30T13:51:35.494101656+00:00 INFO Zigbee Motion Sensor Frient <ZigbeeDevice: ca74a434-26fc-43d9-b447-2420601e6304 [0x17B5] (Sensor do Lavabo)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x17B5, dest_endpoint: 0x01, profile: 0x0104, cluster: IASZone >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0002 > > >
2022-08-30T13:51:35.606271322+00:00 DEBUG Zigbee Motion Sensor Frient driver device thread event handled
2022-08-30T13:51:37.154975989+00:00 DEBUG Zigbee Contact Mc driver device thread event handled
2022-08-30T13:51:37.627152989+00:00 TRACE Zigbee Switch Power Mc Received event with handler device_lifecycle
2022-08-30T13:51:37.641406323+00:00 INFO Zigbee Switch Power Mc <ZigbeeDevice: 964e335d-646a-4145-9f89-3f20b4992f17 [0x1B1C] (Base de Carregamento)> received lifecycle event: infoChanged
2022-08-30T13:51:37.649194989+00:00 TRACE Zigbee Switch Power Mc Found DeviceLifecycleDispatcher handler in Zigbee_Switch
2022-08-30T13:51:37.654953989+00:00 PRINT Zigbee Switch Power Mc device.preferences[infoChanged]=
2022-08-30T13:51:37.660261989+00:00 PRINT Zigbee Switch Power Mc device.preferences[infoChanged]= 1.0
2022-08-30T13:51:37.665523323+00:00 PRINT Zigbee Switch Power Mc device.preferences[infoChanged]= 10
2022-08-30T13:51:37.671678323+00:00 PRINT Zigbee Switch Power Mc device.preferences[infoChanged]= 255
2022-08-30T13:51:37.677819323+00:00 PRINT Zigbee Switch Power Mc device.preferences[infoChanged]= 1.0
2022-08-30T13:51:37.683080656+00:00 PRINT Zigbee Switch Power Mc device.preferences[infoChanged]= Yes
2022-08-30T13:51:37.688754989+00:00 PRINT Zigbee Switch Power Mc device.preferences[infoChanged]= 10
2022-08-30T13:51:37.694005989+00:00 PRINT Zigbee Switch Power Mc device.preferences[infoChanged]= 0.0
2022-08-30T13:51:37.699224323+00:00 PRINT Zigbee Switch Power Mc device.preferences[infoChanged]= -3
2022-08-30T13:51:37.704845989+00:00 PRINT Zigbee Switch Power Mc device.preferences[infoChanged]= Plug
2022-08-30T13:51:37.710496323+00:00 PRINT Zigbee Switch Power Mc device.preferences[infoChanged]= 10.0
2022-08-30T13:51:37.716129989+00:00 PRINT Zigbee Switch Power Mc Device ID <ZigbeeDevice: 964e335d-646a-4145-9f89-3f20b4992f17 [0x1B1C] (Base de Carregamento)>
2022-08-30T13:51:37.721271989+00:00 PRINT Zigbee Switch Power Mc Manufacturer >>> _TZ3000_9vo5icau Manufacturer_Len >>> 16
2022-08-30T13:51:37.726434323+00:00 PRINT Zigbee Switch Power Mc Model >>> TS011F Model_len >>> 6
2022-08-30T13:51:37.731580989+00:00 PRINT Zigbee Switch Power Mc Memory >>>>>>> 967.400390625 Kbytes
2022-08-30T13:51:37.737206989+00:00 DEBUG Zigbee Switch Power Mc TS011F Plug device thread event handled
2022-08-30T13:51:44.303935990+00:00 DEBUG Zigbee Switch Power Mc driver device thread event handled

1 Like

Hi @Dienzora

What a problem?
could you be more specific? Thank you

1 Like

@Mariano_Colmenarejo many users are reporting that when they switched from DTH to Edge Drivers, they loose power repororting in Energy Life app.
With DTH energy was reported to Energy Life app, and with driver is not.
This is what we (you and @TAustin) tried to add to virtual meter, and ran into problem of not reporting.
Now this is affecting physical metering devices, such as plugs.
Maybe @nayelyz needs to report this to her team or provide what needs to be added to drivers to add this function back.

2 Likes

Hi Mariano, trigger is delayed and didn’t run automation.

1 Like

@jody.albritton
Also, it is ridiculous that region restrictions are applied to developers too. How can developers create successful driver or app, if they have thise restrictions. Devs from restricted areas are trying to develop drivers and apps for all regions. This should be changed.

2 Likes

Hi @Dienzora

Sorry, in that log I can’t see anything because there are events and messages from several devices and I don’t know which one is affected and I don’t know how the automation is done to know what I have to look for

1 Like

Edge drivers are not supported yet in the SmartThings Energy app, them being supported is on the roadmap, but there’s no ETA yet.

What do you mean by this? Which drivers don’t work in certain regions?
About “apps” are you referring to ST Energy? The statement above would explain the behavior of devices not appearing there.

1 Like

The automation is => 1 watt then turn on a light (I created just for testing) so until I refresh, it doesn’t trigger the automation.

In the device detail view power meter you can see the real power without refresh?

@nayelyz

I understand now that edge drivers are not supported yet in the energy Life app.
I don’t understand why devs have any regional restrictions. How can they create driver or app if they can’t see final results, when features are not available in their region. SmartLightning is another example
Devs can’t see if driver capabilities are showing in SmartLightning if they don’t have it

1 Like

Did do nothing, but this is the log:

2022-08-30T15:30:15.930635691+00:00 DEBUG Zigbee Switch Power Mc driver device thread event handled
2022-08-30T15:30:24.284866359+00:00 TRACE Zigbee Switch Power Mc Received event with handler capability
2022-08-30T15:30:24.293982359+00:00 INFO Zigbee Switch Power Mc <ZigbeeDevice: 964e335d-646a-4145-9f89-3f20b4992f17 [0x1B1C] (Base de Carregamento)> received command: {“args”:{},“capability”:“refresh”,“command”:“refresh”,“component”:“main”,“positional_args”:{}}
2022-08-30T15:30:24.300250359+00:00 TRACE Zigbee Switch Power Mc Found CapabilityCommandDispatcher handler in Zigbee_Switch
2022-08-30T15:30:24.307374025+00:00 INFO Zigbee Switch Power Mc <ZigbeeDevice: 964e335d-646a-4145-9f89-3f20b4992f17 [0x1B1C] (Base de Carregamento)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x1B1C, dest_endpoint: 0x01, profile: 0x0104, cluster: ElectricalMeasurement >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x050B > > >
2022-08-30T15:30:24.330315025+00:00 INFO Zigbee Switch Power Mc <ZigbeeDevice: 964e335d-646a-4145-9f89-3f20b4992f17 [0x1B1C] (Base de Carregamento)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x1B1C, dest_endpoint: 0x01, profile: 0x0104, cluster: SimpleMetering >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0000 > > >
2022-08-30T15:30:24.357455692+00:00 INFO Zigbee Switch Power Mc <ZigbeeDevice: 964e335d-646a-4145-9f89-3f20b4992f17 [0x1B1C] (Base de Carregamento)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x1B1C, dest_endpoint: 0x01, profile: 0x0104, cluster: SimpleMetering >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0400 > > >
2022-08-30T15:30:24.383543359+00:00 INFO Zigbee Switch Power Mc <ZigbeeDevice: 964e335d-646a-4145-9f89-3f20b4992f17 [0x1B1C] (Base de Carregamento)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x1B1C, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0000 > > >
2022-08-30T15:30:24.405334359+00:00 DEBUG Zigbee Switch Power Mc TS011F Plug device thread event handled
2022-08-30T15:30:24.482427025+00:00 TRACE Zigbee Switch Power Mc Received event with handler zigbee
2022-08-30T15:30:24.504540025+00:00 INFO Zigbee Switch Power Mc <ZigbeeDevice: 964e335d-646a-4145-9f89-3f20b4992f17 [0x1B1C] (Base de Carregamento)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x1B1C, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: ElectricalMeasurement >, lqi: 0x70, rssi: -72, body_length: 0x0009, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x70, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x050B, ZclStatus: SUCCESS, DataType: Int16, ActivePower: 7 > > > >
2022-08-30T15:30:24.521477359+00:00 TRACE Zigbee Switch Power Mc Found ZigbeeMessageDispatcher handler in Zigbee_Switch
2022-08-30T15:30:24.527577025+00:00 INFO Zigbee Switch Power Mc Executing ZclClusterAttributeValueHandler: cluster: ElectricalMeasurement, attribute: ActivePower
2022-08-30T15:30:24.540193025+00:00 INFO Zigbee Switch Power Mc <ZigbeeDevice: 964e335d-646a-4145-9f89-3f20b4992f17 [0x1B1C] (Base de Carregamento)> emitting event: {“attribute_id”:“power”,“capability_id”:“powerMeter”,“component_id”:“main”,“state”:{“unit”:“W”,“value”:7.0}}
2022-08-30T15:30:24.583053025+00:00 DEBUG Zigbee Switch Power Mc TS011F Plug device thread event handled
2022-08-30T15:30:24.593049025+00:00 TRACE Zigbee Switch Power Mc Received event with handler zigbee
2022-08-30T15:30:24.607039359+00:00 INFO Zigbee Switch Power Mc <ZigbeeDevice: 964e335d-646a-4145-9f89-3f20b4992f17 [0x1B1C] (Base de Carregamento)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x1B1C, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: SimpleMetering >, lqi: 0x70, rssi: -72, body_length: 0x000D, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x71, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x0000, ZclStatus: SUCCESS, DataType: Uint48, CurrentSummationDelivered: 0x000000000219 > > > >
2022-08-30T15:30:24.627962359+00:00 TRACE Zigbee Switch Power Mc Found ZigbeeMessageDispatcher handler in Zigbee_Switch
2022-08-30T15:30:24.916866692+00:00 INFO Zigbee Switch Power Mc Executing ZclClusterAttributeValueHandler: cluster: SimpleMetering, attribute: CurrentSummationDelivered
2022-08-30T15:30:24.924501692+00:00 INFO Zigbee Switch Power Mc <ZigbeeDevice: 964e335d-646a-4145-9f89-3f20b4992f17 [0x1B1C] (Base de Carregamento)> emitting event: {“attribute_id”:“energy”,“capability_id”:“energyMeter”,“component_id”:“main”,“state”:{“unit”:“kWh”,“value”:537.0}}
2022-08-30T15:30:24.946981359+00:00 DEBUG Zigbee Switch Power Mc TS011F Plug device thread event handled
2022-08-30T15:30:24.955730692+00:00 TRACE Zigbee Switch Power Mc Received event with handler zigbee
2022-08-30T15:30:24.964746359+00:00 INFO Zigbee Switch Power Mc <ZigbeeDevice: 964e335d-646a-4145-9f89-3f20b4992f17 [0x1B1C] (Base de Carregamento)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x1B1C, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: SimpleMetering >, lqi: 0x70, rssi: -72, body_length: 0x0006, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x72, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x0400, ZclStatus: UNSUPPORTED_ATTRIBUTE > > > >
2022-08-30T15:30:24.984468692+00:00 DEBUG Zigbee Switch Power Mc TS011F Plug device thread event handled
2022-08-30T15:30:24.990691359+00:00 TRACE Zigbee Switch Power Mc Received event with handler zigbee
2022-08-30T15:30:25.001556359+00:00 INFO Zigbee Switch Power Mc <ZigbeeDevice: 964e335d-646a-4145-9f89-3f20b4992f17 [0x1B1C] (Base de Carregamento)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x1B1C, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0x6C, rssi: -73, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x73, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x0000, ZclStatus: SUCCESS, DataType: Boolean, OnOff: true > > > >
2022-08-30T15:30:25.017101025+00:00 TRACE Zigbee Switch Power Mc Found ZigbeeMessageDispatcher handler in Zigbee_Switch
2022-08-30T15:30:25.022839692+00:00 INFO Zigbee Switch Power Mc Executing ZclClusterAttributeValueHandler: cluster: OnOff, attribute: OnOff
2022-08-30T15:30:25.031212692+00:00 INFO Zigbee Switch Power Mc <ZigbeeDevice: 964e335d-646a-4145-9f89-3f20b4992f17 [0x1B1C] (Base de Carregamento)> emitting event: {“attribute_id”:“signalMetrics”,“capability_id”:“legendabsolute60149.signalMetrics”,“component_id”:“main”,“state”:{“value”:“LQI: 108 … RSSI: -73 dBm”},“visibility”:{“displayed”:true}}
2022-08-30T15:30:25.068665025+00:00 INFO Zigbee Switch Power Mc <ZigbeeDevice: 964e335d-646a-4145-9f89-3f20b4992f17 [0x1B1C] (Base de Carregamento)> emitting event: {“attribute_id”:“switch”,“capability_id”:“switch”,“component_id”:“main”,“state”:{“value”:“on”}}
2022-08-30T15:30:25.090657359+00:00 DEBUG Zigbee Switch Power Mc TS011F Plug device thread event handled