Shelly Binding

please provide a DEBUG log showing device init. There should be no active connection setup for BLU devices

fyi: Today Shelly presented a buch of very interesting devices, an extended 3 / 5yr warranty for Plus/Pro devices and Shelly X as complete new platform - you have to watch this video
(for me that means more and more devices to handle, so it stays to be fun :-))

https://www.youtube.com/live/-hHrkZkTznc?si=AquaSuUvzuLucgjl

2 Likes

i am actually on
openhab> bundle:list | grep Shelly
282 x Active x 80 x 4.2.0.202405241838 x openHAB Add-ons :: Bundles :: Shelly Binding

2024-05-31 10:48:51.874 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellyblubutton:9ec0653684' changed from UNKNOWN (CONFIGURATION_PENDING): Initialisierung oder Gerät im Schlafmodus. to UNINITIALIZED

2024-05-31 10:48:51.876 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyblubutton-9ec0653684: Stopping Thing

2024-05-31 10:48:51.876 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyblubutton-9ec0653684: Shutting down

2024-05-31 10:48:51.876 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyblubutton-9ec0653684: Shelly statusJob stopped

2024-05-31 10:48:51.876 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyblubutton-9ec0653684: Closing Rpc API (socket is disconnected, discovery=false)

2024-05-31 10:48:51.877 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyblubutton-9ec0653684: Shutting down

2024-05-31 10:48:51.878 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellyblubutton:9ec0653684' changed from UNINITIALIZED to UNINITIALIZED (DISABLED)

2024-05-31 10:48:52.683 [DEBUG] [shelly.internal.ShellyHandlerFactory] - Shelly BLU Button: Create new thing of type shelly:shellyblubutton using ShellyBluSensorHandler

2024-05-31 10:48:52.691 [DEBUG] [shelly.internal.ShellyHandlerFactory] - Thing handler for uid shelly:shellyblubutton:9ec0653684 added, total things = 15

2024-05-31 10:48:52.691 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellyblubutton:9ec0653684' changed from UNINITIALIZED (DISABLED) to INITIALIZING

2024-05-31 10:48:52.693 [DEBUG] [ernal.handler.ShellyBluSensorHandler] - Thing is using  class org.openhab.binding.shelly.internal.handler.ShellyBluSensorHandler

2024-05-31 10:48:54.707 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyblubutton-9ec0653684: Using default userId admin from binding config

2024-05-31 10:48:54.708 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyblubutton-9ec0653684: Using default password from bindingConfig (userId=admin)

