Shelly Binding

Done here:

Unfortunately I don’t get any obvious logs nor do I see the connects and disconnects that another user shared previously.
But I’ve replaced the device and even the new one has the same issue.

Support for Shelly 2 PM Gen3 would be great.
I connected the device to openHAB via MQTT but this is a hack only.
Let me know how I can support for testing.

Not sure about that slogan/use case, but I just got my first Plus Uni devices to read out my gas and water meters. I installed the first one for the water meter and in the Shelly app it does its job already. I can also query the values for the counter using e.g.

wget http://shellyplusuniaddress/rpc/Input.GetConfig?id=2

But in Openhab 4.3.1 (and just updated to 4.3.2 with same result) the Plus Uni is discovered, but then fails to initialize (offcial binding). Found that also as open issue #17328 on Github.
Is there anything I can help with?

I switched logging to trace now. Appears as if it is handled like the old Uni. At least it is queried using the http://x.x.x.x/settings address which is not available on gen2 devices. After the 404 response the binding logs an unexpected api response and sets it to communication error.

yes, the Plus UNI was fixed and Plus 2PM Gen 3 was added in between. Stay tuned until I get my Dev environment working again so I could provide a current DEV build

1 Like

I move the brightness slider from 0 to 20, the Shelly goes ON → ok.
Then I move the slider to 0, the Shelly stays ON and the brightness on web page shows 2 → not ok.
Here is the log:

2025-01-21 18:43:57.866 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Set brightness to 11.0%/11

2025-01-21 18:43:57.867 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Changing brightness from 0 to 11

2025-01-21 18:43:57.868 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Setting brightness to 11

2025-01-21 18:43:57.869 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Send light settings: {brightness=11, turn=on}

2025-01-21 18:43:57.917 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Unable to handle command: API call not implemented(class org.openhab.binding.shelly.internal.api.ShellyApiException)

2025-01-21 18:43:57.918 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusrgbwpm-30c922570f6c: Channel device#heartBeat updated with 2025-01-21T18:43:57.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2025-01-21 18:43:57.935 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplusrgbwpm-30c922570f6c: NotifyStatus update received: {"src":"shellyplusrgbwpm-30c922570f6c","dst":"openhab-192.168.178.211","method":"NotifyStatus","params":{"ts":1.73748143789E9,"rgbw:0":{"id":0,"source":"HTTP_in","output":true,"rgb":[255,133,26],"brightness":11.0,"white":31}}}

2025-01-21 18:43:58.079 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Set brightness to 17.0%/17

2025-01-21 18:43:58.080 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Changing brightness from 0 to 17

2025-01-21 18:43:58.081 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Setting brightness to 17

2025-01-21 18:43:58.082 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Send light settings: {brightness=17, turn=on}

2025-01-21 18:43:58.126 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Unable to handle command: API call not implemented(class org.openhab.binding.shelly.internal.api.ShellyApiException)

2025-01-21 18:43:58.128 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusrgbwpm-30c922570f6c: Channel device#heartBeat updated with 2025-01-21T18:43:58.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2025-01-21 18:43:58.149 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplusrgbwpm-30c922570f6c: NotifyStatus update received: {"src":"shellyplusrgbwpm-30c922570f6c","dst":"openhab-192.168.178.211","method":"NotifyStatus","params":{"ts":1.7374814381E9,"rgbw:0":{"id":0,"source":"HTTP_in","output":true,"rgb":[255,133,26],"brightness":17.0,"white":31}}}

2025-01-21 18:43:58.279 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Set brightness to 19.0%/19

2025-01-21 18:43:58.280 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Changing brightness from 0 to 19

2025-01-21 18:43:58.281 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Setting brightness to 19

2025-01-21 18:43:58.282 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Send light settings: {brightness=19, turn=on}

2025-01-21 18:43:58.323 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Unable to handle command: API call not implemented(class org.openhab.binding.shelly.internal.api.ShellyApiException)

2025-01-21 18:43:58.347 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplusrgbwpm-30c922570f6c: NotifyStatus update received: {"src":"shellyplusrgbwpm-30c922570f6c","dst":"openhab-192.168.178.211","method":"NotifyStatus","params":{"ts":1.7374814383E9,"rgbw:0":{"id":0,"source":"HTTP_in","output":true,"rgb":[255,133,26],"brightness":19.0,"white":31}}}

2025-01-21 18:43:58.480 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Set brightness to 20.0%/20

2025-01-21 18:43:58.481 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Changing brightness from 0 to 20

2025-01-21 18:43:58.481 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Setting brightness to 20

