Shelly Binding

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

Hi @markus7017,
Thank you for the dev build. A quick test showed that the BLU motion worked for some minutes and then stopped again to update the channels. Scanning it via a opensource BT, I receive frequent updates. So it is definately not the device. So at least for me, it is unchanged with the dev build.

this build isa dressing the issue @ErikDB sees, you seem to have a different problem

@ErikDB Does the patch works as expected?

I was only just now able to install it. Will give an update soon!

Thanks for the patch!

Hello everyone,
My Gen3 shelly crashed too, that i hacked around a little bit last weekend. As far i was able to understand, Shelly crashes are caused by discovery. According to the documentation, Shelly accepts only 6 non-persistent RPC channels: https://shelly-api-docs.shelly.cloud/gen2/General/RPCChannels. For some for me unknown reason, this was not a problem for Gen2 devices, but for Gen3. That moved me to adapt the discovery a “litte bit”: GitHub - falkena/openhab-addons at feature/shelly and the binary is https://github.com/falkena/binaries/raw/refs/heads/master/org.openhab.binding.shelly-5.0.0-SNAPSHOT.jar My local environment runs stable for round about one week now. Additionally, messages about null-jobs (Stopped without executing or closing null) are also gone. Sadly, I’ve no idea, my hack breaks anything. Nevertheless, may be it will help.

Greetings,

Alexander

1 Like

@markus7017, looking at this log snippet, I would think the patch works:

