Shelly Binding

I use #control.
{channel=“shelly:shelly25-roller:ThingRaffstoreWest:roller#control”, autoupdate=“false”}

The issue appears is the roller is in the open position and I try to move it up.
The position then jumps to 100 and back to 0 instantly.

here is the log:

2022-05-29 15:19:53.170 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'EG_Wohnen_RaffstoreWest' received command UP

2022-05-29 15:19:53.182 [DEBUG] [.internal.handler.ShellyRelayHandler] - shelly25-roller-thingraffstorewest: Roller command/position UP

2022-05-29 15:19:53.197 [DEBUG] [.internal.handler.ShellyRelayHandler] - shelly25-roller-thingraffstorewest: Open roller

2022-05-29 15:19:53.213 [DEBUG] [.internal.handler.ShellyRelayHandler] - shelly25-roller-thingraffstorewest: Set roller position for control channel to 100

2022-05-29 15:19:53.215 [DEBUG] [lly.internal.util.ShellyChannelCache] - shelly25-roller-thingraffstorewest: Channel roller#control updated with 100 (type class org.openhab.core.library.types.PercentType).

2022-05-29 15:19:53.218 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'EG_Wohnen_RaffstoreWest' changed from 0 to 100

2022-05-29 15:19:53.222 [DEBUG] [lly.internal.util.ShellyChannelCache] - shelly25-roller-thingraffstorewest: Channel device#heartBeat updated with 2022-05-29T15:19:53.000+0200 (type class org.openhab.core.library.types.DateTimeType).

2022-05-29 15:19:53.226 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shelly25-roller-thingraffstorewest: CoIoT Message from /192.168.1.121:5683 (MID=8836): {"G":[[0,112,1],[0,122,0],[0,113,100],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,61.89],[0,116,143.40],[0,117,0]]}

2022-05-29 15:19:53.228 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shelly25-roller-thingraffstorewest: CoIoT Sensor data {"G":[[0,112,1],[0,122,0],[0,113,100],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,61.89],[0,116,143.40],[0,117,0]]} (serial=37376)

2022-05-29 15:19:53.230 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shelly25-roller-thingraffstorewest: 10 CoAP sensor updates received

2022-05-29 15:19:53.233 [DEBUG] [lly.internal.util.ShellyChannelCache] - shelly25-roller-thingraffstorewest: Channel meter1#lastUpdate updated with 2022-05-29T15:19:53.000+0200 (type class org.openhab.core.library.types.DateTimeType).

2022-05-29 15:19:53.235 [DEBUG] [lly.internal.util.ShellyChannelCache] - shelly25-roller-thingraffstorewest: Channel meter2#lastUpdate updated with 2022-05-29T15:19:53.000+0200 (type class org.openhab.core.library.types.DateTimeType).

2022-05-29 15:19:53.237 [DEBUG] [lly.internal.util.ShellyChannelCache] - shelly25-roller-thingraffstorewest: Channel relay1#output updated with ON (type class org.openhab.core.library.types.OnOffType).

2022-05-29 15:19:53.243 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'EG_Wohnen_RaffstoreWest' changed from 100 to 0

2022-05-29 15:19:53.244 [DEBUG] [lly.internal.util.ShellyChannelCache] - shelly25-roller-thingraffstorewest: Channel roller#control updated with 0 % (type class org.openhab.core.library.types.QuantityType).

2022-05-29 15:19:53.247 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shelly25-roller-thingraffstorewest: 4 channels updated from CoIoT status, serial=37376

2022-05-29 15:19:55.174 [INFO ] [org.openhab.core.model.script.test  ] - Thing:EG_Wohnen_RaffstoreWest Status:null

2022-05-29 15:19:55.205 [DEBUG] [lly.internal.util.ShellyChannelCache] - shelly25-roller-thingraffstorewest: Channel device#heartBeat updated with 2022-05-29T15:19:55.000+0200 (type class org.openhab.core.library.types.DateTimeType).

2022-05-29 15:19:55.297 [DEBUG] [lly.internal.util.ShellyChannelCache] - shelly25-roller-thingraffstorewest: Channel roller#state updated with open (type class org.openhab.core.library.types.StringType).

2022-05-29 15:19:55.299 [DEBUG] [lly.internal.util.ShellyChannelCache] - shelly25-roller-thingraffstorewest: Channel device#uptime updated with 16319 s (type class org.openhab.core.library.types.QuantityType).

2022-05-29 15:19:56.290 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shelly25-roller-thingraffstorewest: CoIoT Message from /192.168.1.121:5683 (MID=8837): {"G":[[0,112,0],[0,122,0],[0,113,100],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,61.76],[0,116,143.16],[0,117,0]]}

