Shelly Device Handlers for Hubitat

I'm sorry if this is lame but I'm using Shelly Switch Relay Driver https://github.com/ShellyUSA/Hubitat-Drivers/blob/master/Shelly-as-a-Switch.groovy to control my Shelly 1PM relay Shelly 1PM and it turns the relay on and off just fine.

First, is there some new driver I should be using for my older Shelly Shelly Gen 1 devices like the Shelly 1PM?

Second, the status in HE isn't alway up-to-date, since these relays also have a physical switch connected to them. It seems I could use the Maker API to have the relay update the HE status on occasion. Is it best to just push the "refresh" URL in the "Output On" and "Output Off" slots?

That is, if a HE Maker API url like this
http://192.168.88.110/apps/api/231/devices/138/refresh?access_token=
is called when the relay opens and closes from the physical switch control, will HE keep up to date on the status? Or is there a better approach.

Much thanks,

I think the small delay is something mandatory. When you have a mesh wifi system the mesh controller is changing channels of the accesponits what result in a schort disconnect, this is triggering the health status offline/online with a few seconds between.

You better use the system driver from Hubitat (for the gen1 devices) If you want the status updated in both directions.

Driver is updated:

'healthStatus' now has update delay. Needs to save/set preferences once after driver update to start functioning. (Newly installed device/driver should work out of the box)

2 Likes

Very nice, thx for that

Driver is updated:

  • Added experimental support for dimmer functionality for the upcoming Shelly Pro Dimmer xPM

  • Partial support is expected for the Shelly Plus Uni out of the box: digital inputs, relays, posibly temperature sensor support [no analog input support atm]

  • Gen3 devices seem to represent mostly hardware update and announced (but not yet available) 'matter' support. Expected to stay API compatible with Gen2 [one of them were successfully tested and confirmed fully working with this driver]

2 Likes

Hi @dmitry.rozovik, I have been using the built-in HE driver for my Shelly Dimmer 2's. Do you have a better driver available? I can't see one listed on your github page

Hello @rhodesda,

Unfortunately my driver/bundle has no support for Gen1 devices. My driver is relying on a functionality that is only present starting Gen2 devices.

Maybe thread main repository has something you could use. Like Shelly-Vintage that is also a dimmer device.

1 Like

I keep getting the message about not being able to process the bundle.
image

Also downloaded the file and tried again. Same error.

A hub reboot didn't help.
A hub reboot and database rebuild didn't help.

I had an old Shelly driver manually installed before but I removed both the device and the driver.

Any suggestions?

Hello,

The only thing that comes to my mind is possibly a file name clash with some other/older driver file.
Just in case please try this link: https://bitbucket.org/ge4d/hubitat-code/raw/f5d03aa04c9069011141512a7732b22f97676738/Bundles/Bundle1.zip

@bertabcd1234 @bobbyD
Tagging to ask a question: Is it possible to improove error reporting for bundles? It's hard to guess what actually went wrong in such cases.

1 Like

What version of HE are you on? If it keeps being a problem you could open up the zip file and import each source file manually.

C7 with 2.3.7.145.

File (link) in this post worked: Shelly Device Handlers for Hubitat - #540 by dmitry.rozovik

However, there was no 'success of import' message of any kind. It just sat there for about 5 minutes until I hit cancel on the import... It then refreshed the screen to show a the drivers were imported as a bundle.

There is no loggin whatsoever in the log files so agree with @dmitry.rozovik that troubleshooting is hard.

YES.. this one worked!

Also see: Shelly Device Handlers for Hubitat - #542 by user3491

Thanks Dmitry!

hmmm, did some tests, I think the update delay is not working well.
Settings and device are saved after the new driver, "Update health status in (S) if link failed" is 60 seconds. Health status stays online



Thanks for the report! I will investigate the case.

Driver is updated:

  • Added new component support 'pm1' for 'mini PM' devices
  • Other internal maintenace changes without significant impact on general behavior (no need to update driver for this one)

Driver is updated:

  • Fixed health status check (needs real world testing)
2 Likes

it looks fine, thx

2 Likes

@dmitry.rozovik Thanks for your efforts to support Shelly devices! I've been trying out different drivers for the Shelly Plus 2PM in cover mode and your driver is working well. Having the child devices is making the most sense and enabling the behaviour I'm looking for.

I have a question about HomeKit integration related to this device. Is there anything you're aware of that may be missing to enable the 'cover' to operate properly with HomeKit? What I'm experiencing is the window shade button doesn't represent the right state (open/closed) and although I can initiate the cover moving to a mid-point by tapping the button and then sliding in HomeKit, the button immediately jumps back to open even though the physical cover moves to the requested position. I'm not sure where the problem is, but I'm starting here to track it down. The state in HE is correct while this is occurring.

In this case the cover child device is exposed to HomeKit:

Window Shade
Dining Room Shutter Relay cover 1 (in Dining Room)
Export as: Normal (0 = closed, 100 = open)
Required capabilities: Window Shade

I have no info on HomeKit integration. But I'll try to check if there is anything in the Window Shade child device that needs to be additionally configured (like operating modes list for thermostats)

P.S.: One thing that come to my mind right away is a scale factor: Could it be that HomeKit expects [0..1] range while device provides [0..100]? In this case anything more than 0 could be threated as 'open' state

1 Like