[Edge] Matter Playground (ft. Eve Energy)

This custom driver allows playing with Matter features not available in stock drivers. For now, it supports single-outlet smart plugs depending on their Matter compliance, although it best fits the Eve Energy plug including extra useful features.

Added perks

  • Eve Energy specific: Adjust Status LED brightness, from 0% (off) to 100%, and configure the Child Lock that disables the physical button. They are vendor-specific attributes, kudos to slavikus for telling me the magic bytes I had to write since that’s inside knowledge.

  • Power-On state, i.e. behaviour after a power loss, it’s matter StartUpOnOff attribute. Some devices do not support it like Tapo plug. Works correctly in Eve Energy and WiZ plug at least.

  • Visual notifications using the Identify command to make the indicator blink. It’s the Play sound thing (ST has no Identify capability) and the Identify for seconds routine action.

  • Native auto-off using matter OnWithTimedOff command. In one command instructs the device to turn on and turn off after a set time, the cool thing being the timer to turn off runs on the device (not on the hub!) and can be restarted. It also cancels itself if you turn the device off. Use the routine action On with Timed Off minutes and specify the time. Some plugs like Tapo do not support it since it’s an optional feature.

  • Native on/off toggle using matter Toggle command so the action does not depend on SmartThings cached state (yes, I really like stateless automations).

  • Voltage & Current display if it supports matter Voltage and ActiveCurrent attributes. Tested on Eve Energy, other devices might flood the hub with reports (ST doesn’t let drivers configure Matter reporting intervals) or not support those optional attributes.

Requirements:

  • For the Eve Energy, having it updated to 3.5.0 firmware.

  • SmartThings hub with recent firmware since it uses Matter 1.3 for the energy monitoring.

How to use:

  • Install driver from my mocelet-shared channel:
    https://bestow-regional.api.smartthings.com/invite/Kr2zNDg0Wr2A

  • Manually change the driver of the single-outlet plug to use the custom features. You can even change the settings and go back to the stock drivers if you prefer since settings are written in the device itself.

  • Legal stuff: Use it at your own risk, it is provided AS IS, don’t use it when something not working could result in harm, etc. etc.

Tested with:

  • :green_circle: Eve Energy plug: everything works.
  • :yellow_circle: WiZ plug: not Matter 1.3 compliant so no energy monitor yet.
  • :red_circle: Tapo P110M: not Matter 1.3 compliant and they don’t support Matter power-on state or On with Timed Off (they have similar features through their app anyway).

Technical notes:

  • Not based on stock drivers, no polling or hub timers running. Does not support multicomponent or child devices, hence the single-outlet support.

  • The driver is not joinable so it won’t mess with SmartThings stock drivers. New devices are always added first to stock drivers so you can change back and forth at ease.

  • Pro-tip: You can also use this driver to force a reprofile in the stock drivers. Useful if your smart plug got a Matter 1.3 / 1.4 update for energy monitoring and SmartThings stock drivers are not displaying the energy. In that case you have two options: one, reinstalling the device, the other, just switch to this driver and go back to the stock one.

Extra pics

Recent changes:

  • Added “tested” section
  • The auto-off routine action is renamed to On with Timed Off minutes. Originally was Timed On minutes to make it shorter and emphasize that the On state was timed, but since “timed on” could also mean a delayed On it’s going to be more clear to just use the Matter name of the command.
3 Likes

I can finally rip off the gaffer tape from my Eve Energy plugs in my bedroom.

Can you put it on GitHub?

1 Like

Not at the moment, it’s actually a debloated version of the driver I use to play with lights transitions and other stuff. But this is the interesting code if you want to add it to the stock driver:

local EVE_PRIVATE_CLUSTER = 0x130AFC01
local EVE_SET_CONFIG_ATTR = 0x130A0001
local EVE_CHILD_LOCK_ATTR = 0x130A0011

...

eve_handlers.write_led_brightness = function(device, percent)
  -- Thanks u/slavikus for the magic bytes! https://www.reddit.com/r/EveHome/comments/1lk4ue7/comment/mzxw7rc/
  local payload = data_types.validate_or_build_type(string.char(0x20, 0x01, percent), data_types.OctetString1)
  device:send(cluster_base.write(device, 0x01, EVE_PRIVATE_CLUSTER, EVE_SET_CONFIG_ATTR, nil, payload))
end

eve_handlers.write_child_lock = function(device, enabled)
  local payload = data_types.validate_or_build_type(enabled, data_types.Boolean)
  device:send(cluster_base.write(device, 0x01, EVE_PRIVATE_CLUSTER, EVE_CHILD_LOCK_ATTR, nil, payload))
end
1 Like

Thanks! Awesome work, as always!

Undocumented clusters/attributes shouldn’t be allowed by the CSA.

1 Like

I tried your new driver on a Tapo Matter over WiFi mimi smart plug. It doesn’t have power or energy reporting.

It added 2 things to the details page:

  1. Play sound. I couldn’t test since I am not at that location.
  2. Power On state. I can NOT change it, it is stuck on Unknown. I get a network error. I tried with AWA and it says it changed it but it didn’t.

1 Like

Thanks, that’s the expected outcome with Tapo (tried with my P110M too), they don’t currently support changing the power-on state via Matter (StartUpOnOff attribute). In fact that’s why I added the Unknown state and there’s an error when trying to change it.

The play sound just blinks the indicator for 5 seconds. There are routine actions too to specify the time.

Since the Tapo app has both the power-on state option and auto-off settings, it’s not really worth it to use the driver with their plugs, at least until they update to Matter 1.3 (and then I believe they don’t support Voltage and SmartThings will say not all capabilities have been updated)

The Eve Energy is a pure Matter device so all the control is through Matter and they nailed it.

Edit: I’ve removed the part of WiZ ignoring the power-on state since I tested again and it works! Must be a fix in a recent firmware version.

2 Likes

If the voltage drops below 200 V for one minute, send notification “Another power outage imminent!”

This graph is going to be useful:

1 Like

I already had the “on” state set in the Tapo, so you are right it doesn’t matter.

1 Like

Maybe A instead of mA?

Just thinking out loud…

And “reset energy meter” instead of “energy meter”.

The driver provides the current in A to the capability. Since it’s a standard capability, SmartThings decides how to display it.

Same goes for the energy actions, the presentation is on them. The reset action is not implemented by the way, just like it’s not implemented on stock drivers for Matter 1.3 plugs.