New Shelly Plus Drivers

This Shelly just support on or off, so the long press wont do anything else then just switch from on to off.. unless i have misunderstood something.

With this driver you can schedule the status update, so if you use the physical or official shelly app to change the states they well also be uptated in he.

Give it a try and if you vave issues just poke me and I'll try to fix them.

Hello Shelly Users,

I have recently starting using some of the new Plus devices and as the OOTB and official drivers where a bit messy or not suited for my needs.

I have created a generic driver that works with the new 1+2PM devices and allows you to control each channel as expected with params. (it should also would with other new plus models)

Note: This driver only support local IP connection (Not cloud)

Hubitat/ShellyPlus Generic.groovy at master · syepes/Hubitat · GitHub

Hope this helps,
Seb

1 Like

Nice, Is the shelly 2PM available in button controller, if yes, does long press work?
Is the status updated in HE when you use the buttons on the Shelly?

Do you mean you not aware of the possibility of long press or there is no need for it?
Today I don't have Shelly+ devices because I want the same functions of the embedded system drivers (2 way live syncronisation without maker API) + the device must be available in Button Controllers for using the buttons seperate from the relay

Many thanks Seb, I am hoping to get it working with my new Shelly devices. Whilst I haven't got one yet, do you know if it will work with the Shelly Plus i4?
Many thanks

Don't know if this device has the same API, if it does it should work as I have build it to support any number of buttons as parameters.

Apologies in advance for asking a newbie question but regarding your generic driver how do I trigger the second switch? Putting a switch on a dashboard allows me to control the device but it only triggers switch0, not switch1. I suspect I am asking a question that is a bit elementary and I ought to be doing something a bit clever with Rul Machine but it is a couple of years since I last did anything with Hubitat and so a bit 'rusty'. Any tutorials you can point me to, alternatively, would also be a real bonus.
Many thanks in advance

No worries.
When using my Shelly driver, you can control any number of switches you just need to specify it as parameter in the on or off commands.
This cal also be done in any of the rules you want to create:

Hi,

I added a ShellyPlus 2PM to my Hubitat using your ShellyPlus Generic driver...and it appears to be doing it's job just fine!

However, I can't wrap my head around switching switch1. I can switch switch0 on and off by a rule, but not switch1. Switch1 works however, but only manually on the device.

Am I overlooking something in RM or in the device setup?

Thx in advance!

It might be a bit problematic.

I don't know if RM allows to pass custom argument into the function call.

Default Hubitat interface (either dashboard or RM) relies on so called 'device capabilities' (a driver code side thing). And by default 'switch' capability is using on() and off() function calls (i.e. it doesn't expect any arguments in). And so I suppose Dashborad module and RM are not expecting it to accept any argument and don't provide one by initial platform design (I could be wrong here)

This driver is using on(num) off(num) calls. To make things work (when no argument provided) this driver uses so called default argument value on/off(BigDecimal value=0). So when Hubitat default interface is used the switch index will be always set to '0'. And that is why switch1 is accessible to you only from the device page (only at the point where you can provide this argument).

AFAIK, you either need somehow pass an argument from RM (maybe someone knows how to do it) or try some other driver that better suits your needs (if available)

Thanks for the reply! Very usefull.

I tried several other drivers, but this one works best so far. So I'm probably sticking with this one for now.

Would it be possible to rewrite the driver to just drive switch1? So I can add 2 drivers; 1 for switch0 and 1 for switch1, and add the same device twice with each a different driver.

I was thinking about rewriting the driver myself, I am not a programmer, but know some scripting. :slight_smile: Would that be possible with this driver?

Yes)) Any driver is possible to rewrite in any way) The real questions would be "Who?", "When?" and "How fast?" )))) (a bit of joking)

The driver with the exact such behavior already exist. Shelly Device Handlers for Hubitat - #448 by Evilborg

Absolutely yes. Though I would recommend to ask the author permission to use his code as the base just in case)

1 Like

ALL credits must stay in the code if you use any part of my code or anyone else's code for that matter.