Shelly Binding

please provide a log of the thing initialization

I am still scratching my head on this. I have the org.openhab.binding.shelly-3.3.0-gen2.jar file placed in my /usr/share/openhab/addons/ folder and it is not apprearing in my console bundle:list. @markus7017 any thoughts?

Did you followed the steps in READMEbeta and installed the Californium jars? Is there something in the log?

Find the logs below.
Here is the same behaviour. The thing needs approx 1,5minutes to initialize (see timestamp):

PRESSED DISCOVER BUTTON:

2022-06-07 09:03:00.200 [DEBUG] [discovery.ShellyDiscoveryParticipant] - discovered shellyplusi4-083af200b468
2022-06-07 09:03:00.202 [DEBUG] [discovery.ShellyDiscoveryParticipant] - shellyplusi4-083af200b468: Shelly device discovered: IP-Adress=10.0.100.112, type=shellyplusi4
2022-06-07 09:03:00.204 [DEBUG] [discovery.ShellyDiscoveryParticipant] - shellyplusi4-083af200b468: Generation 2 device detected: ShellyPlusI4-083AF200B468
2022-06-07 09:03:00.329 [DEBUG] [discovery.ShellyDiscoveryParticipant] - shellyplusi4-083af200b468: Shelly settings :
2022-06-07 09:03:00.331 [DEBUG] [discovery.ShellyDiscoveryParticipant] - shellyplusi4-083af200b468: Adding Shelly , UID=shelly:shellyplusi4:083af200b468
2022-06-07 09:03:00.339 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'shelly:shellyplusi4:083af200b468' to inbox.


PRESSED THE ADD BUTTON
2022-06-07 09:03:08.551 [DEBUG] [shelly.internal.ShellyHandlerFactory] - shellyplusi4-083af200b468 - 10.0.100.112: Create new thing of type shelly:shellyplusi4 using ShellyRelayHandler
2022-06-07 09:03:08.619 [DEBUG] [shelly.internal.ShellyHandlerFactory] - Thing handler for uid shelly:shellyplusi4:083af200b468 added, total things = 12