2022-05-29 15:19:56.295 [DEBUG] [lly.internal.util.ShellyChannelCache] - shelly25-roller-thingraffstorewest: Channel device#heartBeat updated with 2022-05-29T15:19:56.000+0200 (type class org.openhab.core.library.types.DateTimeType).

2022-05-29 15:19:56.296 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shelly25-roller-thingraffstorewest: CoIoT Sensor data {"G":[[0,112,0],[0,122,0],[0,113,100],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,61.76],[0,116,143.16],[0,117,0]]} (serial=37632)

2022-05-29 15:19:56.298 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shelly25-roller-thingraffstorewest: 10 CoAP sensor updates received

2022-05-29 15:19:56.302 [DEBUG] [lly.internal.util.ShellyChannelCache] - shelly25-roller-thingraffstorewest: Channel meter1#lastUpdate updated with 2022-05-29T15:19:56.000+0200 (type class org.openhab.core.library.types.DateTimeType).

2022-05-29 15:19:56.303 [DEBUG] [lly.internal.util.ShellyChannelCache] - shelly25-roller-thingraffstorewest: Channel meter2#lastUpdate updated with 2022-05-29T15:19:56.000+0200 (type class org.openhab.core.library.types.DateTimeType).

2022-05-29 15:19:56.305 [DEBUG] [lly.internal.util.ShellyChannelCache] - shelly25-roller-thingraffstorewest: Channel relay1#output updated with OFF (type class org.openhab.core.library.types.OnOffType).

2022-05-29 15:19:56.307 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shelly25-roller-thingraffstorewest: 3 channels updated from CoIoT status, serial=37632

2022-05-29 15:19:58.413 [DEBUG] [lly.internal.util.ShellyChannelCache] - shelly25-roller-thingraffstorewest: Channel device#heartBeat updated with 2022-05-29T15:19:58.000+0200 (type class org.openhab.core.library.types.DateTimeType).

2022-05-29 15:19:58.507 [DEBUG] [.internal.handler.ShellyRelayHandler] - shelly25-roller-thingraffstorewest: REST Update roller position: control=0, position=100

2022-05-29 15:19:58.509 [DEBUG] [lly.internal.util.ShellyChannelCache] - shelly25-roller-thingraffstorewest: Channel roller#state updated with stop (type class org.openhab.core.library.types.StringType).

2022-05-29 15:19:58.512 [DEBUG] [lly.internal.util.ShellyChannelCache] - shelly25-roller-thingraffstorewest: Channel device#uptime updated with 16322 s (type class org.openhab.core.library.types.QuantityType).

There is a message that indicates that the Thing is null. That is from another script that checks the online status:

var thingStatusInfo = getThingStatusInfo("shelly:shelly25-roller:ThingRaffstoreWest:roller")

Haven’t figured out why that happens yet.

@markus7017 this may be my issue, but I downloaded the latest SNAPSHOT build and it is not being loaded by openhab. It does not show in the bundle:list within the console at all. Is it possible there is a configuration issue when the bundle was compiled?

So I have tested the gen2 version from Monday and the 4PM PRO seems to be working flawlessly. so thanks for that. But I do still have a problem with the 1pm plus when it has set up authentication. No matter which way to add it I have tried, it always tells me: Access denied, check user id and password.
I have tried to add it through the UI as 1 PM plus from the list of devices(ShellyPlus 1 (SNSW-001X16EU)), also from the inbox, then also I have tried to add it as Password protected Shelly Device, and still nothing with same error about wrong password or Username - I have tried to use just mine password without userid, also used Adimn as userID = according the API docs the userID is always admin. but still nothing. NOt sure i am doing something wrong

@markus7017 THANK YOU!

Hi @markus7017,

have a new Shelly Plus i4. I installed your GEN2 binding and openhab discovers the new plus model.
But unfortunately it gets no status changes from the inputs.

Am i doing something wrong?

br

Dominik

I have some old Shelly4-Pro (SHSW-44) hardware revision prod-2018-12 & prod-2020-04-24. They only run Firmware 1.6.6 as most recent FW. Shelly support confirmed they will not receive updates as the memory is too small to install more recent/bigger firmware.
I guess those devices will loose support from your binding, right?
Thanks for info.

Edit: Just started playing with gen2 binding and found another device possibly being too old:

shellyrgbw2-1dfb19: WARNING: Firmware might be too old, installed: v1.8.2/20200818-120558, required minimal {3}.
shelly4pro-4d0335: WARNING: Firmware might be too old, installed: v1.6.6/20201019-110845, required minimal {3}.

