[RELEASE] Tuya (Lidl Smart Home) with Presence

These work with generic drivers, but because of my reliance on presence detection I've rolled my own versions and they're working well. Available through Hubitat Package Manager, just keyword search for "Tuya".

They're Zigbee 3.0 devices, but the power strip in particular has a couple of firmware bugs which need to be worked around, such as reporting the wrong endpoint for the physical button. They're both fully functional with these drivers.

They are very responsive, repeat fairly well and are very quiet on the mesh. So quiet that I'll be adding proactive presence detection in the future, as when 'dormant' they transmit as little as one message every 10 minutes, so it can be up to 15-20 minutes before they're noticed to be offline.

5 Likes

with logs off on the parent i get this.

Log disabling works fine here. Those blank logs are from the built-in generic switch driver, you'll need to disable logging on those individually.

:thinking: i did on 2 of the 3 and still got the same, maybe they all need to be disabled?

yeah that did it.

That's weird, I'm trying it now and they disable individually just fine here.

I've updated the driver to disable child device logging by default, as the parent deals with that and they don't output anything useful.

1 Like

yeah they disabled correctly it just that if you have one enabled you got 3 events even though only one was enabled. So sounds like your fix above would sort that :+1:

Updated with proactive refreshing so presence reporting is more accurate (and not falsely reporting absent as it does occasionally right now). After you've updated I'm afraid you will need to head to your devices and hit "Configure" to set up the new schedules.

1 Like

ELI5 the presence detection you reference

what's with all the refreshing. The status is instantly updated but it also refreshes it on every change?

That only happens when actuating socket '1' on the power strip, the one closest to the physical on/off button.

As socket 1 and the global on/off both report as endpoint 01 (a firmware bug in my opinion) the platform has no way of knowing whether the message it has received came from a confirmed socket 1 switch or a global on/off, so a check on all sockets' status is the only way to confirm. This only occurs when the command received is 0A, which is the only command that the local button generates in the power cluster. Other actuation reports should come through as command 01, so there the refresh() is unnecessary and not performed.

It tells me whether the device has dropped from the mesh, either through a fault or (more likely) that someone has turned it off using the physical mains switch instead of pushing the button on top of the smart plug. :roll_eyes:

I have presence detection on every device, any change generating a Pushover message to let me know. So I'll get "Lidl Plug is not present on the accessories mesh." if I turn the power off to it. Also really useful for telling me when a device's battery has completely died. Got to squeeze out every last milliamp!

1 Like

Just installed these drivers - awesome work. One bit of feedback, it wasn't initially clear from the list on Hubitat Package Manager (when searching with "tuya") which drivers to use as it didn't mention sockets in the title. Got there in the end by matching your name.

Thanks.

Thanks for the feedback, glad they're working for you!

Yeah, I need to work on my branding - I wasn't too sure how they would show up in HPM when I first added them. Given I do most of my development stuff under 'BirdsLikeWires' I should probably post them here as that too.

I installed these drivers using HPM and then the extension cord was detected very quickly and added correctly.
Did some limited testing and it all seems to be working ok, so thank you very much for the driver

1 Like

Hi, I used the code Tuya TY-HG06338 Smart USB Extension
and got them on my dashboard and can switch them from the devices page. They came up as:
Extension 1
(Tuya TY-HG06338 Smart USB Extension)

[Tuya TY-HG06338 Smart USB Extension Switch 01
(Tuya TY-HG06338 Smart USB Extension Switch 01)

[Tuya TY-HG06338 Smart USB Extension Switch 02
(Tuya TY-HG06338 Smart USB Extension Switch 02)

[Tuya TY-HG06338 Smart USB Extension Switch 03
(Tuya TY-HG06338 Smart USB Extension Switch 03)

Can I get these to work work Alexa? Ideally want to name them like 'Sky Box' etc

Yes you can (based on my experience with Google). I have renamed the switches in the devices section. For Google Assistant to work I had to make sure they were added to the Maker API app. Quick refresh of the Google home app and they were visible and can be controlled by voice.

Just a quick THANKS! Was having grief with the plug showing up as NUE etc, and not keeping status of manual on/off.. It's my first proper couple of days moving from ST, and this just made life easier. Had a google.. Instantly works and refresh of status is instant. Bingo :slight_smile: