[RELEASE] Shelly Energy Meter (SHEM) or (SHE3M) Unofficial Driver for Hubitat

Shelly Energy Meter (SHEM) or (SHE3M) Unofficial Driver for Hubitat (no mqtt requirement)

Here is a unofficial driver for Shelly Energy Meter for the Hubitat. It uses a IP address much like the switching products, no need for mqtt. Install your Energy Meter device on WiFi, upgrade the firmware and set the meter requirements on the Shelly Web GUI.

2 Likes

Updated Driver

Hi, really appreciate your hard work in creating that driver! I'm new to HE, installed it just yesterday, however as I do own a ShellyPro 3EM, do you happen to know if this driver might work here, too? Thanks, Chris

I don't have a 3EM just yet to try the driver on it. I did built it to 3 channels, so if it detects the SH3EM correctly it should collect the data and add it. Select the initialize once you place the IP address in the parameters. It should read the device. Let me know what you see, I can do a screen share to see first hand to help troubleshoot.

Thank you for leaving the credits in the code... first person here that has done that that used my code.

1 Like

Hi,
I am attempting to use your Shelly EM driver but struggling; no doubt because I am a newbie. I have copied the code and created the driver just fine, although on the driver screen there is very little under the 'state variables' and 'Current states'.
I have been trying to put a tile on a dashboard but when I look under attributes there are very few to choose from and certainly none that give me the power reading.
The readme notes state: Install the child device driver name as "Shelly Energy Meter Device". However, I am afraid I have no idea how to do that.
Any help would be greatly appreciated.
Many thanks

2 Likes

Hi @coreyclerico,

I am trying to get a Shelly 3EM to work using your drivers. I created the " Shelly Energy Meter" and the "Shelly Energy Meter Device" drivers in Hubitat. Then I created a virtual device using the "Shelly Energy Meter" driver and added the IP address of the 3EM. Now the build-in switch works (on/off), so that's good!

Now I don't know what to do next to get the "Energy Measuring Clamps" to work. When I click "Initialize" and look at the log it says "channels = 0". I would assume this should be 3, correct?

I also found that in the Shelly's own Web UI all all Actions URLs are empty. Not sure if this should be different.

Any chance you would have a hint were to start?

Simon

Sorry for the delay, yes this is correct. It's not detecting the SHEM-3 as a known entity. Sorry I do not have this device to test with.

Add this to the driver code....

    state.devicetype = obs.device.type
    if (state.devicetype == "SHEM") { state.channels = 2 } 
    else if (state.devicetype == "SH3EM") { state.channels = 3 }
    else if (state.devicetype == "SHEM-3") { state.channels = 3 }  // Add this 
    else { state.channels = 0 }

Updated driver on GitHub

1 Like

Hi @coreyclerico,
thanks for updating the driver! Now the three channels of the SHEM-3 are detected/added and show the "power" output correctly!
But now this leads me to some new questions: energy/voltage/amperage/etc. of the Channels are reported as null in Hubitat. Nonetheless I do see values in the Shelly's own web-app. In the Hubitat logs I see this error when polling:


Any chance you would spot the issue?
Simon

Looks like Shelly is on APIv2 for EM Pro and this driver only deals with APIv1 EM devices. It's a new rewrite and unfortunately I do not have a device to use and test with. Also not much around with 3phase in the US.

APIv1 EM and 3EM
https://shelly-api-docs.shelly.cloud/gen1/#shelly-em

AVIv2 EM Pro

Hi @coreyclerico,

no worries and many thanks for double checking!

Maybe at some point Hubitat will expand their build-in drivers more. I'll patiently wait :wink:

Hi again @coreyclerico,

I was just re-checking the links you shared earlier and I am using the Shelly 3EM (API Reference), not the "Shelly Pro EM".
From what I see in the api docs this is the "gen1", same as the API Reference
Not sure if this would make it easier to figure out why some values are not reporting.

Simon

Hi,

Trying to use with Shelly 3EM.
I get the power reading only from channel 1. The other 2 channel don't get the power reading...
Something I did wrong?

Thanks.

Is this direct on the Shelly device? Or on Hubitat your not seeing the channel 2 data? If your not seeing the data for channel 2 on the Shelly directly then I would verify the wiring and don't electrocute yourself. You can also have a bad coil. Flip them around and see if the problem follows the channels.