So the shellyrgbw2 seems to be outdated as well. The webinterface of RGBW2 sais: you are on the latest version

@markus7017

I cant get the i4 plus to receive button press events.

Is this not implemented yet?

I had to fix the WebSocket event processing, please try the updated build

There is version 1.11.8 for the RGBW2 available. Use Shelly Manager or device UI to update.
Version in general: It’s a warning, means I’m not testing with those old version, but there is a good chance that it works.

@markus7017

Installed new build.
No change to Shelly i4plus.
Shelly Manager shows 0 CoIoT Messages.

@markus7017 Correction: The i4 is updated 2 minutes after button press.

Hello Markus,

I have tested the gen2 version from 2022.06.05 and the 4PM PRO with authentication did not work for me. I got wrong password or username.
Firmware is 10.2.
Not sure i am doing something wrong

Thanks for your help.

Authentication is not yet supported for Gen2 devices. Please try without userid/pw. This is on the list

The Plus i4 does not use CoIOT, but WebSockets

Are you sure you are using the latest build? WebSockets were broken, but have been fixed.
Updates after 1 or 2min is an indicator that those do not work (like CoIOT for Gen1 devices)

Enable DEBUG log and post relevant extract here

Downloaded from your signature.
Just to be sure.
Which one is the right jar file?

I would estimate the latest, have a look here myfiles/shelly at master · markus7017/myfiles · GitHub

org.openhab.binding.shelly-3.3.0-gen2.jar. OH should discover the device and you should get channels for all 4 inputs.

The regular DEV build doesn’t support/discover the i4. Go to the OH console and issue the following command: “log:set DEBUG org.openhab.binding.shelly”. Check the log for “NotifyStatus” messages, which show the inbound notifications when input states etc. have changed.


3.3.0-GEN2 Build (latest, Gen1+2) | 3.3.0-DEV Build (stable, Gen1-only) - README
Avdanced Users - Shelly Manager - Bugs/Features - API Doc
Gen1: Firmware Index - Firmware Archive


Note: The DEV build is always newer than the version in the official Distro or the Milestone builds check here for more info on first installation

Changed to your jar file. Same behavior. The event is processed roughly 2min after button press.
Set log to debug. There are no log entries with “NotifyStatus”.

These are the only log entries for the device:

2022-06-06 20:05:23.600 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel device#heartBeat updated with 2022-06-06T20:05:23.000+0200 (type class org.openhab.core.library.types.DateTimeType).
2022-06-06 20:05:23.603 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel device#uptime updated with 26186 s (type class org.openhab.core.library.types.QuantityType).
2022-06-06 20:05:23.607 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel device#wifiSignal updated with 4 (type class org.openhab.core.library.types.DecimalType).
2022-06-06 20:05:23.611 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel device#internalTemp updated with 0 °C (type class org.openhab.core.library.types.QuantityType).
2022-06-06 20:05:23.617 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel device#uptime updated with 26186 s (type class org.openhab.core.library.types.QuantityType).
2022-06-06 20:05:23.621 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel device#wifiSignal updated with 4 (type class org.openhab.core.library.types.DecimalType).
2022-06-06 20:05:23.626 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel device#internalTemp updated with 0 °C (type class org.openhab.core.library.types.QuantityType).
2022-06-06 20:05:23.631 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel status1#input updated with ON (type class org.openhab.core.library.types.OnOffType).
2022-06-06 20:05:23.636 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Channel status4#input updated with ON (type class org.openhab.core.library.types.OnOffType).
2022-06-06 20:05:23.639 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-083af200b468: Enabling channel cache (20 updates / 60s)
2022-06-06 20:05:23.693 [DEBUG] [.internal.handler.ShellyLightHandler] - shellycolorbulb-98cdac2d0450: Update colors from color picker

My other GEN1 shellys are updating instantly.

you have to see “WebSocket connected successful” and “NotifyStatus update received” messages like in my log

