Zigbee outlet

Could be possible, if a 'PresenceSensor'' capability is added. The logic could be: if 2 (or 3) consecutive poll commands returned no data from the device, consider it offline, i.e. not present, because most probably the mains power is off (power outage).

I suppose 2-3 minutes maximum delay for reporting a power outage could be OK?

1 Like

wow it works:

  • checkInterval : 720
  • energy : 23.73
  • power : 2
  • switch : on
  • voltage : 234
  • amperage : 0.027

thanks.

edit:
I see multiple amperage values now:

  • checkInterval : 720
  • energy : 23.73
  • power : 2
  • switch : on
  • voltage : 234
  • amperage : 0.027
  • amperage : 0.035
  • amperage : 0.027

is this normal ?

yes; 2-3 minutes delay to report "not present" would be ok.
can you add it in next version :slight_smile:

I am glad it worked for you :slight_smile:

The next step will be to include the driver in Hubitat Package Manager (HPM), so that the driver updates can be applied much more conveniently and quickly.
The reason for the repetitive 'amperage ' values shown on the device page was a bug (a trailing space in the name),

Next in my TODO list is to optimize the polling process. What is important and is most often used in HE automation rules/apps is the power value, which must be updated quickly enough. The voltage is (or at least should be :slight_smile: ) relatively constant. The amperage depends on the measured power, so if the power measured doesn't change (or changes less than 5% for example), there is no need to read the amperage and the voltage again... Same for the energy, that has mostly statistical value.

These optimizations are needed because if you have a lot of outlets of this type that need polling, they could impact the Zigbee network performance... Polling such devices too often and for too many different parameters should be avoided, when possible.

1 Like

thanks. I am waiting for your update :slight_smile:
Meanwhile, can I use the power value to detect changes ?
You will use this in your final driver , right ?

btw, my outlet reports power 0 and 1 when the coffee machine is turned off.
it reports 1 and 2 when the machine is in standby.
It reports over 200 (up to 1500) when the machine is running.
I want to distinguish when the machine is turned off and on
So, I believe actual power value when off is between 0 and 1 and when in standby it is between 1 and 2

Can you make it display in floating format like 1.3 ?

Yes, the power value reading is the most accurate one to detect changes.

Unfortunately, no. These devices report the power in Watts only, the minimal resolution is 1 W
The official Tuya app also shows the power in 1 Watt resolution.

I have added the driver into Hubitat Package Manager. You can add it going to Install->Search by Keywords, search for "Tuya", the driver name is "Tuya Zigbee Metering Plug".
The "Match Up" function of the HPM should work too.

I get this error on HPM :
`

https://raw.githubusercontent.com/kkossev/Hubitat/main/Drivers/Tuya%20Zigbee%20Metering%20Plug/packageManifest.json does not appear to be a valid Hubitat Package or does not exist.

So, if the min resolution for power is 1W, how can I distinguish between power off and standby of the connected device ?
As I wrote in my previous post , when it is off 0 and 1 is reported , when in standby 1 and 2 is reported.
is there a way to get the average of last 3-4 values maybe ?
`

@kkossev The release notes for that package have embedded quotes that either need to be escaped or removed

1 Like

I found a solution to my problem.
amperage value is a float and it is like 0.011 to 0.023 when off. Goes above 0.029 to 0.035 when in standby and above 4 when running (grinding etc)
so I will use amperage < 0.025 to detect off.

1 Like

Thank you very much for pointing this out! Fixed by replacing the double quotes inside the release notes with single quotes.
...and that will be a reminder for me to always test the updated packages on the other HE hub! :slight_smile:

Its great that this worked for you!
In my test setup I use a dimmable halogen lamp as a load, and the amperage measurement error at a low power level is huge, kind of 500% difference between the reported power(that is nearly correct) and the calculated power (voltage * amperage)! :frowning: Obviously this depends on the type of the load (active/reactive, etc..)

1 Like

thanks for all your effort . It works great !

Please let me know when/if you add presence feature.

'PresenceSensor' capability was added in ver. 1.1.0 available for downloading from HPM right now.

If in 3 consecutive polling intervals nothing was received from the device, the presence state is set to "not present". Any data received later will switch the presence state back to "present".

1 Like

oh sorry. I did not notice it although I have downloaded from HPM.
thanks.

1 Like

Is this something that could be added to the generic zigbee outlet driver, I wonder? That could be very useful.

I don't think this will happen, because of at least two reasons.

Adding 'Presence Sensor' capability to an outlet/plug driver is a kind of a hack/workaround.. My understanding is that this capability was intended to be used initially with Samsung SmartThings Presence Sensors, that are now hard to find. Later it was used for person presence detection using mobile phone geolocation data.

The second problem is that polling a zigbee device to obtain its online/offline status is not the best approach. Too intensive polling of many zigbee devices may result in a network congestion, that must be avoided whenever possible. Unfortunately these cheap ZIgbee outlets do not have the capability to automatically and dynamicall report the measured power based on a change threshold value, so the only choice is to poll the device periodically.

A much better solution for reporting mains power outage would be if there is a device that can be mains (or DC) powered and has a battery backup and can send an event to the Zigbee coordinator when the Power Source changed ( mains->battery and battery->mains). But I don't own such a zigbee or z-wave device.

1 Like

The Ring range extender does exactly this... just haven't wanted to spend the money just for the power status report...

1 Like

Thank you for the info! The Ring Range Extender seems like a good solution, especially if a z-wave repeater (700 series!) is needed for your z-wave network! It costs 29 Euro here.

Another solution for checking the presence of an ethernet mains powered device is this:

It works great with my TP-link TL-SG108E cheap ethernet switch,

EDIT even better solution is Hubitat Ping :

1 Like

I think I might give this a look. Thanks for sharing!

There is a new driver version that is published here : [BETA] Tuya Zigbee Metering Plug

thx.