Help getting started with a smart plug driver?

So... I've just started with Hubitat and I'm new to home automation. I've got some 'Woolley SA-030' Zigbee smart plugs that don't seem to work with any drivers, a long background in IT and telecoms, a bit of coding experience and time on my hands...

Should I have a go at tweaking an existing smart plug driver, or is that best left to the experts here?

Now obviously I've started looking into this, thinking 'how hard can it be?' - but so far, so bloody impossible. If the advice is to go for it, where do I get the info I need? - indeed, what info do I need?

I've found some generic zigbee primers via google, and they're fine, but don't describe the pairing process messaging in enough detail to debug my issue. There's no hubitat docs on that process I can find either. I've got some aged versions of the ZCL which are also interesting, but current drivers aren't getting as far as working messaging yet.

Am I right to think that 'fingerprints' are possibly key here? - if so is there documentation on that?

@kkossev do you know anything about these devices? Are they rebranded tuya?

@AberangSteve Welcome to Hubitat! Someone will chime in I'm sure. In the mean time try one of the generic drivers if you haven't. Remember after you click save, you MUST click configure so the driver knows how to talk to the device.

Also take a look at this. It may help you as a new user avoid some gotchas.

@AberangSteve Also if generic doesn't work, try Nue Zigbee switch driver. Don't forget after you click save, click configure.

No, these seem to be rebranded eWelink and should be pretty standard.

1 Like

Thanks @rlithgow1 - I'm having fun (for some values of fun) with HE.

So, yep, I'm hitting configure/ initialise for all new drivers.
I'm completely new to home automation/zigbee
To jump in on your query to @kkossev they look likely to be rebranded Sonoffs (see below) . I've tried @kkossev's custom Tuya driver (which I'm using for other plugs and my Frient Meter - Thanks!)

Most drivers appear to be picking up the wrong Zigbee Endpoint for some reason - usually Endpoint 0D. Can't get a fingerprint, but this is the pairing info:

Manufacturer: SONOFF
Endpoint 01 endpointId: 01
Endpoint 01 idAsInt: 1
Endpoint 01 inClusters: 0000,0003,0004,0005,0006,FC57,FCA0
Endpoint 01 initialized: true
Endpoint 01 manufacturer: SONOFF
Endpoint 01 model: Z111PL0H-1JX
Endpoint 01 outClusters: 0019
Endpoint 01 profileId: 0104
Endpoint 01 stage: 4
Endpoint 0D application: unknown
Endpoint 0D endpointId: 0D
Endpoint 0D idAsInt: 13
Endpoint 0D inClusters: 1000
Endpoint 0D initialized: true
Endpoint 0D manufacturer: unknown
Endpoint 0D model: unknown
Endpoint 0D outClusters: 1000
Endpoint 0D profileId: C05E
Endpoint 0D stage: 4
Endpoint F2 application: unknown
Endpoint F2 endpointId: F2
Endpoint F2 idAsInt: 242
Endpoint F2 initialized: true
Endpoint F2 manufacturer: unknown
Endpoint F2 model: unknown
Endpoint F2 outClusters: 0021
Endpoint F2 profileId: A1E0
Endpoint F2 stage: 4
1 Like

I can make it work using the Tuya driver, but there is a generic problem in HE with some zigbee devices, where during the pairing process HE picks up a wrong endpointId. This is something that Hubitat devs should look at.

3 Likes

So what do you mean by "I can make it work using the Tuya driver" @kkossev ? Should I retry your driver do you think?

And, even if it's not immediately relevant, can anyone explain the operation of fingerprints in HE drivers?

Essentially every device model has a "fingerprint". Based on this fingerprint, HE does it's best to pick the right driver during pairing. Given the amount of stuff out there though this isn't always possible and HE can pick the wrong driver or just the DEVICE driver. That's ok though because all you have to do is pick or install the correct driver and click save then configure. A lot of times we will paste the fingerprint for either @mike.maxwell or @bcopeland and they will add the fingerprint to whichever driver.

So fingerprints are just used during pairing, and not when manually selecting a driver? - do they do anything at all then, when manually selecting a driver?

I don't think so. As there really isn't anything to do since you're manually selecting the driver. There are standard clusters that the driver can read to know how to do it's thing but that's about it I believe. (again I'm sure someone will correct me)

1 Like

That's looking quite plausible as, after (once again) re-pairing with various drivers, I can't get anything other than Endpoint 0D.
Manually selecting other drivers doesn't seem to change the endpoint either - is that expected behaviour? I'd look it up in the documentation, but you know...

It would be nice to get one of these on loan su i can track down what's going on here. Almost without exception we should be assigning the first endpoint that the device reports.

4 Likes

@mike.maxwell thank you for looking into this issue. I am going to make a new post later tonight, trying to summarize which problematic Zigbee device I have seen lately, that eventually will need to be sent to you to easier replicate the problem.

@AberangSteve Please copy and paste as text the SONOFF Z111PL0H-1JX 'Data' section

4 Likes

@AberangSteve can you test this experimental driver with the SONOFF problematic smart plug?
This is a temporary patch, where if the device manufacturer is 'SONOFF' or 'unknown', the on/off commands are hardcoded to be sent to the default Zigbee endpointId 01. You will need to click on the "initialize" button first.

