Shelly Binding

you need to upgrade to the DEV biild or OH4

3.4.5-DEV Gen1/Plus/Pro | 4.1.0-DEV Gen1/Plus/Pro | README | READMEbeta
Avdanced Users - Shelly Manager - Bugs/Features - API Doc | Firmware Index - Firmware Archive

Note: The DEV build is always newer than the version in the official Distro or Milestone builds

@markus7017

I’d like to statically configure the outgoing websocket configuration on the device. What would I have to enter? Is there a config flag to indicate that this has been set so it can be skipped during initialization?

grafik


My three smoke detectors still all show pending since my last post 14 days ago and thus will not report a fire alarm to openHAB.
At least one device properly reports the battery value:

2023-08-16 03:39:14.568 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Rauchmelder1_Batterie' changed from 92 to 91
2023-08-16 03:39:14.569 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Rauchmelder1_Update' changed from 2023-08-15T03:47:20.362436733+0200 to 2023-08-16T03:39:14.566876173+0200
2023-08-16 03:39:14.905 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Rauchmelder1_Update' changed from 2023-08-16T03:39:14.566876173+0200 to 2023-08-16T03:39:14.903397916+0200
2023-08-17 03:31:04.060 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Rauchmelder1_Batterie' changed from 91 to 92
2023-08-17 03:31:04.061 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Rauchmelder1_Update' changed from 2023-08-16T03:39:14.903397916+0200 to 2023-08-17T03:31:04.059046414+0200
2023-08-17 03:31:04.420 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Rauchmelder1_Update' changed from 2023-08-17T03:31:04.059046414+0200 to 2023-08-17T03:31:04.418979948+0200
2023-08-18 03:22:53.288 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Rauchmelder1_Update' changed from 2023-08-17T03:31:04.418979948+0200 to 2023-08-18T03:22:53.285831905+0200
2023-08-18 03:22:53.626 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Rauchmelder1_Update' changed from 2023-08-18T03:22:53.285831905+0200 to 2023-08-18T03:22:53.623522626+0200
2023-08-19 03:14:53.260 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Rauchmelder1_Update' changed from 2023-08-18T03:22:53.623522626+0200 to 2023-08-19T03:14:53.258244661+0200
2023-08-20 03:06:32.104 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Rauchmelder1_Update' changed from 2023-08-19T03:14:53.258244661+0200 to 2023-08-20T03:06:32.102850234+0200

Is it somehow possible to skip the initialization process and manually create the channels?

Thank you! Yesterday I update my openhab to 4.0.2 and put my smoke plus to “setup mode” and now I have data in my DB.

as i wrote 16 days ago i observed my shelly smoke sensors.

i use 4 shellyplussmoke sensors that sometimes take very long from one alive signal to the next.

one of them sent last signal on 04.08. and just now, 25 days later, is see the next message in the log:

2023-08-30 15:27:29.471 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Status update triggered thing initialization
2023-08-30 15:27:29.471 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Start initializing for thing HWR, type shellyplussmoke, IP address 172.20.93.4, Gen2: true, CoIoT: false
2023-08-30 15:27:29.909 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplussmoke-80646fd0af5c: Connect Rpc Socket (discovery = false)
2023-08-30 15:27:29.910 [DEBUG] [helly.internal.api2.Shelly2RpcSocket] - HWR: Connect WebSocket, URI=ws://172.20.93.4/rpc
2023-08-30 15:27:29.978 [DEBUG] [helly.internal.api2.Shelly2RpcSocket] - HWR: WebSocket connected /172.20.254.3:47282<-/172.20.93.4:80, Idle Timeout=2147483647
2023-08-30 15:27:30.042 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplussmoke-80646fd0af5c: A battery device was detected without correct callback, fix it
2023-08-30 15:27:30.302 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Event erzeugt: UNDEFINED
2023-08-30 15:27:30.305 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Updating channel definitions, 5 channels
2023-08-30 15:27:30.306 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Adding channel sensors#smoke
2023-08-30 15:27:30.307 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Adding channel sensors#mute
2023-08-30 15:27:30.309 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Adding channel battery#batteryLevel
2023-08-30 15:27:30.310 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Adding channel battery#lowBattery
2023-08-30 15:27:30.311 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Adding channel sensors#lastUpdate
2023-08-30 15:27:30.316 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Channel definitions updated
2023-08-30 15:27:30.320 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Channel sensors#smoke updated with OFF (type class org.openhab.core.library.types.OnOffType).
2023-08-30 15:27:30.322 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Channel battery#batteryLevel updated with 97 % (type class org.openhab.core.library.types.QuantityType).
2023-08-30 15:27:30.325 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Channel battery#lowBattery updated with OFF (type class org.openhab.core.library.types.OnOffType).
2023-08-30 15:27:30.330 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Channel sensors#lastUpdate updated with 2023-08-30T15:27:30.000+0200 (type class org.openhab.core.library.types.DateTimeType).
2023-08-30 15:27:30.334 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplussmoke-80646fd0af5c: BLU Gateway support is disabled for this device
2023-08-30 15:27:30.364 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplussmoke-80646fd0af5c: NotifyStatus update received: {"id":1147485915,"src":"shellyplussmoke-80646fd0af5c","dst":"shellyplussmoke-80646fd0af5c","params":{"ble":null,"cloud":{"connected":false},"mqtt":{"connected":false},"sys":{"mac":"80646FD0AF5C","restart_required":true,"uptime":2,"ram_size":250228,"ram_free":144112,"fs_size":458752,"fs_free":118784,"cfg_rev":11,"available_updates":null,"webhook_rev":0,"wakeup_reason":{"boot":"poweron","cause":"undefined"},"wakeup_period":86400},"wifi":{"sta_ip":"172.20.93.4","status":"got ip","ssid":"Kuehnel","rssi":-62},"smoke:0":{"id":0,"alarm":false,"mute":false},"devicepower:0":{"id":0,"battery":{"V":2.99,"percent":97.0}}},"result":{"ble":{},"cloud":{"connected":false},"mqtt":{"connected":false},"sys":{"mac":"80646FD0AF5C","restart_required":true,"uptime":2,"ram_size":250228,"ram_free":144112,"fs_size":458752,"fs_free":118784,"cfg_rev":11,"available_updates":{},"webhook_rev":0,"wakeup_reason":{"boot":"poweron","cause":"undefined"},"wakeup_period":86400},"wifi":{"sta_ip":"172.20.93.4","status":"got ip","ssid":"Kuehnel","rssi":-62},"smoke:0":{"id":0,"alarm":false,"mute":false},"devicepower:0":{"id":0,"battery":{"V":2.99,"percent":97.0}}}}
2023-08-30 15:27:30.366 [WARN ] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplussmoke-80646fd0af5c: Device requires restart to activate changes
2023-08-30 15:27:30.393 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplussmoke-80646fd0af5c: Script oh-blu-scanner.js was not installed, device doesn't support scripts
2023-08-30 15:27:30.448 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Updating channel definitions, 2 channels
2023-08-30 15:27:30.450 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Adding channel device#updateAvailable
2023-08-30 15:27:30.450 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Adding channel device#heartBeat
2023-08-30 15:27:30.456 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Channel definitions updated
2023-08-30 15:27:30.458 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Channel device#wifiSignal updated with 3 (type class org.openhab.core.library.types.DecimalType).
2023-08-30 15:27:30.459 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Initializing device shellyplussmoke-80646fd0af5c, type SNSN-0031Z, Hardware: Rev: , batch ; Firmware: v0.14.3 / 20230420-115805
2023-08-30 15:27:30.460 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Shelly settings info for shellyplussmoke-80646fd0af5c: {"ble":{"enable":true},"cloud":{"enable":false,"server":"iot.shelly.cloud:6012/jrpc"},"mqtt":{"enable":false,"rpc_ntf":"true","status_ntf":"false"},"sys":{"cfg_rev":10,"device":{"mac":"80646FD0AF5C","fw_id":"20230420-115805/0.14.3-gd976dc3","discoverable":true},"location":{"tz":"Europe/Berlin","lat":49.86571,"lon":8.62604},"sntp":{"server":"172.20.0.1"},"sleep":{"wakeup_period":86400},"debug":{"mqtt":{"enable":false},"websocket":{"enable":false},"udp":null},"ui_data":null,"rpc_udp":{}},"wifi":{"ap":{"enable":true,"ssid":"ShellyPlusSmoke-80646FD0AF5C","is_open":true},"sta":{"ssid":"Kuehnel","is_open":false,"enable":true,"ipv4mode":"static","ip":"172.20.93.4","netmask":"255.255.0.0","gw":"172.20.0.1","nameserver":"172.20.0.1"},"sta1":{"is_open":true,"enable":false,"ipv4mode":"dhcp"},"roam":{"rssi_thr":-80,"interval":60}},"smoke:0":{"id":0}}
2023-08-30 15:27:30.461 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Device hasRelays:false (numRelays=0),isRoller:false (numRoller=0),isDimmer:false,numMeter=0,isEMeter:true), ext. Switch Add-On: n/a,isSensor:true,isDS:false,hasBattery:true (low battery threshold=20%),isSense:false,isMotion:false,isLight:false,isBulb:false,isDuo:false,isRGBW2:false,inColor:false, BLU Gateway support: false,alwaysOn:86460, updatePeriod:falsesec
2023-08-30 15:27:30.462 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplussmoke-80646fd0af5c: Thing successfully initialized.
2023-08-30 15:27:30.664 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplussmoke-80646fd0af5c: BLU Gateway support is disabled for this device
2023-08-30 15:27:30.690 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplussmoke-80646fd0af5c: NotifyStatus update received: {"id":2123257578,"src":"shellyplussmoke-80646fd0af5c","dst":"shellyplussmoke-80646fd0af5c","params":{"ble":null,"cloud":{"connected":false},"mqtt":{"connected":false},"sys":{"mac":"80646FD0AF5C","restart_required":true,"uptime":2,"ram_size":250200,"ram_free":142620,"fs_size":458752,"fs_free":118784,"cfg_rev":11,"available_updates":null,"webhook_rev":0,"wakeup_reason":{"boot":"poweron","cause":"undefined"},"wakeup_period":86400},"wifi":{"sta_ip":"172.20.93.4","status":"got ip","ssid":"Kuehnel","rssi":-61},"smoke:0":{"id":0,"alarm":false,"mute":false},"devicepower:0":{"id":0,"battery":{"V":2.99,"percent":97.0}}},"result":{"ble":{},"cloud":{"connected":false},"mqtt":{"connected":false},"sys":{"mac":"80646FD0AF5C","restart_required":true,"uptime":2,"ram_size":250200,"ram_free":142620,"fs_size":458752,"fs_free":118784,"cfg_rev":11,"available_updates":{},"webhook_rev":0,"wakeup_reason":{"boot":"poweron","cause":"undefined"},"wakeup_period":86400},"wifi":{"sta_ip":"172.20.93.4","status":"got ip","ssid":"Kuehnel","rssi":-61},"smoke:0":{"id":0,"alarm":false,"mute":false},"devicepower:0":{"id":0,"battery":{"V":2.99,"percent":97.0}}}}
2023-08-30 15:27:30.691 [WARN ] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplussmoke-80646fd0af5c: Device requires restart to activate changes
2023-08-30 15:27:30.720 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplussmoke-80646fd0af5c: Script oh-blu-scanner.js was not installed, device doesn't support scripts

