Shelly Device Handlers for Hubitat

I use Maker API to do this, I subscribe devices that I'm interested in and it sends a post on each device event to a tiny service that just dumps it into timescale db, then I have grafana dashboards to graph everything.

Hello Dmitry, I have this working well with my Shelly Pro EM3 however I was wondering how often Hubitat samples data from the Shelly with your driver? I have had a few peculiar things happening with my Hub where it needs a reboot to get everything working again and was wondering if the amount of data coming in from Shelly might be the cause? I note under the Child Devices (each Phase) there is a Preference sections with Thresholds for each attrubute, is this the way to reduce the load on the hub?

Hello Roger,

It depends on device. From what I have seen it can be averaged to approximately one reading per 1..3 minutes. Driver is not sampling/polling device. So there is no such thing like polling interval. When websocket connection is established devices send reports them selves. And devices are quite noisy.

Yes. It is made to avoid attribute value changes too often. Depending on your use case you can find your balance between the amount of changes/events and reaction speed.
This way you can set bigger values for heavier loads or highly dynamic loads.

Many thanks for your quick reply Dmitry. I will try tinkering with the preferences as I don’t need to see very small changes and see how it goes.
Cheers
Roger

Good morning, I'm trying to use this driver with a shelly plus 2 PM as a roller, but it doesn't work for me and above all, I need to change the position of the roller to hubitat when it changes position.
greetings

Could you provide some more details on what exactly is not working? Logs would also be helpfull.

Another problem I have is that it does not return the value in which it is positioned to shelly for the panels and rules.

If driver is set/configured it should get position reports from the assigned device. Driver logs in debug mode have detailed traces on all the communication with device. They should provide a hint on what's going on and if something goes wrong.

Thank you very much for your interest, to ensure from the beginning, I have installed this driver and its 4 libraries

https://bitbucket.org/ge4d/hubitat-code/raw/3485d0258249fa3db7a82d22ae959b7b46ac7868/Drivers/Shelly/drozovyk.ShellyPlusProxPM.groovy

Once installed and connected, it does not report the value at which the roller is.

neither if I give the refresh option.

greetings

Did you installed also drivers for virtual/generic child devices? From your description I suspect they are missing. And so root device can't create child devices to forward readings to.

The simples way is to install the whole bundle (with all the files and child device drivers included)
https://bitbucket.org/ge4d/hubitat-code/raw/3485d0258249fa3db7a82d22ae959b7b46ac7868/Bundles/Bundle1.zip

It's a zip file that can be either imported to the hub directly or from local PC

Indeed, that was the problem, at the moment everything is already underway, I am going to work with this wonderful driver.

Thank you very much for your instructions.

Greetings

1 Like

One more issue, until now with the previous driver, the panels used the vertical dimmer adjustment.

Now this is recognized as windowshade and there is no similar control or I don't see it for panels. Is there something I'm missing or do I have to figure out how to adjust it by rules against a virtual device?
Greetings
I meant something like that
image

The 'cover' related child device is defined as a window shade. And dashboard sees it accordingly.

The tile should look something like
image

And dashboard app detects it trough coresponding capability

    capability "Actuator"
    capability "CurrentMeter"           // add 'amperage' attribute
    capability "EnergyMeter"            // add 'energy' attribute
    capability "PowerMeter"             // add 'power' attribute
    capability "Refresh"
    capability "VoltageMeasurement"     // add 'voltage' and 'frequency' attributes
    **capability "WindowShade"**            // add 'windowShade' attribute and 'on','off' commands

I need to check what is vertical dimmer.

Again it is correct. Thank you so much.

The difference is that the previous driver treated the device as a Dimmer and this one treats it as a shader, so when migrating from one to the other due to a change in the device, it requires changing the type of device and the panels on each device.
It is not something in your driver, but it makes the migration from one to the other not so fast.

Greetings and thank you very much.

Hello again, the device is a bit talkative for my taste, it reports the energy every minute despite having this configuration set, any solution?

Greetings


Yes, all shellies are chatty.
There is no way to make them send less data (except switching to polling at the cost of loosing interactivity). I did related feature request on their web page like a 6..8 months ago.

Thresholds are added to reduce event generation frequency (attribute change frequency) depending on your load and use case. Data will still come in (logs will report it in "debug" and "info" modes). But child devices will reject subtle (less than threshold) changes (can be checked trough child device logs).

2 Likes

I understand, would you give me some indication of in which line of code I could change the polling time, for this specific device it would be good for me and I think I won't lose anything for my specific use.

greetings

This driver simply has no polling interval. It's not polling at all. All the events are issued by shelly device itself.

If you want polling, you need to set RM calling root device 'Refresh' method. It makes async http request for full status update. (child devices use websocket connection for partial updates and will require event stream running). All child device commands except child 'Refresh' are also using async http request and so will remain functional.

And comment out code at line 833 to avoid automatically opening event stream to device at boot time.

void initialize() {
// connect() < ----
}

If you want to make any modifications I can explain what code does what.
But it should not be confusing as functions mostly have self explanatory names. Except maybe few of them.

1 Like

Good, sorry for not answering, I have had the focus of. i time on other matters.

Thank you very much for offering your code, I don't have the time right now to deal with it. But I thank you for your offer. We will return to it later.

all the best

Hi

I use a Shelly plus 2 with a liniar actuator with buildin limit switches.
So I use Shelly timer (movement time limits) to signal end of limit.
I use shelly Cloud app to program the above.

The Child hubitat driver has OPEN - CLOSE - STOP_POSITION_CHANGE
But I have no access to use them in the Hubitat dashboard
The Parent driver does not support OPEN - CLOSE - STOP_POSITION_CHANGE

Also I use Shelly input switch as Control button mode:single that perform OPEN - STOP - CLOSE sequence for each button press
The Hubitat child driver for Shelly inputs does not work when I press the PUSH button in the driver - no state changes in the input driver

Is it possible that your Shelly driver can support liniar actuator with buildin limit switches ?

Otherwise great driver that works as Dashboard Shade - but cannot stop Shade halfways with a liniar actuator

best regards
Per
Denmark

Has anyone managed to get a shelly 1 pm pro working with these drivers? thanks

Was struggling with this today found this driver would work for Shelly 1 Mini gen 3. good luck. Hubitat-Drivers/Shelly-as-a-Switch.groovy at master · ShellyUSA/Hubitat-Drivers · GitHub