2022-06-07 09:04:45.900 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Using userId admin from bindingConfig
2022-06-07 09:04:45.903 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Device config: IP address=10.0.100.112, HTTP user/password=admin/***, update interval=60
2022-06-07 09:04:45.905 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Configured Events: Button: false, Switch (on/off): true, Push: true, Roller: true, Sensor: true, CoIoT: false, Enable AutoCoIoT: true
2022-06-07 09:04:45.907 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Start initializing thing shellyplusi4-083af200b468 - 10.0.100.112, type shellyplusi4, ip address 10.0.100.112, CoIoT: false
2022-06-07 09:04:46.011 [DEBUG] [g.shelly.internal.api2.Shelly2RpcApi] - shellyplusi4-083af200b468: WebSocket connected successful
2022-06-07 09:04:46.019 [DEBUG] [helly.internal.api2.Shelly2WebSocket] - WebSocket Connection closed: 1006 - Disconnected
2022-06-07 09:04:46.047 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Initializing device shellyplusi4-083af200b468, type SNSN-0024X, Hardware: Rev: , batch ; Firmware: v0.10.2 / 20220531-140629
2022-06-07 09:04:46.049 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Shelly settings info for shellyplusi4-083af200b468:
2022-06-07 09:04:46.051 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Device hasRelays:false (numRelays=0),isRoller:false (numRoller=0),isDimmer:false,numMeter=0,isEMeter:true),isSensor:false,isDS:false,hasBattery:false,isSense:false,isMotion:false,isLight:false,isBulb:false,isDuo:false,isRGBW2:false,inColor:false,alwaysOn:true, ,updatePeriod:70sec
2022-06-07 09:04:46.110 [DEBUG] [g.shelly.internal.api2.Shelly2RpcApi] - shellyplusi4-083af200b468: NotifyStatus update received: {"params":{"ble":null,"cloud":{"connected":false},"mqtt":{"connected":false},"sys":{"mac":"083AF200B468","restart_required":false,"time":"09:04","unixtime":1654585486,"uptime":73221,"ram_size":255496,"ram_free":154976,"fs_size":458752,"fs_free":225280,"cfg_rev":10,"available_updates":null},"wifi":{"sta_ip":"10.0.100.112","status":"got ip","ssid":"ben.net","rssi":-61},"input:0":{"id":0,"state":false},"input:1":{"id":1,"state":false},"input:2":{"id":2,"state":false},"input:3":{"id":3,"state":false}},"result":{"ble":{},"cloud":{"connected":false},"mqtt":{"connected":false},"sys":{"mac":"083AF200B468","restart_required":false,"time":"09:04","unixtime":1654585486,"uptime":73221,"ram_size":255496,"ram_free":154976,"fs_size":458752,"fs_free":225280,"cfg_rev":10,"available_updates":{}},"wifi":{"sta_ip":"10.0.100.112","status":"got ip","ssid":"ben.net","rssi":-61},"input:0":{"id":0,"state":false},"input:1":{"id":1,"state":false},"input:2":{"id":2,"state":false},"input:3":{"id":3,"state":false}},"id":113863042,"src":"shellyplusi4-083af200b468","dst":"shellyplusi4-083af200b468"}
2022-06-07 09:04:46.114 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel device#heartBeat updated with 2022-06-07T09:04:46.000+0200 (type class org.openhab.core.library.types.DateTimeType).
2022-06-07 09:04:46.126 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Updating channel definitions, 3 channels
2022-06-07 09:04:46.129 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Adding channel device#internalTemp
2022-06-07 09:04:46.131 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Adding channel device#updateAvailable
2022-06-07 09:04:46.133 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Adding channel device#heartBeat
2022-06-07 09:04:46.144 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel definitions updated
2022-06-07 09:04:46.148 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel device#uptime updated with 73221 s (type class org.openhab.core.library.types.QuantityType).
2022-06-07 09:04:46.151 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel device#wifiSignal updated with 3 (type class org.openhab.core.library.types.DecimalType).
2022-06-07 09:04:46.156 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel device#internalTemp updated with 0 °C (type class org.openhab.core.library.types.QuantityType).
2022-06-07 09:04:46.160 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel device#updateAvailable updated with OFF (type class org.openhab.core.library.types.OnOffType).
2022-06-07 09:04:46.162 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Thing successfully initialized.
2022-06-07 09:04:46.167 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel device#heartBeat updated with 2022-06-07T09:04:46.000+0200 (type class org.openhab.core.library.types.DateTimeType).
2022-06-07 09:04:46.169 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Update status job started, interval=20*3=60sec.
2022-06-07 09:04:46.593 [DEBUG] [lly.internal.api1.Shelly1CoapHandler] - shelly1-483fdaa1a700: CoIoT Message from /10.0.100.100:5683 (MID=21771): {"G":[[0,9103,0],[0,1101,0],[0,2101,1],[0,2102,""],[0,2103,177]]}
2022-06-07 09:04:46.596 [DEBUG] [lly.internal.api1.Shelly1CoapHandler] - shelly1-483fdaa1a700: Serial 13058 was already processed, ignore update
2022-06-07 09:04:47.965 [DEBUG] [lly.internal.api1.Shelly1CoapHandler] - shelly1-483fdaa23555: CoIoT Message from /10.0.100.101:5683 (MID=23120): {"G":[[0,9103,0],[0,1101,0],[0,2101,0],[0,2102,""],[0,2103,68]]}
2022-06-07 09:04:47.968 [DEBUG] [lly.internal.api1.Shelly1CoapHandler] - shelly1-483fdaa23555: Serial 52992 was already processed, ignore update
2022-06-07 09:04:48.277 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel device#heartBeat updated with 2022-06-07T09:04:48.000+0200 (type class org.openhab.core.library.types.DateTimeType).
2022-06-07 09:04:48.284 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel device#uptime updated with 73221 s (type class org.openhab.core.library.types.QuantityType).
2022-06-07 09:04:48.287 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel device#wifiSignal updated with 3 (type class org.openhab.core.library.types.DecimalType).
2022-06-07 09:04:48.291 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel device#internalTemp updated with 0 °C (type class org.openhab.core.library.types.QuantityType).
2022-06-07 09:04:48.296 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel device#uptime updated with 73221 s (type class org.openhab.core.library.types.QuantityType).
2022-06-07 09:04:48.299 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel device#wifiSignal updated with 3 (type class org.openhab.core.library.types.DecimalType).
2022-06-07 09:04:48.304 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel device#internalTemp updated with 0 °C (type class org.openhab.core.library.types.QuantityType).
2022-06-07 09:04:48.310 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Updating channel definitions, 2 channels
2022-06-07 09:04:48.312 [DEBUG] [g.shelly.internal.api2.Shelly2RpcApi] - shellyplusi4-083af200b468: NotifyStatus update received: {"params":{"ble":null,"cloud":{"connected":false},"mqtt":{"connected":false},"sys":{"mac":"083AF200B468","restart_required":false,"time":"09:04","unixtime":1654585488,"uptime":73224,"ram_size":255488,"ram_free":155872,"fs_size":458752,"fs_free":225280,"cfg_rev":10,"available_updates":null},"wifi":{"sta_ip":"10.0.100.112","status":"got ip","ssid":"ben.net","rssi":-61},"input:0":{"id":0,"state":false},"input:1":{"id":1,"state":false},"input:2":{"id":2,"state":false},"input:3":{"id":3,"state":false}},"result":{"ble":{},"cloud":{"connected":false},"mqtt":{"connected":false},"sys":{"mac":"083AF200B468","restart_required":false,"time":"09:04","unixtime":1654585488,"uptime":73224,"ram_size":255488,"ram_free":155872,"fs_size":458752,"fs_free":225280,"cfg_rev":10,"available_updates":{}},"wifi":{"sta_ip":"10.0.100.112","status":"got ip","ssid":"ben.net","rssi":-61},"input:0":{"id":0,"state":false},"input:1":{"id":1,"state":false},"input:2":{"id":2,"state":false},"input:3":{"id":3,"state":false}},"id":-2055801166,"src":"shellyplusi4-083af200b468","dst":"shellyplusi4-083af200b468"}
2022-06-07 09:04:48.313 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Adding channel status1#input
2022-06-07 09:04:48.315 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Adding channel status1#button
2022-06-07 09:04:48.334 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel definitions updated
2022-06-07 09:04:48.337 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel status1#input updated with OFF (type class org.openhab.core.library.types.OnOffType).
2022-06-07 09:04:48.341 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Updating channel definitions, 2 channels
2022-06-07 09:04:48.343 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Adding channel status2#input
2022-06-07 09:04:48.345 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Adding channel status2#button
2022-06-07 09:04:48.359 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel definitions updated
2022-06-07 09:04:48.368 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel status2#input updated with OFF (type class org.openhab.core.library.types.OnOffType).
2022-06-07 09:04:48.372 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Updating channel definitions, 2 channels
2022-06-07 09:04:48.374 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Adding channel status3#input
2022-06-07 09:04:48.375 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Adding channel status3#button
2022-06-07 09:04:48.573 [DEBUG] [.internal.handler.ShellyRelayHandler] - shellyswitch25-10521c074d71: Update roller position: control=0, position=100
2022-06-07 09:04:48.707 [DEBUG] [.internal.handler.ShellyRelayHandler] - shellyswitch25-3494546a01f7: Update roller position: control=0, position=100
2022-06-07 09:04:48.718 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel definitions updated
2022-06-07 09:04:48.723 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel status3#input updated with OFF (type class org.openhab.core.library.types.OnOffType).
2022-06-07 09:04:48.729 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Updating channel definitions, 2 channels
2022-06-07 09:04:48.732 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Adding channel status4#input
2022-06-07 09:04:48.734 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Adding channel status4#button
2022-06-07 09:04:48.746 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel definitions updated
2022-06-07 09:04:48.749 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel status4#input updated with OFF (type class org.openhab.core.library.types.OnOffType).

Ich see “WebSocket connected successful” followed by an “WebSocket Connection closed: 1006 - Disconnected”. Strange, but I also see “NotifyStatus update received” so stag is working.

I see that channels are created, which indicates that message data is processed.
“Adding channel status1#input”, “Adding channel status1#button”; same for status2#
, status3, status4

What’s with the rest of the log?

Please switch binding to TRACE mode and provide full log.

Hello markus,

thx for your answer. I unterstood [met] so, that his 4PM PRO working flawlessly with authentication with the gen2 DEV Binding.

Oliver

Find the TRACE log attached.
openhab.log (204.1 KB)

No, auth is working for Gen1 4Pro, but not for Gen2 Pro 4PM
Gen2 auth support is on the list

OK, fine.

I see no unusual notes in the log, nothing from a DEBUG. I did not uninstall my devices but otherwise followed the READMEbeta instructions. The Californium bundles are running, they appear in the bundle:list but after installing either the gen2 or SNAPSHOT, neither appears. Odd

@markus7017

Installed brand new openhab on RPI and only added the i4plus.
Same behaviour. There are no status updates in realtime.

Something in my log i posted above?

@markus7017

Found out that shelly1 GEN1 has the same problem. No updates, when i push the button in the shelly itself.

I uninstalled beta version und reverted to stable and now all status changes are instantly in event.log.
So i am assuming that there is no problem with my openhab or network at all. It has to do with the binding GEN2

Hi @markus7017. What’s your estimate on when gen2 device support will roll into the stable bindings? Thx

1 Like

I’m chasing a bug with the WebSocket events, hopefully this is done shortly, then authentication and then it should be done

@s4ndst0rm @DaveL @igi

I updated the gen2 build to fix the WebSocket notifications by the device. No they work as expected. Once initialized the device will send an update on updates values (near realtime) and once per minute. Those will be processed by the binding to update the channels.

Please give it a try. You should see NotifyStatus messages in the DEBUG log and proper channel updates

1 Like

@markus7017 Thanks for all the valuable work that you’re doing.
One question
 will these updates be integrated into the older Shelly Binding in the near future? or will we still have to delete all devices and start over from scratch with the new binding?

Thanks!

the gen2 version also supports gen1
when done this will become a PR
which then gets merged into the official distro

you can delete the things and rediscover, OH will restore channel/items linkage, but it also retrieves the thing/channel information of the updated version. This is important if there is a new channel or changed definition. In many cases it will run with the older definition, but could cause side effects.

hello,
I have this error while loading the system:


what can be done?

Did you installed the Californium jars, check READMEbeta.md

@markus7017

Great work - my Shelly Plus 1PM is working now.

However I am having trouble with my Shelly 2.5 in Rollershutter mode since I updated. I can’t control the outputs anymore.

With binding version 3.3.0 those channels don’t appear in the thing in openHAB:
roller#control
roller#state
roller#rollerFav

Am I doing something wrong?

Thanks for your efforts, we really appreciate.