if helpful i would be glad to send you the complete logfile via pm

Hi,

My Shelly Smoke plus and H&T worked (at least they seemed like). But today I realized they lost connection with the server. I set the thing file a few times, and I had to put the devices in setup mode every time, and after that I could see them in the shelly manager. 2 days ago I did the same after some configuration. They looked good in shelly manager. Today I checked them and the 2 of 3 devices’ status are UNKNOWN CONFIGURATION_PENDING.
I think I had to set the devices in setup mode again, but I don’t understand why. How can I avoid this?
Maybe I will use them with mqtt…

Hi Shelly Community,

First time I’m looking at this topic and I would like to thank everyone for the effort. I’m new to the Shelly items and apologise if my questions are stupid.

I connected Shelly Plus Add-On to Shelly Plus i4 DC (FW: 1.0.0-gaec0744 … not sure if it’s Add-on fw as there is a message 0.14.0 update available).
The device has been discovered by the binding (OH 4.0.2) but no Add-On channels, like sensors, configured to the thing (i4DC’s ones are OK). However, OH Shelly Binding docs completely missing this scenario - attaching Shelly Plus Add-On to Shelly Plus i4 DC. So, my question is if this is something that could be easily added as supported binding feature? Also, how can I create manually the channels … if possible at all or this could be supported via binding only?

