Shelly Binding

did you saw my note above?

Hi @markus7017 ,

yes saw it and just installed the newest 5.1. build. Now the weather station was in the inbox. I added it as THING, waited that it came online (good thing here is, that the weather station is delivering data in less than 5 seconds) and tried to add items to the channels. But


there are way to less channels shown up, that’s already the advanced view. But if it is like with my blu mqtt script, I have to wait, until all sensor data is send once from the weather station. Will keep you updated on that. Thank you so much again :slight_smile:

that’s a problem, because I use the initial packet to create channels on thing initialization. The binding doesn’t re-checks every time to avoid overhead.

Try the updated build

perfect! Now all Channels are there.

Is it possible to configure the channels, so the correct icon is shown up by default, or this something openHAB core does?

I know from my script, that the wind packet has 2 values, one wind average and one wind gust, also the wind direction has these two in one packet.

At the moment the firmware of the shelly weather station is publishing the rain fall in mm since the station was setup the first time. I managed that with some calculations for rain in 1h and also rain in 24h. But I think that can also be done in an openHAB rule.

here are some bugs:

the rest is looking good so far, I hav added an item to all channels and will have a look if the values are also correct. Nice job!

addendum:

following items are not getting values:

  • Pressure
  • Device Firmware
  • Dew Point
  • Illumination
  • Precipitation
  • UV Index
  • Wind Speed

If you like to have a look into my mqtt script:

cheers

Andreas

Shelly Plus Plug UK no longer can be turned off and on from OH after firmware upgrade from 1.4.4- to 1.7.1. I had recently upgraded to openHAB 4.3.8 before the firmware upgrade and all Shelly devices were working without issue then. I can turn off/on the Shelly Plus Plug UK from the app and from its own HTTP interface, and openHAB will reflect the W, kWh and relay state in my items, but the actual turning off and on of the relay no longer works. I use password authentication on all my Shelly devices.

I’ve reset the device and reconfigured it manually, hoping to eliminate anything left over from the old firmware, but to no avail. I’ve disabled/re-enabled the thing, stopped and restarted the Shelly binding bundle, to no effect.

I turned on TRACE and then DEBUG on the binding and saw messages about the device including “Unable to process Rpc message (Update for invalid relay index)” but I don’t know enough to say it’s relevant. There was also a “API value null was mapped to UNKNOWN” message. There were also reports of WebSockets being successfully created.

I’ve searched github and here trying to find matches for these circumstances but have not spotted any. Any advice is appreciated.

Anyone else unable to update Shelly firmware via ShellyManager proxy in OpenHAB?
Devices and openHAB both have internet access right now, but I want to block the Shelly’s from the internet if updates can go through openHAB reliably.

openHAB 5.0.3, but I have this issue for as long as I can remember.
372 │ Active │ 80 │ 5.0.2.202509231052 │ openHAB Add-ons :: Bundles :: Shelly Binding

openHAB and Shelly’s are on a different vlan, firewall rules and UDP broadcast relay (IP Multicast 224.0.1.187, port 5683) are set up. Autodiscovery works fine, so I don’t think the firewall is the issue here.

Firmware Update

---

Updating device Kookplaat 1 (shelly:shellypmmini:E4B063E12304) with version prod, connection type=local

Update url: http://10.80.1.63/ota?url=http://10.40.0.10:8080/shelly/manager/ota%3FdeviceType%3DS3PM-001PCEU16%26version%3Dprod

