Shelly Binding

I have a problem with a shelly uni
It won’t go online.

09:19:59.995 [DEBUG] [ly.internal.handler.ShellyBaseHandler] - shellyuni-mcserver: Thing name derived from UID shelly:shellyuni:MCServer
09:19:59.996 [TRACE] [ly.internal.handler.ShellyBaseHandler] - shellyuni-mcserver: updateInterval = 60s -> skipCount = 20
09:19:59.997 [DEBUG] [ly.internal.handler.ShellyBaseHandler] - shellyuni-mcserver: Device config: IP address=192.168.110.15, HTTP user/password=jan/***, update interval=60
09:19:59.998 [DEBUG] [ly.internal.handler.ShellyBaseHandler] - shellyuni-mcserver: Configured Events: Button: false, Switch (on/off): false, Push: false, Roller: true, Sensor: true, CoIoT: true, Enable AutoCoIoT: true 
09:19:59.999 [DEBUG] [ly.internal.handler.ShellyBaseHandler] - shellyuni-mcserver: Start initializing for thing Shelly uni MCServer, type shellyuni, IP address 192.168.110.15, Gen2: false, CoIoT: true
09:19:59.999 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellyuni:MCServer' changed from INITIALIZING to UNKNOWN (CONFIGURATION_PENDING): Initializing or device in sleep mode.
09:20:00.000 [TRACE] [g.shelly.internal.api1.Shelly1HttpApi] - Shelly uni MCServer: HTTP GET for http://192.168.110.15/shelly
09:20:00.119 [TRACE] [g.shelly.internal.api1.Shelly1HttpApi] - Shelly uni MCServer: HTTP Response 200: {"type":"SHUNI-1","mac":"E8DB84D65793","auth":true,"fw":"20220809-125434/v1.12-g99f7e0b","discoverable":true,"longid":1,"num_outputs":2}
09:20:00.120 [TRACE] [.shelly.internal.api.ShellyHttpClient] - shellyuni-mcserver: HTTP GET for http://192.168.110.15/settings 
09:20:00.162 [TRACE] [.shelly.internal.api.ShellyHttpClient] - shellyuni-mcserver: HTTP Response 200: {"device":{"type":"SHUNI-1","mac":"E8DB84D65793","hostname":"shellyuni-E8DB84D65793","num_outputs":2},"wifi_ap":{"enabled":false,"ssid":"shellyuni-E8DB84D65793","key":""},"wifi_sta":{"enabled":true,"ssid":"Sf133iot","ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"ap_roaming":{"enabled":true,"threshold":-70},"mqtt": {"enable":true,"server":"192.168.133.10:1883","user":"","id":"shellyuni-E8DB84D65793","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"max_qos":0,"retain":false,"update_period":30},"coiot": {"enabled":true,"update_period":15,"peer":""},"sntp":{"server":"be.pool.ntp.org","enabled":true},"login":{"enabled":true,"unprotected":false,"username":"jan"},"pin_code":"","name":"MCServer","fw":"20220809-125434/v1.12-g99f7e0b","factory_reset_from_switch":true,"discoverable":true,"build_info":{"build_id":"20220809-125434/v1.12-g99f7e0b","build_timestamp":"2022-08-09T12:54:34Z","build_version":"1.0"},"cloud":{"enabled":false,"connected":false},"timezone":"Europe/Brussels","lat":50.873440,"lng":4.414890,"tzautodetect":true,"tz_utc_offset":3600,"tz_dst":false,"tz_dst_auto":true,"time":"09:20","unixtime":1667204400,"debug_enable":false,"allow_cross_origin":false,"actions":{"active":false,"names":["out_on_url","out_off_url","btn_on_url","btn_off_url","longpush_url","shortpush_url","out_on_url","out_off_url","btn_on_url","btn_off_url","longpush_url","shortpush_url","adc_over_url","adc_under_url","report_url","report_url","report_url","ext_temp_over_url","ext_temp_under_url","ext_temp_over_url","ext_temp_under_url","ext_temp_over_url","ext_temp_under_url","ext_temp_over_url","ext_temp_under_url","ext_temp_over_url","ext_temp_under_url","ext_hum_over_url","ext_hum_under_url"]},"hwinfo":{"hw_revision":"prod-202101", "batch_id":0},"mode":"relay","longpush_time":800,"relays":[{"name":"Reset_MCServer","appliance_type":"General","ison":false,"has_timer":false,"default_state":"off","btn_type":"detached","btn_reverse":0,"auto_on":0.00,"auto_off":1.00,"schedule":false,"schedule_rules":[]},{"name":"Power_MCServer","appliance_type":"General","ison":false,"has_timer":false,"default_state":"off","btn_type":"detached","btn_reverse":0,"auto_on":0.00,"auto_off":1.00,"schedule":false,"schedule_rules":[]}],"adcs":[{"range":12,"offset":0.00,"relay_actions":[{"over_threshold":0,"over_act":"disabled","under_threshold":0,"under_act":"disabled"},{"over_threshold":0,"over_act":"disabled","under_threshold":0,"under_act":"disabled"}]}],"ext_sensors":{"temperature_unit":"C"},"ext_temperature":{"1":[{"overtemp_threshold_tC":0.0,"overtemp_threshold_tF":32.0,"undertemp_threshold_tC":0.0,"undertemp_threshold_tF":32.0,"overtemp_act":"disabled","undertemp_act":"disabled","offset_tC":0.0,"offset_tF":0.0},{"overtemp_threshold_tC":0.0,"overtemp_threshold_tF":32.0,"undertemp_threshold_tC":0.0,"undertemp_threshold_tF":32.0,"overtemp_act":"disabled","undertemp_act":"disabled","offset_tC":0.0,"offset_tF":0.0}],"0":[{"overtemp_threshold_tC":0.0,"overtemp_threshold_tF":32.0,"undertemp_threshold_tC":0.0,"undertemp_threshold_tF":32.0,"overtemp_act":"disabled","undertemp_act":"disabled","offset_tC":0.0,"offset_tF":0.0},{"overtemp_threshold_tC":0.0,"overtemp_threshold_tF":32.0,"undertemp_threshold_tC":0.0,"undertemp_threshold_tF":32.0,"overtemp_act":"disabled","undertemp_act":"disabled","offset_tC":0.0,"offset_tF":0.0}]},"ext_humidity":null,"eco_mode_enabled":false}
09:20:00.170 [DEBUG] [ly.internal.handler.ShellyBaseHandler] - shellyuni-mcserver: Unable to initialize: API Timeout for , retrying later
09:20:00.171 [DEBUG] [ly.internal.handler.ShellyBaseHandler] - shellyuni-mcserver: Update status job started, interval=20*3=60sec.

Can someone point me in the right direction to get this working?
thx.

Hello

OH 3.2, org.openhab.binding.shelly-3.4.0-SNAPSHOT.jar commit [c528d4c]

Thanks for this binding.

I have a Pro2 with latest f/w which auto-detects correctly. When I try to create and link an item from the channel for the Alarm channel, the profile listed is “Timestamp on trigger”, but it is greyed out (not selectable) and when I click “Link” I get the error “openhab - There is no profile available for the selected item”. I guess that I am missing a transformation add-on. Any clues?

The issue seems to be

13:22:46.327 [DEBUG] [ly.internal.handler.ShellyBaseHandler] - shellyplusht-c049ef8c74dc: Unable to initialize: POST http://192.168.100.90/rpc > No handler for WS.GetConfig, retrying later

Below the whole section:

13:22:44.018 [DEBUG] [.shelly.internal.ShellyHandlerFactory] - Thing handler for uid shelly:shellyplusht:c049ef8c74dc added, total things = 13
13:22:44.033 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellyplusht:c049ef8c74dc' changed from UNINITIALIZED (DISABLED) to INITIALIZING
13:22:45.142 [DEBUG] [elly.internal.api1.Shelly1CoapHandler] - shelly1-3494546a2d9c: CoIoT Message from /192.168.100.32:5683 (MID=45356): {"G":[[0,112,0],[0,118,0]]}
13:22:45.150 [DEBUG] [elly.internal.api1.Shelly1CoapHandler] - shelly1-3494546a2d9c: Serial 512 was already processed, ignore update
13:22:45.159 [DEBUG] [elly.internal.api1.Shelly1CoapHandler] - shelly1-3494546abd38: CoIoT Message from /192.168.100.31:5683 (MID=48740): {"G":[[0,112,0],[0,118,0]]}
13:22:45.167 [DEBUG] [elly.internal.api1.Shelly1CoapHandler] - shelly1-3494546abd38: Serial 512 was already processed, ignore update
13:22:45.723 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'MultisensorNode8Garden_BinarySensor' changed from OFF to ON
13:22:46.047 [DEBUG] [ly.internal.handler.ShellyBaseHandler] - shellyplusht-c049ef8c74dc: Using userId Jonas from bindingConfig
13:22:46.055 [DEBUG] [ly.internal.handler.ShellyBaseHandler] - shellyplusht-c049ef8c74dc: Device config: IP address=192.168.100.90, HTTP user/password=Jonas/***, update interval=900
13:22:46.070 [DEBUG] [ly.internal.handler.ShellyBaseHandler] - shellyplusht-c049ef8c74dc: Configured Events: Button: false, Switch (on/off): true, Push: true, Roller: true, Sensor: true, CoIoT: false, Enable AutoCoIoT: false
13:22:46.081 [DEBUG] [ly.internal.handler.ShellyBaseHandler] - shellyplusht-c049ef8c74dc: Start initializing for thing Shelly Plus HT Bedroom, type shellyplusht, IP address 192.168.100.90, Gen2: true, CoIoT: false
13:22:46.082 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellyplusht:c049ef8c74dc' changed from INITIALIZING to UNKNOWN (CONFIGURATION_PENDING): Initializing or device in sleep mode.
13:22:46.118 [DEBUG] [ng.shelly.internal.api2.Shelly2ApiRpc] - shellyplusht-c049ef8c74dc: Connect Rpc Socket (discovery = false)
13:22:46.127 [DEBUG] [shelly.internal.api2.Shelly2RpcSocket] - Shelly Plus HT Bedroom: Connect WebSocket, URI=ws://192.168.100.90/rpc
13:22:46.212 [DEBUG] [shelly.internal.api2.Shelly2RpcSocket] - Shelly Plus HT Bedroom: WebSocket connected /192.168.100.28:36260<-/192.168.100.90:80, Idle Timeout=2147483647
13:22:46.327 [DEBUG] [ly.internal.handler.ShellyBaseHandler] - shellyplusht-c049ef8c74dc: Unable to initialize: POST http://192.168.100.90/rpc > No handler for WS.GetConfig, retrying later
13:22:46.335 [DEBUG] [ly.internal.handler.ShellyBaseHandler] - shellyplusht-c049ef8c74dc: Update status job started, interval=300*3=900sec.

Any ideas?

which firmware are you using? should be the latest 0.11, 0.11.1 ist the first version, which implements the required outbound WebSockets

The firmware version is called 20220608-072353. I don’t know how that translates to the naming used in all my other Shelly devices (they are all 1.12.1). The „Check for Updates“ button in the web interface does not react.

This is def. to old

202206xxx means 06/2022

Gen 1 and 2 have complete different firmwares. Use the device UI to check firmware version and upgrade to the latest onr

The button on the web interface is not working. Nothing happens when I press it. Is there another way to update the firmware. Already did a factory reset. Thanks!

you can update the firmware through Markus‘ shelly manager.
ip/shelly/manager.
Or you have forgotten to open your router for shellies (happened to me once).
You can check manually for new firmware also here

hmm, I think you need to contact Shelly support
The Gen1 API doesn’t provide the access to the firmware repo like Gen1, so I can’t implement the same fw upgrade feature

You need to make sure that the device can access the Shelly Cloud (output https to the Internet)

@Oliver2 Those are firmwares for Gen1 devices only; there is currently no access to the Gen2 repo

New build for 3.4M3 users. I fixed the Soap problem caused by the switch to Californium 2.7.3. Gen1 devices with CoAP multicast should now work again.

WHO COULD TEST AND PROVIDE FEEDBACK?
org.openhab.binding.shelly-3.4.0M3-SNAPSHOT.jar (3.4M3 only!)

I know you said “3.4M3 only”, but a few minutes ago M4 was released (and I couldn’t hold back to update). Should it work with M4, too?

I think so, because it’s still Californium 2.7.4 (there is 2.7.5) and this is referenced by the M3 binding.
Try it out and let me know.

I cannot get it to work. Hope I did it right:
I put those files in addons folder:

  • californium-core-2.7.3.jar
  • element-connector-2.7.3.jar
  • org.openhab.binding.shelly-3.4.0M3-SNAPSHOT.jar
    Here the first log-messages after the restart, if of interesst:
2022-11-06 19:55:32.530 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.shelly-3.4.0M3-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.shelly [307]
  Unresolved requirement: Import-Package: org.eclipse.californium.core.coap; version="[2.7.0,3.0.0)"
    -> Export-Package: org.eclipse.californium.core.coap; bundle-symbolic-name="org.eclipse.californium.core"; bundle-version="2.7.3"; version="2.7.3"; uses:="org.eclipse.californium.core,org.eclipse.californium.core.network,org.eclipse.californium.core.network.stack,org.eclipse.californium.core.server.resources,org.eclipse.californium.elements,org.eclipse.californium.elements.util,org.slf4j"
       org.eclipse.californium.core [310]
         Unresolved requirement: Import-Package: org.eclipse.californium.elements; version="[2.7.0,3.0.0)"
           -> Export-Package: org.eclipse.californium.elements; bundle-symbolic-name="org.eclipse.californium.element-connector"; bundle-version="2.7.3"; version="2.7.3"; uses:="org.slf4j"
              org.eclipse.californium.element-connector [309]

Please try to open the OH console and execute “feature:install oh-transport-coap”. Then run bundle:list to check if the Californium modules are active. The file structure has been changed since version 2.0.0 and I currently don’t have the complete set to have a simple install for the addons folder (hunting and collecting…).

Tried as you asked. The output is as follows:

openhab> bundle:list | grep Calif
307 x Installed x  80 x 2.7.3                  x Californium (Cf) Element Connector
308 x Installed x  80 x 2.7.3                  x Californium (Cf) Core
openhab> feature:install oh-transport-coap
Error executing command: No matching features for oh-transport-coap/0

You need to cleanup your installation.

  • Shelly binding coming with the dist must not be installed/removed
  • remove californium and binding jars from addons folder
  • then ““feature:install openhab-transport-coap” ion the OH console (not oh-transport-coap)
  • then copy binding jar into the addons folder

This approach has been validated by @igi

Yes, hooray, now it works. I will do more testing tomorrow. Many thanks

It’s great to read the issue could be resolved.
When we may expect a milestone or snapshot release fixing the coap issue?

M4 ist just out, I think M5 will take 3-4 more weeks

1 Like

good job :partying_face:

please make sure to check if the device events are coming near realtime

fyi: you need to redo the feature:install after running a clean cache