Shelly Device Handlers for Hubitat

Well folks this is it... my last driver for Shelly devices. This is for the Shelly smoke and requires a MQTT broker to function. If you don't want to go that route then you will need to use Maker API to get the status.

Screenshot

https://github.com/ShellyUSA/Hubitat-Drivers/blob/master/PLUS/Shelly-Smoke.groovy

3 Likes

Yep, BrunoVoeten nailed it perfectly here. The whole point of my question on github and here is why isn't Allterco Robotics (The parent company for Shelly) working directly with Hubitat to produce officially supported drivers.

If they are going to put the badge on their website: That implies "official" support. Not support via the goodwill of community members like Scott.

No-one is here is blaming you Scott or trying to put this on you. My posts here and on Hithub to put pressure on Allterco Robotics to properly support the hardware they are selling and making money on, which is why I addressed my comment to Doug and Allterco Robotics and not you.

Well from here on out I no longer code devices drivers for Allterco devices. I think I have done my fair share of the code for the past 3-4 years is enough. If Hubitat and Allterco can't play together with all that I have done so-be-it but its certainly not my fault.. I coded enough for a good head start for collaboration. Something like 10,000 lines of code.....

3 Likes

I have a spare 10K thermistor in my heated floor. I wanted to connect it to Hubitat and monitor the temperature - it is the other end of the room from the thermistor hooked to the thermostat.

I believe I can accomplish this through a Shelly Plus 1 and the Shelly Plus Add-On unit and from reading all of the messages above it looks like the driver has been updated to support this? Just thought I would confirm before ordering. Thanks.

Hi ive been serching for drivers on shelly 3-phase power meter eu version are there any? Seems like a reliable device... lan comunication...

Hello,

Yet another custom Shelly driver.
repo

Written using Pro 2PM. Expected to handle other devices with V2 protocol (with 'cover', 'input' and 'switch' components). Supports bound and unbound inputs.

Uses WebSocket stream. So mechanical button events and state changes should come instantly if link is up (no polling used/required). In case of link failure will try to reconnect back at specified time interval. Link status can be monitored trough attribute.

Authentification was not used during implementation so might not work.

2 Likes

Any info on a Shelly 4pm driver? No code in the file (first post) some alternative?

first gen or 2nd gen ?

If you have Pro 4PM it is expected to work (either using the topic main repo driver or the one I posted). It has 4 'input' components and 4 'switch' componets. Though I have no unit to test on.

The topic main repo driver will need to be installed 4 times (4 instances) setting up each instance to each corresponding channel.

The one I posted will require only a single instance. For Pro 4PM it should spawn 4 'input' child devices and 4 'switch' child devices after setting IP and pressing 'Configure'.

1 Like

Can't seem to find if its v2 or v1.... ok there probably should be V2 in the name so I guess v1 ?


It's Shelly Pro 4 PM.
Shelly Pro 4 PM | Shelly Technical Documentation

It is V2 (gen2) protocol device.

1 Like

This driver https://raw.githubusercontent.com/ShellyUSA/Hubitat-Drivers/master/PLUS/ShellyPlus.groovy

1 Like

The Driver is for Shelly 3EM 3Phase power meter? If so can't seem to get it to work. It connects to the device bot no power metering options.... any ideas?

This driver currently has no Pro 3 EM support.
It you could send me driver logs, I could try to add.

I can try to add using official documentation. Log will help to check events/notifications with real device behavior.

Enable description logging to see extensive device logs. If will start to dump all device responses.

Also, driver should show detected components list in the device data section down below. Would be helpfull to see that list.

P.S.:

To be clear
Shelly 3EM and Shelly Pro 3EM are two different devices of different protocol generations. There is no way to add the first one except writing a completely new driver. While the second one can be added.

Kk I'll set everything up and provide the data

I updated driver with Pro 3 EM code in the repo. But I cannot test it. So I assume by default that there are issues :upside_down_face:

Driver should spawn 4 child devices: Phase A, Phase B, Phase C and Total. For now I did not exposed aparent power and returned energy readings. Also neutral wire current value is not exposed.

To properly spawn child devices:
0. Enable debug logging to see all the request and responses in the device log

  1. Set IP and save settings
  2. Press 'Configure'.

'Configure' clears all previous child devices, polls device for all the componets and their instance counts, spawns child devices according to the fetched info, opens web socket connection and sends status request over it to start getting device notifications.

Ideally there should be no errors :hand_with_index_finger_and_thumb_crossed:
If by chance everything will work as you expect, you may disable debug logging.

1 Like

Ok I removed the device and added it anew. I dont think it connects properly

I get an error importing the driver code

Logs

You picked only a single file. Driver uses libraries and custom generic component devices (due to the lack of needed capabilities in the builtin generic driver set).