10x

thanks for your help, what you wrote makes a lot of sense. I’ve just updated all the shellyHT CoAP IP from mcast to the correct docker IP, and will check again in a few days if values are now being updated correctly. Maybe multicast don’t work on my network.

The binding requires Firmware version 1.8.2.
Please update both devices to latest firmware first, delete both things and redo adding the things by scanning (all ltem links will be automatically rexestablished)

I’m afraid that fw 1.8.0 isn’t available for Shelly Plus i4DC. I can only see 0.14.1, 1.0.0 and 1.0.2-beta3. I tried all of them but the result is the same - missing Add-On sensors channels.

Sorry. It is i4, not i3 what I had in my mind.
Not sure if this helps, but are you using the dev binding or the binding coming with the release?
The latest dev build can be downloaded here
Otherwise you need to wait until Markus answers to your problem.

Did you activated the addon support in the i4 device web ui, rebooted the i4 and added correctly the sensor attached to the addon in the web ui?

you should upgrade to fw 1.0 (1.8.2 is for Geb 1 devices, he‘a using a Plus device)
activate the addon in the device web ui
add sensors for the addon, also in the web ui
and make sure to use the latest binding

3.4.5-DEV Gen1/Plus/Pro | 4.1.0-DEV Gen1/Plus/Pro | README | READMEbeta
Avdanced Users - Shelly Manager - Bugs/Features - API Doc | Firmware Index - Firmware Archive

Note: The DEV build is always newer than the version in the official Distro or Milestone builds

Thanks for stepping in @markus7017. The latest dev binding is the only thing I haven’t tried.

:+1:

The thing was re-initialized after that?
If so, the debug log is needed from thing init.

Same behaviour with org.openhab.binding.shelly-4.1.0-SNAPSHOT … no Add-on channels.
So, how to get the debug log from thing init?

scroll up in this thread. It has been described many times. Or search for debug

It is described in READMEbeta. Look at the signature of Markus post in answer to your question.

But I can confirm the bug.
When Addon is connected to i4, no channels are created for the external sensors.
The same addon on Plus 1PM works without problems.

Sorry for the stupid question, I just didn’t realise that the default binding logging will have “debug log from thing init”.
4.1.0_shelly_debug.log (13.7 KB)

Looks like the binding is getting sensors data but not linking them to a channel.

2023-09-11 11:47:18.736 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplusi4-80646fcc220c: NotifyStatus update received: {"src":"shellyplusi4-80646fcc220c","dst":"shellyplusi4-80646fcc220c","method":"NotifyStatus","params":{"ts":1.69442203866E9,"temperature:101":{"id":101,"tC":25.0,"tF":77.0}}}
2023-09-11 11:47:23.706 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplusi4-80646fcc220c: NotifyStatus update received: {"src":"shellyplusi4-80646fcc220c","dst":"shellyplusi4-80646fcc220c","method":"NotifyStatus","params":{"ts":1.69442204366E9,"temperature:101":{"id":101,"tC":25.12,"tF":77.22}}}
2023-09-11 11:47:28.726 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplusi4-80646fcc220c: NotifyStatus update received: {"src":"shellyplusi4-80646fcc220c","dst":"shellyplusi4-80646fcc220c","method":"NotifyStatus","params":{"ts":1.69442204866E9,"temperature:101":{"id":101,"tC":25.25,"tF":77.45}}}
2023-09-11 11:47:33.712 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplusi4-80646fcc220c: NotifyStatus update received: {"src":"shellyplusi4-80646fcc220c","dst":"shellyplusi4-80646fcc220c","method":"NotifyStatus","params":{"ts":1.69442205366E9,"temperature:101":{"id":101,"tC":25.38,"tF":77.68}}}