2024-05-31 10:48:54.708 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyblubutton-9ec0653684: Config: Device address=38398f8bae2c, HTTP user/password=admin/***, update interval=60

Blu Gateway=false, Range Extender: true

2024-05-31 10:48:54.708 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyblubutton-9ec0653684: Start initializing for thing Shelly BLU Button, type shellyblubutton, IP address 38398f8bae2c, Gen2: true, CoIoT: false

2024-05-31 10:48:54.709 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyblubutton-9ec0653684: Unable to initialize: BLU Device not yet connected(class org.openhab.binding.shelly.internal.api.ShellyApiException), retrying later

2024-05-31 10:48:54.709 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyblubutton-9ec0653684: Update status job started, interval=20*3=60sec.

2024-05-31 10:48:54.710 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellyblubutton:9ec0653684' changed from INITIALIZING to UNKNOWN (CONFIGURATION_PENDING): Initialisierung oder Gerät im Schlafmodus.
2024-05-31 10:49:53.996 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyblubutton-9ec0653684: Status update triggered thing initialization
2024-05-31 10:49:53.996 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyblubutton-9ec0653684: Start initializing for thing Shelly BLU Button, type shellyblubutton, IP address 38398f8bae2c, Gen2: true, CoIoT: false
2024-05-31 10:49:53.997 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyblubutton-9ec0653684: Unable to initialize: BLU Device not yet connected(class org.openhab.binding.shelly.internal.api.ShellyApiException), retrying later
2024-05-31 10:49:53.997 [DEBUG] [y.internal.handler.ShellyBaseHandler] - 
shellyblubutton-9ec0653684: Enabling channel cache (20 updates / 60s)

From the ShellyPlug where the BLU is actually connected i see the log entry “res.local_name undefined” when i click on the button

Hi,
I have the same issue, only getting undefined res.local_name

found: https://github.com/ALLTERCO/shelly-script-examples/issues/47

but until now I cannot see a fix. I think it is an issue in the shelly scripting…

Hello all,

I’ve updated today to the latest version of openhab and now I get (for all my shelly things):

Status: UNINITIALIZED
HANDLER_MISSING_ERROR
Handler factory not found

I suspect the manual installation of 4.2-DEV is ignored and I have to “do” something ?

Edit: I just had to do “feature:install openhab-transport-coap” in the openhab console. Everything is in order. What’s the way to make it permanent ?

Hello,
I saw that the autoon and autooff parameters are missing in the binding documentation for the shellyplugs device. I am desperately hoping that this may only be missing in the documentation but working in reality? Can someone confirm or deny this?

My wife is looking for an easy way to have a portable power plug with a timer to charge her smart devices (phone, watch, ear buds, tablet) and the Shelly Plug S would be perfect. The native Shelly web gui is too complicated and hence I would like to provide a slider for the “autooff” timer to switch off the plug when the device as been fully charged (the estimated charging time is given by the device).

Are the autoon / autooff parameters available for the shellyplugs or is there a chance to add them near-term so that I can provide that feature for my wife :wink: ?

EDIT:
I did some testing an added the following two items:

Number:Time ShellyPS_aofftime "Shelly Plug S [%.0f %unit%]" (gShelly)  {channel="shelly:shellyplugs:'######:relay#autoOff"}
Switch ShellyPS_tactive "Shelly Plug S" (gShelly)  {channel="shelly:shellyplugs:######:relay#timerActive"}

I can set a time interval in seconds and also turn the timer switch on and off but the changes are not passed to the device and vice versa when I change the timer settings the web UI of the plug.

Hence, my conclusion is that the parameters are not(yet) implemented for the Plug S.
And hence, I would kindly like to ask @markus7017 to add them into the binding :slight_smile:

EDIT 2:

It seems that the parameters are available in the Gen 2 version shellyplusplug so I am thinking of getting one of those but I would like to keep and still use my existing plug s devices and hence my request might still be considered with a lower priority :slight_smile:

Cheers
Justus

My Shelly BLU Door/Window sensors don’t always work like they should: Shelly BLU Door/Window not reporting correct state - #2 by ErikDB.

Does anyone recognize this behavior?

Are you on the latest DEV build? It also includes an updated BLU gateway script
provide DEBUG logs if the problem persists

No, there is no way to make it permanent,
but try to install the Shelly beta via UI (after removing it from the addons folder), this should bring the same DEV build, otherwise let me know

1 Like

I’m on the latest official release…

Where can I find this latest BLU gateway JS script? I’ll copy-paste it in the Shelly app then. :slight_smile:

The issue was that Enable Bluetooth gateway was enabled in Shelly’s UI. Shelly’s DEBUG log read Unable to start OH-BLU Scanner, make sure Shelly Gateway Support is disabled in device config.

I turned it off, as you suggested here (Shelly Binding - #3771 by markus7017), and now everything seems to work as it should.

I think it would be better if the binding documentation explicitly instructs users to disable Enable Bluetooth gateway. If you want, I can try to make a PR with changes to the README?

Sounds strange as I included 4 BLU Contacts today with gateway enabled and they work fine.

Nothing in Shelly’s DEBUG log?

Have never used logs on the Shelly‘s

Not sure if that was an implicit request for more information. :sweat_smile:

But the log is easily available if you go to your Shelly’s IP address in a browser, then click Advanced and then Diagnostics. I assume your logs will also read Unable to start OH-BLU Scanner, make sure Shelly Gateway Support is disabled in device config.

Yes, I can see that error message in the logs, but it still works.
Have now disabled the gatway option and still works…

Hi,

I have just received my new Shelly PlugS Plus as I like to use the AutoOff Timer to set a switch-off time for the plug. I defined the thing correctly and the appropriate items in my items file:

Number Shelly_1aoff "Shelly PlugS Plus 1 AutoOff Timer [%.0f]" (gShelly)  {channel="shelly:shellyplusplug:##########:relay#autoOff"}
Switch Shelly_1tactive "Shelly PlugS Plus 1 Switch" (gShelly)  {channel="shelly:shellyplusplug:##########:relay#timerActive"}

There are two issues that I like to raise:

  1. With Firmware 1.3.2 there is no more switch for AutoOff (see screenshot below)

  1. When I change the timer value in the Shelly WebUI the change is recognized in openHAB and the item shows the altered value. If I change the value in openHAB (tested with the API Explorer) then the value does not get changed on the plug (checked in WebUI):thinking:
    The documentation shows that the autoOff parameter is read/write and hence I expect that the plug should receive and apply a value sent from openHAB

What am I doing wrong?

Thanks for any hint and support :slight_smile:
Cheers Justus

Hi Markus,
do you already have some information as to whether the recently announced gen 3 shellys are supported by your binding?

I think there is a further Bug in the Binding… The button channel is not triggering any event. I see no error or warnings in the log…

Thing:

Thing shelly:shellyuni:E0xxxxxxxxx1 "WaMa_Anzeige" @ "Kueche" [deviceIp="192.yyy.1.129", userId="admin", password="secret", eventsPush=true, eventsSwitch=true, eventsButton=true]

Item:

Switch Shelly_Waschmaschine_Ausgang      "Waschmaschine"                  {channel="shelly:shellyuni:E0xxxxxxxxx1:relay2#output"}
Switch Shelly_Waschmaschine_Eingang      "Waschmaschine Switch"           {channel="shelly:shellyuni:E0xxxxxxxxx1:relay2#input"}

Rule:

rule "Reset WaMa"
when 
    Channel "shelly:shellyuni:E0xxxxxxxxx1:relay2#button" triggered SHORT_PRESSED
then{
    if (Shelly_Waschmaschine_Ausgang.state == ON){
        sendCommand(Shelly_Waschmaschine_Ausgang,OFF)
        sendCommand(WaMa_Stopflag,OFF)
    }
}
end

OH-Version: 4.2.0.M2