You either need to install libraries listed at the driver code top, or simply take the whole bundle (as a single operation). Taking bundle is simpler: go to the bundle tab on the left; there will be import button that will ask you for a ZIP file. ZIP-file contains all the dependencies inside.

Bundle can be downloaded from repo and uploaded. Or it can be uploaded directly from repo URL copying link from

If you want to install driver manually, then you will need 4 child device drivers and 3 library files.

2 Likes

Ok connected to the device,

No child devices present. We have readings. Im still waiting for my solar plant so the sensors aren't attached... but that's no problem I believe... no child devices

2023-04-28 23:13:13.961info(null) Meter generic report: Electric:voltage - 234.2V

dev:322023-04-28 23:13:13.960info(null) Meter generic report: Electric:voltage - 0.1V

dev:322023-04-28 23:13:13.958info(null) Meter generic report: Electric:voltage - 0.1V

dev:322023-04-28 23:13:13.957info(null) Phase C power factor 1.00

dev:322023-04-28 23:13:13.955info(null) Phase B power factor 1.00

dev:322023-04-28 23:13:13.954info(null) Phase A power factor 1.00

dev:322023-04-28 23:13:13.952info(null) Meter generic report: Electric:amperage - 0.082A

dev:322023-04-28 23:13:13.951info(null) Meter generic report: Electric:amperage - 0.027A

dev:322023-04-28 23:13:13.949info(null) Meter generic report: Electric:amperage - 0.027A

dev:322023-04-28 23:13:13.948info(null) Meter generic report: Electric:amperage - 0.028A

dev:322023-04-28 23:13:13.946info(null) Meter generic report: Electric:power - -0.135W

dev:322023-04-28 23:13:13.945info(null) Meter generic report: Electric:power - -0.1W

dev:322023-04-28 23:13:13.943info(null) Meter generic report: Electric:power - 0.0W

dev:322023-04-28 23:13:13.942info(null) Meter generic report: Electric:power - 0.0W

dev:322023-04-28 23:13:13.939info(null) parseShellyEnergyMeterStatus [a_act_power:0.0, b_aprt_power:0.0, b_act_power:0.0, total_current:0.082, n_current:null, total_act_power:-0.135, a_voltage:0.1, c_current:0.027, b_current:0.027, a_current:0.028, b_voltage:0.1, a_aprt_power:0.0, c_voltage:234.2, a_pf:1.00, c_aprt_power:6.2, total_aprt_power:6.241, id:0, c_pf:1.00, b_pf:1.00, c_act_power:-0.1]

dev:322023-04-28 23:13:10.959info(null) Meter generic report: Electric:voltage - 234.2V

dev:322023-04-28 23:13:10.957info(null) Meter generic report: Electric:voltage - 0.1V

dev:322023-04-28 23:13:10.956info(null) Meter generic report: Electric:voltage - 0.1V

dev:322023-04-28 23:13:10.954info(null) Phase C power factor 1.00

dev:322023-04-28 23:13:10.953info(null) Phase B power factor 1.00

dev:322023-04-28 23:13:10.951info(null) Phase A power factor 1.00

dev:322023-04-28 23:13:10.950info(null) Meter generic report: Electric:amperage - 0.083A

dev:322023-04-28 23:13:10.948info(null) Meter generic report: Electric:amperage - 0.028A

dev:322023-04-28 23:13:10.947info(null) Meter generic report: Electric:amperage - 0.027A

dev:322023-04-28 23:13:10.945info(null) Meter generic report: Electric:amperage - 0.028A

dev:322023-04-28 23:13:10.944info(null) Meter generic report: Electric:power - -0.05W

dev:322023-04-28 23:13:10.942info(null) Meter generic report: Electric:power - 0.0W

dev:322023-04-28 23:13:10.941info(null) Meter generic report: Electric:power - 0.0W

dev:322023-04-28 23:13:10.939info(null) Meter generic report: Electric:power - 0.0W

dev:322023-04-28 23:13:10.937info(null) parseShellyEnergyMeterStatus [a_act_power:0.0, b_aprt_power:0.0, b_act_power:0.0, total_current:0.083, n_current:null, total_act_power:-0.050, a_voltage:0.1, c_current:0.028, b_current:0.027, a_current:0.028, b_voltage:0.1, a_aprt_power:0.0, c_voltage:234.2, a_pf:1.00, c_aprt_power:6.5, total_aprt_power:6.477, id:0, c_pf:1.00, b_pf:1.00, c_act_power:0.0]

I will investigate tomorrow.
Good news is that WS stream is live. Device sends reports as expected. Component names turned to be correct. The issue is strictly in missing child devices (to which to put these readings).

Would be helpfull to see log of "Configue" operation (when button is pressed). There could be some usefull error.
And component list from the bottom of the driver (to see how exactly EM and EMData components were detected)

1 Like