Wait 1-2 minutes, then check device UI at [10.80.1.63](http://10.80.1.63), section Firmware.

Do not power-off or restart device while updating the firmware!

Log:

2025-11-29 11:39:11.791 [INFO ] [nternal.manager.ShellyManagerOtaPage] - shellypmmini-e4b063e12304: Firmware update initiated, device returned status Update initiated
2025-11-29 11:39:11.804 [INFO ] [nternal.manager.ShellyManagerOtaPage] - ShellyManager: Update firmware (deviceType=, version=, URL=)
2025-11-29 11:39:11.804 [INFO ] [y.internal.manager.ShellyManagerPage] - ShellyManager: No firmware files found for device type 
2025-11-29 11:39:11.804 [WARN ] [nternal.manager.ShellyManagerOtaPage] - ShellyManager: Unable to find firmware for device type , version= (URL=)
2025-11-29 11:39:20.493 [INFO ] [y.internal.handler.ShellyBaseHandler] - shellypmmini-e4b063e12304: INFO: New firmware available: current version: 1.7.0-, new version: 1.7.1

1 Like

Further investigation shows there might be a problem with the setting of defaultUserId in the binding’s configuration when Plus/Pro devices are being used, where the value is not admin, because there are HTTP 401 codes reported in the binding’s DEBUG log when I try to change the relay state from openHAB. I have a number of Shelly 1 devices that use a common defaultUserId and defaultPassword with no problem. I have the one shellyplusplug and it claims to use the defaultUserId at one stage, and I can get status updates in the binding.

2025-11-29 12:23:55.295 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellypluspluguk-ffffffffffff: Using default userId xxxxxx from binding config
2025-11-29 12:23:55.298 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellypluspluguk-ffffffffffff: Using default password from bindingConfig (userId=xxxxxx)

but later when I try to change the relay state:

2025-11-29 12:23:55.507 [TRACE] [shelly.internal.api.ShellyHttpClient] - shellypluspluguk-ffffffffffff: HTTP POST http://shl.pls.plg.ip/rpc
Accept-Encoding: gzip
User-Agent: Jetty/9.4.54.v20240208
Authorization: Digest username="admin", realm="shellypluspluguk-ffffffffffff", uri="/rpc", nonce="1764419035", cnonce="bda3e8f", nc="00000001", qop="auth",response="db68bc7bdcbcc1c958dbffff75c5d6cd97ef54628f08bf5852c64fff3b07246b8", algorithm="SHA-256", 
Content-Type: application/json; charset=UTF-8


{"id":1754638223,"src":"openhab-my.oh.svr.ip","method":"Shelly.GetStatus"}
2025-11-29 12:23:55.517 [TRACE] [helly.internal.api2.Shelly2RpcSocket] - Table Lamp: Inbound Rpc message: {"id":513782364,"src":"shellypluspluguk-ffffffffffff","dst":"openhab-my.oh.svr.ip","error":{"code":401,"message":"{\"auth_type\": \"digest\", \"nonce\": 1764419035, \"nc\": 1, \"realm\": \"shellypluspluguk-ffffffffffff\", \"algorithm\": \"SHA-256\"}"}}
2025-11-29 12:23:55.525 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellypluspluguk-ffffffffffff: NotifyStatus update received: {"id":513782364,"src":"shellypluspluguk-ffffffffffff","dst":"openhab-my.oh.svr.ip","error":{"code":401,"message":"{\"auth_type\": \"digest\", \"nonce\": 1764419035, \"nc\": 1, \"realm\": \"shellypluspluguk-ffffffffffff\", \"algorithm\": \"SHA-256\"}"}}

When trying to change the relay state I get 401 codes, which might suggest a mixing of admin and my different defaultUserId. Setting userId="admin" for the shellyplusplug thing does not remove the 401 errors, and it’s not advertised as being a valid property for that thing type anyway.

Are there other users of the 4.3.8 version of the binding with defaultUserId set in the binding configuration to a non-admin value, and using Plus/Pro devices with no issues?

After upgrading from 5.0.2.202511091248 to 5.0.2.202511100759 the websocket error for shellypmmini is back. All other Shelly’s work as expected.

==> /var/log/openhab/openhab.log <==
2025-11-30 11:16:55.759 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellypmminig3-e4b063e1a400: NotifyStatus update received: {"src":"shellypmminig3-e4b063e1a400","dst":"openhab-10.40.0.10","method":"NotifyStatus","params":{"ts":1.76449781377E9,"pm1:0":{"apower":123.6}}}
2025-11-30 11:16:55.759 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellypmminig3-e4b063e1a400: Channel device#heartBeat updated with 2025-11-30T11:16:55.000+0100 (type class org.openhab.core.library.types.DateTimeType).

==> /var/log/openhab/events.log <==
2025-11-30 11:16:55.759 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ShellyPMWerkplekBarDeviceHeartBeat' changed from 2025-11-30T11:16:19.000+0100 to 2025-11-30T11:16:55.000+0100

==> /var/log/openhab/openhab.log <==
2025-11-30 11:16:55.759 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - WebSocket error
java.lang.IndexOutOfBoundsException: Index 10 out of bounds for length 1
        at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:100) ~[?:?]
        at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106) ~[?:?]
        at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302) ~[?:?]
        at java.util.Objects.checkIndex(Objects.java:385) ~[?:?]
        at java.util.ArrayList.get(ArrayList.java:427) ~[?:?]
        at org.openhab.binding.shelly.internal.api2.Shelly2ApiClient.updateRelayStatus(Shelly2ApiClient.java:322) ~[?:?]
        at org.openhab.binding.shelly.internal.api2.Shelly2ApiClient.fillDeviceStatus(Shelly2ApiClient.java:240) ~[?:?]
        at org.openhab.binding.shelly.internal.api2.Shelly2ApiRpc.onNotifyStatus(Shelly2ApiRpc.java:663) ~[?:?]
        at org.openhab.binding.shelly.internal.api2.Shelly2RpcSocket.onText(Shelly2RpcSocket.java:251) ~[?:?]
        at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:580) ~[?:?]
        at org.eclipse.jetty.websocket.common.events.annotated.CallableMethod.call(CallableMethod.java:70) ~[?:?]
        at org.eclipse.jetty.websocket.common.events.annotated.OptionalSessionCallableMethod.call(OptionalSessionCallableMethod.java:68) ~[?:?]
        at org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver.onTextMessage(JettyAnnotatedEventDriver.java:301) ~[?:?]
        at org.eclipse.jetty.websocket.common.message.SimpleTextMessage.messageComplete(SimpleTextMessage.java:69) ~[?:?]
        at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.appendMessage(AbstractEventDriver.java:67) ~[?:?]
        at org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver.onTextFrame(JettyAnnotatedEventDriver.java:287) ~[?:?]
        at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.incomingFrame(AbstractEventDriver.java:152) ~[?:?]
        at org.eclipse.jetty.websocket.common.WebSocketSession.incomingFrame(WebSocketSession.java:326) ~[?:?]
        at org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame(ExtensionStack.java:202) ~[?:?]
        at org.eclipse.jetty.websocket.common.Parser.notifyFrame(Parser.java:225) ~[?:?]
        at org.eclipse.jetty.websocket.common.Parser.parseSingleFrame(Parser.java:259) ~[?:?]
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:459) ~[?:?]
        at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:440) ~[?:?]
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) ~[?:?]
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) ~[?:?]
        at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) ~[?:?]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) ~[?:?]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) ~[?:?]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) ~[?:?]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) ~[?:?]
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) ~[?:?]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) ~[?:?]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) ~[?:?]
        at java.lang.Thread.run(Thread.java:1583) [?:?]