Please post your device Data section - does it look like this?


( I expect your endpointId to be 0D instead of F2)

1 Like

Sorry for the slow reply:

Data * endpointId: 0D

  • application: unknown
  • manufacturer: unknown
  • model: unknown

Which is what I'd expect from the pairing data I see for Endpoint 0D I think

Just looking at the new driver now - thanks again!

How do you do such wizardry @kkossev ?!

Your new driver works - on/off operates correctly. Fantastic stuff! - I'll be fascinated to have a look at your driver code later

No change to the (empty) data section and the driver reports that energy/power monitoring is supported (which I don't think is - it doesn't list the Electrical Measurement cluster 0B04) but it's a working plug.

Debug log from an off and on command:
dev:572023-01-06 20:33:00.269traceRound Plug #5 sendZigbeeCommands : [he raw 0x20C2 1 0x0D 0x0B04 {10 00 00 0B 05 05 05 08 05}, delay 200]

dev:572023-01-06 20:33:00.211debugRound Plug #5 polling all 0x0B04 attributes

dev:572023-01-06 20:33:00.209debugRound Plug #5 polling.. refreshAll is false

dev:572023-01-06 20:33:00.206debugRound Plug #5 autoPoll()

dev:572023-01-06 20:32:47.416debugRound Plug #5 pollPower()..

dev:572023-01-06 20:32:41.563debugRound Plug #5 Ignored duplicated switch event for model unknown

dev:572023-01-06 20:32:41.562debugRound Plug #5 Event enter: [name:switch, value:on]

dev:572023-01-06 20:32:41.557debugRound Plug #5 parse: description is catchall: 0104 0006 01 01 0040 00 20C2 00 00 0000 0B 01 0100

dev:572023-01-06 20:32:41.479infoRound Plug #5 Round Plug #5 Round Plug #5 was turned on [digital]

dev:572023-01-06 20:32:41.388debugRound Plug #5 Switch state changed from off to on

dev:572023-01-06 20:32:41.386debugRound Plug #5 Event enter: [name:switch, value:on]

dev:572023-01-06 20:32:41.381debugRound Plug #5 parse: description is read attr - raw: 20C20100060800001001, dni: 20C2, endpoint: 01, cluster: 0006, size: 08, attrId: 0000, encoding: 10, command: 0A, value: 01

dev:572023-01-06 20:32:41.338traceRound Plug #5 on() sending [he cmd 0x20C2 0x01 0x0006 1 {}, delay 200]

dev:572023-01-06 20:32:41.299warnRound Plug #5 isHEProblematic() : sending off() : [he cmd 0x20C2 0x01 0x0006 1 {}, delay 200]

dev:572023-01-06 20:32:41.297debugRound Plug #5 Switching Round Plug #5 On

dev:572023-01-06 20:32:38.760debugRound Plug #5 Ignored duplicated switch event for model unknown

dev:572023-01-06 20:32:38.758debugRound Plug #5 Event enter: [name:switch, value:off]

dev:572023-01-06 20:32:38.752debugRound Plug #5 parse: description is catchall: 0104 0006 01 01 0040 00 20C2 00 00 0000 0B 01 0000

dev:572023-01-06 20:32:38.678infoRound Plug #5 Round Plug #5 Round Plug #5 was turned off [digital]

dev:572023-01-06 20:32:38.597debugRound Plug #5 Switch state changed from on to off

dev:572023-01-06 20:32:38.596debugRound Plug #5 Event enter: [name:switch, value:off]

dev:572023-01-06 20:32:38.589debugRound Plug #5 parse: description is read attr - raw: 20C20100060800001000, dni: 20C2, endpoint: 01, cluster: 0006, size: 08, attrId: 0000, encoding: 10, command: 0A, value: 00

dev:572023-01-06 20:32:38.526traceRound Plug #5 off() sending [he cmd 0x20C2 0x01 0x0006 0 {}, delay 200]

dev:572023-01-06 20:32:38.470warnRound Plug #5 isHEProblematic() : sending off() : [he cmd 0x20C2 0x01 0x0006 0 {}, delay 200]

dev:572023-01-06 20:32:38.464debugRound Plug #5 Switching Round Plug #5 Off

1 Like

I've got spares of these plugs, Mike - I ordered 4 of these a back in October, but they didn't arrive on time so I re-ordered some others. They then turned up about 2 weeks ago, so I've got 2 or 3 of these without a use right now. Don' know what UK-US postage would be though, and you'd need an adapter of course.

Here's the Amazon UK link:
https://www.amazon.co.uk/dp/B0B9NF7D22?psc=1&ref=ppx_yo2ov_dt_b_product_details

Apparently, the SA-030 (UK socket, which I have) is functionally identical to SA-028 (Type B socket) and SA-029 (Type F socket)

1 Like

I am glad this worked for you as a temporary solution... As noted before, this is just an experiment/ workaround, as the Tuya Metering Plug driver is not well suited to support non-power/energy reporting models.

You can try the option Energy Reporting - Disabled :
image

I had an idea to add a mode
"FIXED":"Enabled (Energy is calculated from the fixed Power consumption multiplied by the time)"
but it is currently commented out in the code, I don't know if/when will have the time to finish it.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.