2025-01-21 18:43:58.482 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Send light settings: {brightness=20, turn=on}

2025-01-21 18:43:58.531 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Unable to handle command: API call not implemented(class org.openhab.binding.shelly.internal.api.ShellyApiException)

2025-01-21 18:43:58.552 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplusrgbwpm-30c922570f6c: NotifyStatus update received: {"src":"shellyplusrgbwpm-30c922570f6c","dst":"openhab-192.168.178.211","method":"NotifyStatus","params":{"ts":1.7374814385E9,"rgbw:0":{"id":0,"source":"HTTP_in","output":true,"rgb":[255,133,26],"brightness":20.0,"white":31}}}

2025-01-21 18:43:58.931 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplusrgbwpm-30c922570f6c: NotifyStatus update received: {"src":"shellyplusrgbwpm-30c922570f6c","dst":"openhab-192.168.178.211","method":"NotifyStatus","params":{"ts":1.73748143889E9,"rgbw:0":{"id":0,"apower":20.1}}}

2025-01-21 18:43:58.945 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplusrgbwpm-30c922570f6c: NotifyStatus update received: {"src":"shellyplusrgbwpm-30c922570f6c","dst":"openhab-192.168.178.211","method":"NotifyStatus","params":{"ts":1.73748143889E9,"rgbw:0":{"id":0,"current":0.804}}}

2025-01-21 18:44:00.040 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplusrgbwpm-30c922570f6c: NotifyStatus update received: {"src":"shellyplusrgbwpm-30c922570f6c","dst":"openhab-192.168.178.211","method":"NotifyStatus","params":{"ts":1.73748144E9,"rgbw:0":{"id":0,"aenergy":{"total":4507.887,"by_minute":[66.482,81.188,124.477],"minute_ts":1737481440}}}}

2025-01-21 18:44:00.041 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusrgbwpm-30c922570f6c: Channel device#heartBeat updated with 2025-01-21T18:44:00.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2025-01-21 18:44:02.899 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Set brightness to 17.0%/17

2025-01-21 18:44:02.900 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Changing brightness from 0 to 17

2025-01-21 18:44:02.901 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Setting brightness to 17

2025-01-21 18:44:02.902 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Send light settings: {brightness=17, turn=on}

2025-01-21 18:44:02.957 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Unable to handle command: API call not implemented(class org.openhab.binding.shelly.internal.api.ShellyApiException)

2025-01-21 18:44:02.958 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusrgbwpm-30c922570f6c: Channel device#heartBeat updated with 2025-01-21T18:44:02.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2025-01-21 18:44:02.981 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplusrgbwpm-30c922570f6c: NotifyStatus update received: {"src":"shellyplusrgbwpm-30c922570f6c","dst":"openhab-192.168.178.211","method":"NotifyStatus","params":{"ts":1.73748144293E9,"rgbw:0":{"id":0,"source":"HTTP_in","output":true,"rgb":[255,133,26],"brightness":17.0,"white":31}}}

2025-01-21 18:44:03.104 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Set brightness to 10.0%/10

2025-01-21 18:44:03.105 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Changing brightness from 0 to 10

2025-01-21 18:44:03.106 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Setting brightness to 10

2025-01-21 18:44:03.107 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Send light settings: {brightness=10, turn=on}

2025-01-21 18:44:03.147 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Unable to handle command: API call not implemented(class org.openhab.binding.shelly.internal.api.ShellyApiException)

2025-01-21 18:44:03.149 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusrgbwpm-30c922570f6c: Channel device#heartBeat updated with 2025-01-21T18:44:03.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2025-01-21 18:44:03.171 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplusrgbwpm-30c922570f6c: NotifyStatus update received: {"src":"shellyplusrgbwpm-30c922570f6c","dst":"openhab-192.168.178.211","method":"NotifyStatus","params":{"ts":1.73748144312E9,"rgbw:0":{"id":0,"source":"HTTP_in","output":true,"rgb":[255,133,26],"brightness":10.0,"white":31}}}

2025-01-21 18:44:03.306 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Set brightness to 2.0%/2

2025-01-21 18:44:03.307 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Changing brightness from 0 to 2

2025-01-21 18:44:03.308 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Setting brightness to 2

2025-01-21 18:44:03.309 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Send light settings: {brightness=2, turn=on}

2025-01-21 18:44:03.351 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Unable to handle command: API call not implemented(class org.openhab.binding.shelly.internal.api.ShellyApiException)