21:50:54.819 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Device config: IP address=192.168.6.211, HTTP user/password=openhab/***, update interval=60
21:50:54.819 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Configured Events: Button: false, Switch (on/off): true, Push: true, Roller: true, Sensor: true, CoIoT: false, Enable AutoCoIoT: true
21:50:54.819 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Start initializing thing shellyplusi4-30839809e838 - 192.168.6.211, type shellyplusi4, ip address 192.168.6.211, CoIoT: false
21:50:54.820 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellyplusi4:30839809e838' changed from INITIALIZING to UNKNOWN (CONFIGURATION_PENDING): Initialisierung oder Gerät im Schlafmodus.
21:50:54.956 [DEBUG] [g.shelly.internal.api2.Shelly2RpcApi] - shellyplusi4-30839809e838: WebSocket connected successful
21:50:54.966 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Initializing device shellyplusi4-30839809e838, type SNSN-0024X, Hardware: Rev: , batch ; Firmware:  / 20211111-091050
21:50:54.966 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Shelly settings info for shellyplusi4-30839809e838: 
21:50:54.966 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: 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
21:50:55.039 [DEBUG] [g.shelly.internal.api2.Shelly2RpcApi] - shellyplusi4-30839809e838: NotifyStatus update received: {"params":{"ble":null,"cloud":{"connected":false},"mqtt":{"connected":false},"sys":{"mac":"30839809E838","restart_required":false,"time":"21:50","unixtime":1654545055,"uptime":601828,"ram_size":250256,"ram_free":178444,"fs_size":458752,"fs_free":249856,"cfg_rev":4,"available_updates":{"stable":{"version":"0.10.2"}}},"wifi":{"sta_ip":"192.168.6.211","status":"got ip","ssid":"TurtlePineHouse","rssi":-54},"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":null,"cloud":{"connected":false},"mqtt":{"connected":false},"sys":{"mac":"30839809E838","restart_required":false,"time":"21:50","unixtime":1654545055,"uptime":601828,"ram_size":250256,"ram_free":178444,"fs_size":458752,"fs_free":249856,"cfg_rev":4,"available_updates":{"stable":{"version":"0.10.2"}}},"wifi":{"sta_ip":"192.168.6.211","status":"got ip","ssid":"TurtlePineHouse","rssi":-54},"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":-2014215791,"src":"shellyplusi4-30839809e838","dst":"shellyplusi4-30839809e838"}
21:50:55.041 [INFO ] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Gerät verwendet eine Beta-Version: /20211111-091050.
21:50:55.043 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Updating channel definitions, 3 channels
21:50:55.043 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Adding channel device#internalTemp
21:50:55.043 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellyplusi4:30839809e838' changed from UNKNOWN (CONFIGURATION_PENDING): Initialisierung oder Gerät im Schlafmodus. to ONLINE
21:50:55.044 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Adding channel device#updateAvailable
21:50:55.044 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Adding channel device#heartBeat
21:50:55.046 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Channel definitions updated
21:50:55.049 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Thing successfully initialized.
21:50:55.050 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Update status job started, interval=20*3=60sec.
21:50:57.187 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Updating channel definitions, 2 channels
21:50:57.188 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Adding channel status1#input
21:50:57.188 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Adding channel status1#button
21:50:57.193 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Channel definitions updated
21:50:57.194 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Updating channel definitions, 2 channels
21:50:57.194 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Adding channel status2#input
21:50:57.194 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Adding channel status2#button
21:50:57.195 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Channel definitions updated
21:50:57.195 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Updating channel definitions, 2 channels
21:50:57.196 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Adding channel status3#input
21:50:57.196 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Adding channel status3#button
21:50:57.197 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Channel definitions updated
21:50:57.198 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Updating channel definitions, 2 channels
21:50:57.198 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Adding channel status4#input
21:50:57.198 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Adding channel status4#button
21:50:57.200 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplusi4-30839809e838: Channel definitions updated
21:50:57.218 [DEBUG] [g.shelly.internal.api2.Shelly2RpcApi] - shellyplusi4-30839809e838: NotifyStatus update received: {"params":{"ble":null,"cloud":{"connected":false},"mqtt":{"connected":false},"sys":{"mac":"30839809E838","restart_required":false,"time":"21:50","unixtime":1654545057,"uptime":601830,"ram_size":250264,"ram_free":179704,"fs_size":458752,"fs_free":249856,"cfg_rev":4,"available_updates":{"stable":{"version":"0.10.2"}}},"wifi":{"sta_ip":"192.168.6.211","status":"got ip","ssid":"TurtlePineHouse","rssi":-54},"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":null,"cloud":{"connected":false},"mqtt":{"connected":false},"sys":{"mac":"30839809E838","restart_required":false,"time":"21:50","unixtime":1654545057,"uptime":601830,"ram_size":250264,"ram_free":179704,"fs_size":458752,"fs_free":249856,"cfg_rev":4,"available_updates":{"stable":{"version":"0.10.2"}}},"wifi":{"sta_ip":"192.168.6.211","status":"got ip","ssid":"TurtlePineHouse","rssi":-54},"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":-1914458590,"src":"shellyplusi4-30839809e838","dst":"shellyplusi4-30839809e838"}

Do you have the latest firmware, I’m using 0.10.2

Im on 10.2 too.

Im not having your lines in my log. No notify and No websocket. :frowning:

Any ideas?