2025-11-30 11:16:55.761 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellypmminig3-e4b063e1a400: Closing Rpc API (socket is connected, discovery=false)

==> /var/log/openhab/events.log <==
2025-11-30 11:16:55.761 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellypmmini:E4B063E1A400' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unexpected error: WebSocket error

==> /var/log/openhab/openhab.log <==
2025-11-30 11:16:55.762 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellypmminig3-e4b063e1a400: WebSocket connection closed, status = 1006/Disconnected
2025-11-30 11:16:55.762 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellypmminig3-e4b063e1a400: Closing Rpc API (socket is disconnected, discovery=false)

5.0.2.202511091248:

2025-11-30 11:27:57.160 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellypmmini-e4b063e1a400: NotifyStatus update received: {"src":"shellypmminig3-e4b063e1a400","dst":"openhab-10.40.0.10","method":"NotifyStatus","params":{"ts":1.76449847511E9,"pm1:0":{"apower":108.0,"current":0.529}}}
2025-11-30 11:27:57.160 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellypmmini-e4b063e1a400: Channel device#heartBeat updated with 2025-11-30T11:27:57.000+0100 (type class org.openhab.core.library.types.DateTimeType).
2025-11-30 11:27:57.161 [DEBUG] [helly.internal.api2.Shelly2RpcSocket] - Shelly PM Werkplek bar: Unable to process Rpc message (Update for invalid relay index): {"src":"shellypmminig3-e4b063e1a400","dst":"openhab-10.40.0.10","method":"NotifyStatus","params":{"ts":1764498475.11,"pm1:0":{"apower":108.0,"current":0.529}}}