2025-01-21 18:44:03.374 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplusrgbwpm-30c922570f6c: NotifyStatus update received: {"src":"shellyplusrgbwpm-30c922570f6c","dst":"openhab-192.168.178.211","method":"NotifyStatus","params":{"ts":1.73748144333E9,"rgbw:0":{"id":0,"source":"HTTP_in","output":true,"rgb":[255,133,26],"brightness":2.0,"white":31}}}

2025-01-21 18:44:03.510 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Set brightness to 0.0%/0

2025-01-21 18:44:03.511 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Brightness=0 -> switch light OFF

2025-01-21 18:44:03.544 [DEBUG] [.internal.handler.ShellyLightHandler] - shellyplusrgbwpm-30c922570f6c: Unable to handle command: POST http://192.168.178.90/rpc > No handler for Light.Set

2025-01-21 18:44:04.929 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplusrgbwpm-30c922570f6c: NotifyStatus update received: {"src":"shellyplusrgbwpm-30c922570f6c","dst":"openhab-192.168.178.211","method":"NotifyStatus","params":{"ts":1.73748144489E9,"rgbw:0":{"id":0,"apower":3.4}}}

2025-01-21 18:44:04.931 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusrgbwpm-30c922570f6c: Channel device#heartBeat updated with 2025-01-21T18:44:04.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2025-01-21 18:44:04.934 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplusrgbwpm-30c922570f6c: NotifyStatus update received: {"src":"shellyplusrgbwpm-30c922570f6c","dst":"openhab-192.168.178.211","method":"NotifyStatus","params":{"ts":1.73748144489E9,"rgbw:0":{"id":0,"current":0.137}}}

2025-01-21 18:44:13.974 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusrgbwpm-30c922570f6c: Channel device#heartBeat updated with 2025-01-21T18:44:13.000+0100 (type class

Sorry for the late reply, I was busy with other things.
I guess I found the issue. I had to update the BLU gateway script on the Shelly plus 2PM and reconnect the Shelly BLU D/W. After that, everything is working as it should.

1 Like

I can help testing, too. Already created an issue (which you already replied to).

I updated the DEV build
org.openhab.binding.shelly-4.3.5-SNAPSHOT.jar

  • Based on latest OH5 code
  • RPC call uses src=“oh-”+serviceName rather than local IP. This might fix “duplicate Id” messages on the device debug log
  • Fix: Watchdog does not expire for BLU devices when they don’t send updates for a log time
  • Shelly Pro 4PM should work again, requires re-discovery of the thing
  • Plus 2PM UL and Plus 2PM Gen3 added

Please check if this build runs on OH4. It’s compiled from OH5 source base, but should run on OH4 with Java 17 (OH5 is Java 21).
Anyone could do the test having an OH4 system and using this bild even not requiring specifically one of the fixes (just backup the version you have).

Let me know if someone needs an OH5 build.

Do you mean the “duplicate” BLU device messages ([shelly] Older signals from BLU devices are being read · Issue #18143 · openhab/openhab-addons · GitHub)?

no, I mean the device debug log shows “duplicate id” messages
I have your’s in mind

1 Like

Should I wait a bit, and test the new version (which is in your mind ;)), or would you prefer I already test the jar you just released?

try the DEV build above, I added the model ID for Plus 2PM UL and Plus 2PM Gen3

are you able to identify the duplicate messages in the DEBUG log?
is the second one reported by the same Shelly gateway? is the pid shown in the log the same?

try the updated build, it includes the gateway in the debug message

please try the updated DEV build posted above. if you already discovered the thing you need to delete and re-discover the thing; there should be a new thing type shellyplusuni