2025-01-25 10:29:14.480 [TRACE] [helly.internal.api2.Shelly2RpcSocket] - Lampje eetkamer: Inbound Rpc message: {"src":"shellyplusplugs-e465b8b80068","dst":"oh-shellyplusplugs-e465b8b80068","method":"NotifyEvent","params":{"ts":1737797354.42,"events":[{"component":"script:1","id":1,"event":"oh-blu.data","data":{"encryption":false,"BTHome_version":2,"pid":53,"Battery":100,"Illuminance":0,"Motion":0,"addr":"b0:c7:de:42:2d:7a","rssi":-86},"ts":1737797354.42}]}}
2025-01-25 10:29:14.480 [TRACE] [ng.shelly.internal.api2.ShellyBluApi] - shellyblumotion-b0c7de422d7a: ShellyEvent received: {"src":"shellyplusplugs-e465b8b80068","params":{"ts":1.73779735442E9,"events":[{"id":1,"ts":1.73779735442E9,"component":"script:1","event":"oh-blu.data","data":{"addr":"b0:c7:de:42:2d:7a","encryption":false,"BTHome_version":2,"pid":53,"Battery":100,"Illuminance":0,"Motion":0,"rssi":-86}}]}}
2025-01-25 10:29:14.481 [TRACE] [y.internal.handler.ShellyBaseHandler] - shellyblumotion-b0c7de422d7a: Watchdog restarted (expires in 43260 sec)
2025-01-25 10:29:14.481 [DEBUG] [ng.shelly.internal.api2.ShellyBluApi] - shellyblumotion-b0c7de422d7a: BluEvent received: {"src":"shellyplusplugs-e465b8b80068","params":{"ts":1.73779735442E9,"events":[{"id":1,"ts":1.73779735442E9,"component":"script:1","event":"oh-blu.data","data":{"addr":"b0:c7:de:42:2d:7a","encryption":false,"BTHome_version":2,"pid":53,"Battery":100,"Illuminance":0,"Motion":0,"rssi":-86}}]}}
2025-01-25 10:29:14.481 [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-e465b8b80068, pid=53
2025-01-25 10:29:14.481 [DEBUG] [ng.shelly.internal.api2.ShellyBluApi] - shellyblumotion-b0c7de422d7a: Duplicate packet for PID=53 received, ignore
2025-01-25 10:29:14.556 [TRACE] [helly.internal.api2.Shelly2RpcSocket] - Lamp tuinhuis: Inbound Rpc message: {"src":"shelly1mini-6055f9985660","dst":"oh-shelly1mini-6055f9985660","method":"NotifyEvent","params":{"ts":1737797377.67,"events":[{"component":"script:1","id":1,"event":"oh-blu.data","data":{"encryption":false,"BTHome_version":2,"pid":52,"Battery":100,"Illuminance":0,"Motion":1,"addr":"b0:c7:de:42:2d:7a","rssi":-93},"ts":1737797377.67}]}}
2025-01-25 10:29:14.556 [TRACE] [ng.shelly.internal.api2.ShellyBluApi] - shellyblumotion-b0c7de422d7a: ShellyEvent received: {"src":"shelly1mini-6055f9985660","params":{"ts":1.73779737767E9,"events":[{"id":1,"ts":1.73779737767E9,"component":"script:1","event":"oh-blu.data","data":{"addr":"b0:c7:de:42:2d:7a","encryption":false,"BTHome_version":2,"pid":52,"Battery":100,"Illuminance":0,"Motion":1,"rssi":-93}}]}}
2025-01-25 10:29:14.557 [TRACE] [y.internal.handler.ShellyBaseHandler] - shellyblumotion-b0c7de422d7a: Watchdog restarted (expires in 43260 sec)
2025-01-25 10:29:14.557 [DEBUG] [ng.shelly.internal.api2.ShellyBluApi] - shellyblumotion-b0c7de422d7a: BluEvent received: {"src":"shelly1mini-6055f9985660","params":{"ts":1.73779737767E9,"events":[{"id":1,"ts":1.73779737767E9,"component":"script:1","event":"oh-blu.data","data":{"addr":"b0:c7:de:42:2d:7a","encryption":false,"BTHome_version":2,"pid":52,"Battery":100,"Illuminance":0,"Motion":1,"rssi":-93}}]}}
2025-01-25 10:29:14.557 [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=52
2025-01-25 10:29:14.557 [DEBUG] [ng.shelly.internal.api2.ShellyBluApi] - shellyblumotion-b0c7de422d7a: Duplicate packet for PID=52 received, ignore
2025-01-25 10:29:14.610 [TRACE] [helly.internal.api2.Shelly2RpcSocket] - Lamp tuinhuis: Inbound Rpc message: {"src":"shelly1mini-6055f9985660","dst":"oh-shelly1mini-6055f9985660","method":"NotifyEvent","params":{"ts":1737797377.87,"events":[{"component":"script:1","id":1,"event":"oh-blu.data","data":{"encryption":false,"BTHome_version":2,"pid":53,"Battery":100,"Illuminance":0,"Motion":0,"addr":"b0:c7:de:42:2d:7a","rssi":-89},"ts":1737797377.87}]}}
2025-01-25 10:29:14.611 [TRACE] [ng.shelly.internal.api2.ShellyBluApi] - shellyblumotion-b0c7de422d7a: ShellyEvent received: {"src":"shelly1mini-6055f9985660","params":{"ts":1.73779737787E9,"events":[{"id":1,"ts":1.73779737787E9,"component":"script:1","event":"oh-blu.data","data":{"addr":"b0:c7:de:42:2d:7a","encryption":false,"BTHome_version":2,"pid":53,"Battery":100,"Illuminance":0,"Motion":0,"rssi":-89}}]}}
2025-01-25 10:29:14.611 [TRACE] [y.internal.handler.ShellyBaseHandler] - shellyblumotion-b0c7de422d7a: Watchdog restarted (expires in 43260 sec)
2025-01-25 10:29:14.611 [DEBUG] [ng.shelly.internal.api2.ShellyBluApi] - shellyblumotion-b0c7de422d7a: BluEvent received: {"src":"shelly1mini-6055f9985660","params":{"ts":1.73779737787E9,"events":[{"id":1,"ts":1.73779737787E9,"component":"script:1","event":"oh-blu.data","data":{"addr":"b0:c7:de:42:2d:7a","encryption":false,"BTHome_version":2,"pid":53,"Battery":100,"Illuminance":0,"Motion":0,"rssi":-89}}]}}
2025-01-25 10:29:14.611 [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=53
2025-01-25 10:29:14.612 [DEBUG] [ng.shelly.internal.api2.ShellyBluApi] - shellyblumotion-b0c7de422d7a: Duplicate packet for PID=53 received, ignore

On the last line beginning with 2025-01-25 10:29:14.557, I see Duplicate packet for PID=52 received, ignore. I assume this is new behavior? (And I also assume you reused the phrase from the check for duplicates which already existed, instead of introducing a new phrase like “… is not the most recent packet”?)

Am I to understand that this might fix the Shelly pro 3m crashes too?

Yes

But then we need changes to the discovery and not the Shelly binding..