The proxy mode is not supported for Plus/Pro devices. Allterco doen‘t provide a public firmware repo, which could be used to buid the proxy mode

2 Likes

All my devices, incl. Gen1, Plus and Pro are password protected. defaultUserId is not relevant for Gen2-4, because AFAIK you can‘t configure a user id, it‘s always admin. For Gen1 the binding uses default id+password, for gen2-4 the password only and user id is admin

@alaub81 @stfn82

check updated DEV build

  • changes for WS90
  • change for PM status updates

usually the icons are derived from semantic tags. I included those in the channel definition.

let check this later

It’s Number:Volume, which is by default m3. I added the code to update the channel and specified mm. Check after first channel update.

fixed

fixed

channel update for pressure, uv index, wind speed, gust speed were added

Device Firmware has to be reported by the device, some BLU devices need up to 6h, some even don’t report the number

Dew Point: Check device debug if the value is reported

windSpeed / gustSpeed: Check device debug if the value is reported

Hi @markus7017,

thanks a lot! It is working much better, but still having issues with wind speed and gust, dew point.

openhab.log (977.9 KB)

In this test setup, there is only one plug s installed and the weather station itself. So hav a look at the log file. Dew Point values are in the log, but not wind or gust speed. I know from my mqtt script, that the weather station is publishing these two values nearly every 30s, or less.

I think, the illumination channel can be deleted, because the WS90 is not delivering this only the lux values.

If you need more, tell me.

cheers

Andreas

Hi Markus, I only see an updated DEV build for 5.1, not 5.0.

@markus7017 we need a dev build for openHAB 5.0.3. I just updated because of the amazon echo bug fix and now all my shelly are offline.

Thanks for the reply. Quick question: Do you use defaultUserId set in your binding config and if so, is it a value other than admin? Thanks very much!

DEV build for 5.0.x and 5.1.x have been updated

I found issues with dew point, and wind speeds; illumination channel will no longer created
please check

Thank you! I think now we have it with the weather station. Only small one is, that perception is still m3 / volume and not mm / length . Here is a screenshot how I use it, perhaps you can set this as standard for the channel:

Also at the moment Wind and Gust Direction Channels are missing.

You updated 5.0.2 - are we able to use it under 5.0.3 openHAB version? or should it be also 5.0.3-snapshot or something like that?

perception should be fixed, windDirection and gustDirection have been added
I also updated the README.md to include WS90, @alaub81 could you please verify that all channels are included, correctly documented and show up correctly (incl. units + values)

5.0.2 should also work on 5.0.3

5.0.2.202512041532 has fixed my websocket issue with the pmmini’s. Thanks again!

1 Like

@alaub81 Die you saw the update?