2025-01-22 19:51:41.732 [DEBUG] [ng.shelly.internal.api2.ShellyBluApi] - shellyblumotion-b0c7de422d7a: BluEvent received: {"src":"shellyplus1pm-d4d4da7de204","params":{"ts":1.73757190171E9,"events":[{"id":1,"ts":1.73757190171E9,"component":"script:1","event":"oh-blu.data","data":{"addr":"b0:c7:de:42:2d:7a","encryption":false,"BTHome_version":2,"pid":202,"Battery":100,"Illuminance":0,"Motion":1,"rssi":-66}}]}}
2025-01-22 19:51:41.732 [DEBUG] [ng.shelly.internal.api2.ShellyBluApi] - shellyblumotion-b0c7de422d7a: BLU event oh-blu.data received from address b0:c7:de:42:2d:7a, via gateway shellyplus1pm-d4d4da7de204, pid=202
2025-01-22 19:51:41.732 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyblumotion-b0c7de422d7a: Channel sensors#motion updated with ON (type class org.openhab.core.library.types.OnOffType).
[...]
2025-01-22 19:51:42.521 [DEBUG] [ng.shelly.internal.api2.ShellyBluApi] - shellyblumotion-b0c7de422d7a: BluEvent received: {"src":"shellyplusplugs-c82e180a06cc","params":{"ts":1.73757190243E9,"events":[{"id":1,"ts":1.73757190243E9,"component":"script:1","event":"oh-blu.data","data":{"addr":"b0:c7:de:42:2d:7a","encryption":false,"BTHome_version":2,"pid":202,"Battery":100,"Illuminance":0,"Motion":1,"rssi":-92}}]}}
2025-01-22 19:51:42.521 [DEBUG] [ng.shelly.internal.api2.ShellyBluApi] - shellyblumotion-b0c7de422d7a: BLU event oh-blu.data received from address b0:c7:de:42:2d:7a, via gateway shellyplusplugs-c82e180a06cc, pid=202
2025-01-22 19:51:42.521 [DEBUG] [ng.shelly.internal.api2.ShellyBluApi] - shellyblumotion-b0c7de422d7a: Duplicate packet for PID=202 received, ignore
2025-01-22 19:51:42.656 [TRACE] [helly.internal.api2.Shelly2RpcSocket] - Lamp tuinhuis: Inbound Rpc message: {"src":"shelly1mini-6055f9985660","dst":"oh-shelly1mini-6055f9985660","method":"NotifyEvent","params":{"ts":1737571915.63,"events":[{"component":"script:1","id":1,"event":"oh-blu.data","data":{"encryption":false,"BTHome_version":2,"pid":201,"Battery":100,"Illuminance":0,"Motion":0,"addr":"b0:c7:de:42:2d:7a","rssi":-88},"ts":1737571915.63}]}}
2025-01-22 19:51:42.656 [TRACE] [ng.shelly.internal.api2.ShellyBluApi] - shellyblumotion-b0c7de422d7a: ShellyEvent received: {"src":"shelly1mini-6055f9985660","params":{"ts":1.73757191563E9,"events":[{"id":1,"ts":1.73757191563E9,"component":"script:1","event":"oh-blu.data","data":{"addr":"b0:c7:de:42:2d:7a","encryption":false,"BTHome_version":2,"pid":201,"Battery":100,"Illuminance":0,"Motion":0,"rssi":-88}}]}}
2025-01-22 19:51:42.656 [TRACE] [y.internal.handler.ShellyBaseHandler] - shellyblumotion-b0c7de422d7a: Watchdog restarted (expires in 43260 sec)
2025-01-22 19:51:42.657 [DEBUG] [ng.shelly.internal.api2.ShellyBluApi] - shellyblumotion-b0c7de422d7a: BluEvent received: {"src":"shelly1mini-6055f9985660","params":{"ts":1.73757191563E9,"events":[{"id":1,"ts":1.73757191563E9,"component":"script:1","event":"oh-blu.data","data":{"addr":"b0:c7:de:42:2d:7a","encryption":false,"BTHome_version":2,"pid":201,"Battery":100,"Illuminance":0,"Motion":0,"rssi":-88}}]}}
2025-01-22 19:51:42.657 [DEBUG] [ng.shelly.internal.api2.ShellyBluApi] - shellyblumotion-b0c7de422d7a: BLU event oh-blu.data received from address b0:c7:de:42:2d:7a, via gateway shelly1mini-6055f9985660, pid=201
2025-01-22 19:51:42.657 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyblumotion-b0c7de422d7a: Channel sensors#motion updated with OFF (type class org.openhab.core.library.types.OnOffType).

This is a (trimmed) snippet, in which package 201 comes in again after package 202, thus erroneously updating the channel with OFF.

I tested Plus 2PM Gen3. Thing is recognized but when I then do Add Equipment to Model - it hangs: Add the items from the things page is not fully loaded.

Also a shellyplus1pm is not recognized anymore:

Also Shelly 2PM Gen3 was not listed among available Shelly Types when trying to add it manually.

I have a problem in not getting values from a BLU motion sensor through a Gen2 BLU gateway USB stick. I am probably missing a small detail.

Both BLU gateway and BLU motion sensor are paired and online in openhab. Firmware updated to 1.4.4 and 1.0.16 (latest versions)
Beacon mode activated.

Is there anything else I need to do?

try updated build

1 Like

Do I need to go through the process of deleting all my things? Or is that not necessary this time?

no, should work by switching to the dev build