Shelly Binding

This 172 IP reminds me of the internal IP adresses that Docker is using. Could it be, that you are running Openhab inside a Docker container and use a reverse-proxy to route traffic into the container? Depending on the container’s network configuration, Openhab will only see the virtual network interface with the Docker network and configures this IP in your Shelly.

I don’t know if Openhab has an option to set the real/external IP somewhere so that the IP of the virtual network device gets ignored. Alternatively, you could start the container with --net=host so that the container uses the real network interface of the host machine.

No, I am running openhabian with openhab on the host system itself.
Is there any tutorial/steps how to use CoIot? How would it work exactly?

There is nothing special to setup.
Either set it to mcast or the openHAB IP-Address in your Shelly device.

Hi all,
I’m on OH 4.1.0.M5, with Shelly binding:

openhab> bundle:list | grep Shelly
264 │ Active │  80 │ 4.1.0.M5               │ openHAB Add-ons :: Bundles :: Shelly Binding Gen1+2

I tried both ways (text config and UI) to add my Shelly Pro3EM (tried both 1.1.0-beta3 and 1.0.8 firmware)

My problem is that I haven’t got the channels

device#internalTemp
device#accumulatedWatts
device#accumulatedWTotal


meter1#totalKWH
meter2#totalKWH
meter3#totalKWH

If I use UI to discover and add the thing I got on meter1 (same of others):

If I use textual configuration:

Thing shelly:shellypro3em:CentroDiLavoro     "Shelly Pro3EM CentroDiLavoro"     [deviceIp="10.10.130.55"]
Number:Temperature          ShellyCDL_internalTemp                 "CDL - Temp. Interna [%.1f %unit%]"              (gShellyCDL, gShellyCDL_log)                           {channel="shelly:shellypro3em:CentroDiLavoro:device#internalTemp"}
Number:Power                ShellyCDL_total_accumulatedtWatts      "CDL - Total - Current Watts [%.2f %unit%]"      (gShellyCDL, gShellyCDL_log)                           {channel="shelly:shellypro3em:CentroDiLavoro:device#accumulatedWatts"}
Number:Energy               ShellyCDL_total_accumulatedTotal       "CDL - Total - Total KWH [%.2f %unit%"           (gShellyCDL, gShellyCDL_log)                           {channel="shelly:shellypro3em:CentroDiLavoro:device#accumulatedWTotal"}
Number:Energy               ShellyCDL_total_accumulatedReturned    "CDL - Temp. Interna [%.1f %unit%]"              (gShellyCDL, gShellyCDL_log)                           {channel="shelly:shellypro3em:CentroDiLavoro:device#accumulatedReturned"}

Number:Energy               ShellyCDL_meter1_totalKWH              "CDL - meter1 - Total KWH [%.2f %unit%]"         (gShellyCDL, gShellyCDL_log, gShellyCDL_updTrigger)    {channel="shelly:shellypro3em:CentroDiLavoro:meter1#totalKWH"}
Number:Energy               ShellyCDL_meter2_totalKWH              "CDL - meter2 - Total KWH [%.2f %unit%]"         (gShellyCDL, gShellyCDL_log, gShellyCDL_updTrigger)    {channel="shelly:shellypro3em:CentroDiLavoro:meter2#totalKWH"}
Number:Energy               ShellyCDL_meter3_totalKWH              "CDL - meter3 - Total KWH [%.2f %unit%]"         (gShellyCDL, gShellyCDL_log, gShellyCDL_updTrigger)    {channel="shelly:shellypro3em:CentroDiLavoro:meter3#totalKWH"}

in UI it show me “invalid link” in items linked with “missing” channels.

In the shelly manager I can read the internal temperature:

and if I use the rpc url I got the correct data:

http://10.10.130.55/rpc/EMData.GetStatus?id=0

{
"id": 0,
"a_total_act_energy": 39202.5,
"a_total_act_ret_energy": 23.1,
"b_total_act_energy": 26853.7,
"b_total_act_ret_energy": 31.21,
"c_total_act_energy": 21577.99,
"c_total_act_ret_energy": 29.29,
"total_act": 87634.19,
"total_act_ret": 83.61
}

am I doing something wrong?
suggestions?

Thanks

I solve that problem changing everything to MQTT Binding

UID: mqtt:topic:mosquittobroker:shelly3empool
label: MQTT Energia Shelly Pool
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:mosquittobroker
channels:
  - id: device#IP_Eth
    channelTypeUID: mqtt:string
    label: IP Adress Eth
    description: null
    configuration:
      stateTopic: shellypro3em-pool/status
      transformationPattern: JSONPATH:$.eth.ip
  - id: device#IP_Wifi
    channelTypeUID: mqtt:string
    label: IP Adress Wifi
    description: null
    configuration:
      stateTopic: shellypro3em-pool/status
      transformationPattern: JSONPATH:$.wifi.sta_ip
  - id: device#Sys_uptime
    channelTypeUID: mqtt:number
    label: System Uptime
    description: null
    configuration:
      stateTopic: shellypro3em-pool/status
      transformationPattern: JSONPATH:$.sys.uptime
  - id: device#heartBeat
    channelTypeUID: mqtt:datetime
    label: Last Heartbeat
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*NotifyStatus.*)∩JSONPATH:$.params.ts
  - id: device#send_command
    channelTypeUID: mqtt:string
    label: Envia Comandos
    description: null
    configuration:
      commandTopic: shellypro3em-pool/command
  - id: device#rcv_events
    channelTypeUID: mqtt:string
    label: Receive Events
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
  - id: meter1#powerFactor
    channelTypeUID: mqtt:number
    label: Meter1 Factor Potencia (a_pf)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*a_pf.*)∩JSONPATH:$.params.em:0.a_pf
  - id: meter2#powerFactor
    channelTypeUID: mqtt:number
    label: Meter2 Factor Potencia (b_pf)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*b_pf.*)∩JSONPATH:$.params.em:0.b_pf
  - id: meter3#powerFactor
    channelTypeUID: mqtt:number
    label: Meter3 Factor Potencia (c_pf)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*c_pf.*)∩JSONPATH:$.params.em:0.c_pf
  - id: meter1#actpower
    channelTypeUID: mqtt:number
    label: Meter1 Potencia Activa (a_act_power)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*a_act_power.*)∩JSONPATH:$.params.em:0.a_act_power
      unit: W
  - id: meter1#aprtpower
    channelTypeUID: mqtt:number
    label: Meter1 Potencia Aparente (a_aprt_power)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*a_aprt_power.*)∩JSONPATH:$.params.em:0.a_aprt_power
      unit: VA
  - id: meter1#current
    channelTypeUID: mqtt:number
    label: Meter1 Currente (a_current)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*a_current.*)∩JSONPATH:$.params.em:0.a_current
      unit: A
  - id: meter1#freq
    channelTypeUID: mqtt:number
    label: Meter1 Frequencia (a_freq)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*a_freq.*)∩JSONPATH:$.params.em:0.a_freq
      unit: Hz
  - id: meter1#voltage
    channelTypeUID: mqtt:number
    label: Meter1 Tensao (a_voltage)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*a_voltage.*)∩JSONPATH:$.params.em:0.a_voltage
      unit: V
  - id: meter1#actenergy
    channelTypeUID: mqtt:number
    label: Meter1 Energia Total (a_total_act_energy)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*a_total_act_energy.*)∩JSONPATH:$.params.emdata:0.a_total_act_energy
      unit: Wh
  - id: meter2#actpower
    channelTypeUID: mqtt:number
    label: Meter2 Potencia Activa (b_act_power)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*b_act_power.*)∩JSONPATH:$.params.em:0.b_act_power
      unit: W
  - id: meter2#aprtpower
    channelTypeUID: mqtt:number
    label: Meter2 Potencia Aparente (b_aprt_power)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*b_aprt_power.*)∩JSONPATH:$.params.em:0.b_aprt_power
      unit: VA
  - id: meter2#current
    channelTypeUID: mqtt:number
    label: Meter2 Currente (b_current)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*b_current.*)∩JSONPATH:$.params.em:0.b_current
      unit: A
  - id: meter2#freq
    channelTypeUID: mqtt:number
    label: Meter2 Frequencia (b_freq)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*b_freq.*)∩JSONPATH:$.params.em:0.b_freq
      unit: Hz
  - id: meter2#voltage
    channelTypeUID: mqtt:number
    label: Meter2 Tensao (b_voltage)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*b_voltage.*)∩JSONPATH:$.params.em:0.b_voltage
      unit: V
  - id: meter2#actenergy
    channelTypeUID: mqtt:number
    label: Meter2 Energia Total (b_total_act_energy)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*b_total_act_energy.*)∩JSONPATH:$.params.emdata:0.b_total_act_energy
      unit: Wh
  - id: meter3#actpower
    channelTypeUID: mqtt:number
    label: Meter3 Potencia Activa (c_act_power)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*c_act_power.*)∩JSONPATH:$.params.em:0.c_act_power
      unit: W
  - id: meter3#aprtpower
    channelTypeUID: mqtt:number
    label: Meter3 Potencia Aparente (c_aprt_power)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*c_aprt_power.*)∩JSONPATH:$.params.em:0.c_aprt_power
      unit: VA
  - id: meter3#current
    channelTypeUID: mqtt:number
    label: Meter3 Currente (c_current)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*c_current.*)∩JSONPATH:$.params.em:0.c_current
      unit: A
  - id: meter3#freq
    channelTypeUID: mqtt:number
    label: Meter3 Frequencia (c_freq)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*c_freq.*)∩JSONPATH:$.params.em:0.c_freq
      unit: Hz
  - id: meter3#voltage
    channelTypeUID: mqtt:number
    label: Meter3 Tensao (c_voltage)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*c_voltage.*)∩JSONPATH:$.params.em:0.c_voltage
      unit: V
  - id: meter3#actenergy
    channelTypeUID: mqtt:number
    label: Meter3 Energia Total (c_total_act_energy)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*c_total_act_energy.*)∩JSONPATH:$.params.emdata:0.c_total_act_energy
      unit: Wh
  - id: total#act_power
    channelTypeUID: mqtt:number
    label: Potencia Activa Total (total_act_power)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*total_act_power.*)∩JSONPATH:$.params.em:0.total_act_power
      unit: W
  - id: total#aprt_power
    channelTypeUID: mqtt:number
    label: Potencia Aparente Total (total_aprt_power)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*total_aprt_power.*)∩JSONPATH:$.params.em:0.total_aprt_power
      unit: VA
  - id: total#energy
    channelTypeUID: mqtt:number
    label: Energia Total (total_act)
    description: null
    configuration:
      stateTopic: shellypro3em-pool/events/rpc
      transformationPattern: REGEX:(.*a_total_act_energy.*)∩JSONPATH:$.params.emdata:0.total_act
      unit: Wh

Thanks @samtd,
in the meanwhile I’m using the HTTP binding to retrieve the few values I need with a HTTP GET on the rpc url.

@villaRob Same problem here with a shellypro3em

I get the returnedKWH channels, but not the totalKWH one that the documentation claims. Furthermore, I don’t want to sum meter1-meter3 manually and was looking at the device channels accumulatedReturned and accumulatedWTotal but they show mostly garbage (or maybe only the 1minute value?).

I’m also super confused by the documentation talking about kW/h which isn’t a unit that exists.

I’ve turned on MQTT on the shelly and I’m seeing this getting published:

shellypro3em/events/rpc {“src”:“shellypro3em-xxxx”,“dst”:“shellypro3em/events”,“method”:“NotifyStatus”,“params”:{“ts”:1703018520.62,“emdata:0”:{“id”:0,“a_total_act_energy”:16256.06,“a_total_act_ret_energy”:0.00,“b_total_act_energy”:14826.41,“b_total_act_ret_energy”:7.23,“c_total_act_energy”:14795.21,“c_total_act_ret_energy”:0.84,“total_act”:45877.69,“total_act_ret”:8.07}}}

Where all three phases showing about 15kWh each should be right, as this is metering a 3-phase wallbox.

I assume this is also the discrepancy @Wolfgang_Rosenauer was seeing a while ago.

For now, I’ll also try the MQTT json transform magic, thanks @samtd !

Happy to test more builds but I’m currently in a hurry to get this working properly. The annoying bit is that even in the Shelly UI I basically cannot get to the true total counter values, it insist on telling me the “Energy last minute”.

Edit: Unlike the example by @samtd the total_energy is on a different topic for me, and I need different transforms as well.

Current thing:

Thing mqtt:topic:shellypro3em "MQTT Shelly Pro3EM" (mqtt:broker:d4979348) {                                                                                                                                                          
Channels:                                                                                                                                                                                                                            
Type number : total#act_power "Total active power" [ stateTopic="shellypro3em/status/em:0", transformationPattern="JSONPATH:$.total_act_power", unit="W" ]
Type number : total#act_energy "Total active energy" [ stateTopic="shellypro3em/status/emdata:0", transformationPattern="JSONPATH:$.total_act", unit="Wh" ]                                                                      
}                                                                                                                                                                                                                                    

Works! I get 3.3W for the current idle power draw and 45880Wh for the energy delivered.

Since the upgrade to OH 4.1.0 I get the following error and I’m not sure if I’m doing something wrong. I’m running the release verion of the binding.
We seem to have a ClassNotFoundException for org.eclipse.jetty.websocket.server.WebSocketServerFactory. Any ideas?

2023-12-25 20:44:09.927 [WARN ] [org.eclipse.jetty.server.HttpChannel] - /shelly/wsevent
javax.servlet.ServletException: javax.servlet.ServletException: java.lang.RuntimeException: Unable to load org.eclipse.jetty.websocket.server.WebSocketServerFactory
	at org.ops4j.pax.web.service.jetty.internal.PrioritizedHandlerCollection.handle(PrioritizedHandlerCollection.java:103) ~[?:?]
	at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:731) ~[bundleFile:9.4.52.v20230823]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.52.v20230823]
	at org.eclipse.jetty.server.Server.handle(Server.java:516) ~[bundleFile:9.4.52.v20230823]
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487) ~[bundleFile:9.4.52.v20230823]
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732) ~[bundleFile:9.4.52.v20230823]
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479) [bundleFile:9.4.52.v20230823]
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) [bundleFile:9.4.52.v20230823]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.52.v20230823]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) [bundleFile:9.4.52.v20230823]
	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) [bundleFile:9.4.52.v20230823]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) [bundleFile:9.4.52.v20230823]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) [bundleFile:9.4.52.v20230823]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) [bundleFile:9.4.52.v20230823]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) [bundleFile:9.4.52.v20230823]
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) [bundleFile:9.4.52.v20230823]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) [bundleFile:9.4.52.v20230823]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) [bundleFile:9.4.52.v20230823]
	at java.lang.Thread.run(Thread.java:840) [?:?]
Caused by: javax.servlet.ServletException: java.lang.RuntimeException: Unable to load org.eclipse.jetty.websocket.server.WebSocketServerFactory
	at org.eclipse.jetty.websocket.servlet.WebSocketServlet.init(WebSocketServlet.java:147) ~[?:?]
	at javax.servlet.GenericServlet.init(GenericServlet.java:180) ~[bundleFile:4.0.4]
	at org.ops4j.pax.web.service.spi.servlet.OsgiInitializedServlet.init(OsgiInitializedServlet.java:68) ~[?:?]
	at org.eclipse.jetty.servlet.ServletHolder$Wrapper.init(ServletHolder.java:1345) ~[?:?]
	at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:632) ~[?:?]
	at org.eclipse.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:486) ~[?:?]
	at org.eclipse.jetty.servlet.ServletHolder.prepare(ServletHolder.java:759) ~[?:?]
	at org.ops4j.pax.web.service.jetty.internal.PaxWebServletHolder.prepare(PaxWebServletHolder.java:295) ~[?:?]
	at org.ops4j.pax.web.service.jetty.internal.PaxWebServletHandler.doHandle(PaxWebServletHandler.java:316) ~[?:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) ~[?:?]
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600) ~[?:?]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.52.v20230823]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) ~[?:?]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) ~[?:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[?:?]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440) ~[?:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[?:?]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505) ~[?:?]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) ~[?:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[?:?]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355) ~[?:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[?:?]
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:234) ~[?:?]
	at org.ops4j.pax.web.service.jetty.internal.PrioritizedHandlerCollection.handle(PrioritizedHandlerCollection.java:96) ~[?:?]
	... 18 more
Caused by: java.lang.RuntimeException: Unable to load org.eclipse.jetty.websocket.server.WebSocketServerFactory
	at org.eclipse.jetty.websocket.servlet.WebSocketServletFactory$Loader.load(WebSocketServletFactory.java:54) ~[?:?]
	at org.eclipse.jetty.websocket.servlet.WebSocketServlet.init(WebSocketServlet.java:140) ~[?:?]
	at javax.servlet.GenericServlet.init(GenericServlet.java:180) ~[bundleFile:4.0.4]
	at org.ops4j.pax.web.service.spi.servlet.OsgiInitializedServlet.init(OsgiInitializedServlet.java:68) ~[?:?]
	at org.eclipse.jetty.servlet.ServletHolder$Wrapper.init(ServletHolder.java:1345) ~[?:?]
	at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:632) ~[?:?]
	at org.eclipse.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:486) ~[?:?]
	at org.eclipse.jetty.servlet.ServletHolder.prepare(ServletHolder.java:759) ~[?:?]
	at org.ops4j.pax.web.service.jetty.internal.PaxWebServletHolder.prepare(PaxWebServletHolder.java:295) ~[?:?]
	at org.ops4j.pax.web.service.jetty.internal.PaxWebServletHandler.doHandle(PaxWebServletHandler.java:316) ~[?:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) ~[?:?]
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600) ~[?:?]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.52.v20230823]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) ~[?:?]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) ~[?:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[?:?]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440) ~[?:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[?:?]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505) ~[?:?]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) ~[?:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[?:?]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355) ~[?:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[?:?]
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:234) ~[?:?]
	at org.ops4j.pax.web.service.jetty.internal.PrioritizedHandlerCollection.handle(PrioritizedHandlerCollection.java:96) ~[?:?]
	... 18 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.websocket.server.WebSocketServerFactory cannot be found by org.openhab.binding.shelly_4.1.0
	at org.eclipse.osgi.internal.loader.BundleLoader.generateException(BundleLoader.java:541) ~[org.eclipse.osgi-3.18.0.jar:?]
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:536) ~[org.eclipse.osgi-3.18.0.jar:?]
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:416) ~[org.eclipse.osgi-3.18.0.jar:?]
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:168) ~[org.eclipse.osgi-3.18.0.jar:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?]
	at java.lang.Class.forName0(Native Method) ~[?:?]
	at java.lang.Class.forName(Class.java:467) ~[?:?]
	at org.eclipse.jetty.websocket.servlet.WebSocketServletFactory$Loader.load(WebSocketServletFactory.java:48) ~[?:?]
	at org.eclipse.jetty.websocket.servlet.WebSocketServlet.init(WebSocketServlet.java:140) ~[?:?]
	at javax.servlet.GenericServlet.init(GenericServlet.java:180) ~[bundleFile:4.0.4]
	at org.ops4j.pax.web.service.spi.servlet.OsgiInitializedServlet.init(OsgiInitializedServlet.java:68) ~[?:?]
	at org.eclipse.jetty.servlet.ServletHolder$Wrapper.init(ServletHolder.java:1345) ~[?:?]
	at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:632) ~[?:?]
	at org.eclipse.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:486) ~[?:?]
	at org.eclipse.jetty.servlet.ServletHolder.prepare(ServletHolder.java:759) ~[?:?]
	at org.ops4j.pax.web.service.jetty.internal.PaxWebServletHolder.prepare(PaxWebServletHolder.java:295) ~[?:?]
	at org.ops4j.pax.web.service.jetty.internal.PaxWebServletHandler.doHandle(PaxWebServletHandler.java:316) ~[?:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) ~[?:?]
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600) ~[?:?]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.52.v20230823]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) ~[?:?]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) ~[?:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[?:?]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440) ~[?:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[?:?]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505) ~[?:?]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) ~[?:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[?:?]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355) ~[?:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[?:?]
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:234) ~[?:?]
	at org.ops4j.pax.web.service.jetty.internal.PrioritizedHandlerCollection.handle(PrioritizedHandlerCollection.java:96) ~[?:?]
	... 18 more

For funsies I set up a new Docker container with a new OH instance and only the Shelly binding in it. The result is the same, and the exception appears a few minutes after the system boots.
Only configured thing in the test instance was / is a Shelly Plus HT.

I’m using openHAB 4.1.0 and a shelly:shellyplus1.

I have the problem that the temperature is Fahrenheit but it’s displayed as Celsius.
The 57°Cesius in the screenshot is 57° Fahrenheit rsp. 13.8° Celsius

My Shelly Uni is not coming online anymore, so I’m also thinking of using just mqtt. Is it possible to modify the intervals of when data is send or received? eg I only want to read my Uni every 5minutes. Can this be modified on my Shelly device or in OH?

I have a similar issue since I’m using Openhab 4.1.0 - my COAP communication seems to fail.
I’ve been succesfully using coap events for a long time, but it stopped working. I did not change anything on shelly side.
Tested telnet serverip 5683 which was not succesful.


(I would exclude that this is a firewall issue, tried local on server and with disbled firewall. port 8080 in cross check worked fine)

I realized that in shelly manager all message count is 0 - I didn’t not have attention to this number in the past, but looks suspicous to me.

To me it looks like me coap endpoint within shelly binding is not working correctly.
Any help or idea is appreciated

@wborn As you may remember we discussed removing the jetty web socket server artifact from pom.xml ([shelly] Misc changes (small fixes, log improvements, hardened leak prevention on by markus7017 · Pull Request #15922 · openhab/openhab-addons · GitHub). For me it sounds that this doesn’t work.

What do you think?

Usually the binding updates the channels with C and the framework maps this into F
What is your selection under Settings>Regional Settings>(show advanced)>Unit system? Metric or Imperial (US)?

What does that mean? Please be more specific
Which version of OH are you running? Which binding version? What the thing status?
Enable DEBUG output and check openhab.log

Yo did a major OH upgrade :wink:

Is CoAP enabled in the device UI?
Try setting CoIOT to peer mode using Shelly Manager
Enable DEBUG output and check openhab.log

There was one thing I did not try: restart OH. Because my other Shelly devices were working, I thought it was something else… The error was something like waiting for configuration.
But everything is working again.

If there is nothing in the addon that uses this package, you can force a package import for this to be added to the bundle manifest by adding it to the bnd.importpackage property in the POM @markus7017 .

Metric

Sorry for pinging you but this somehow related:
Many of us are using the dev binding which is installed by copying it to the add-on folder.
Everytime a clean cache is performed (e.g. during an openHAB update) the coap transportation bundles are deinstalled. Is there a way for us users to make them „sticky“ so that they are not deinstalled by running clean cache?

1 Like

I’m sorry- my bad. tried to use homeassistant in a docker container (only to integrate my Aqara FP2 and Cupra Born) and started it with default setting

 --net=host

which exposes all host ports to the docker container. This seemed to mess up my Coap Openhab setup. When I stop the docker container Openhab and Shelly Coap is working fine again.
Sorry again and thanks to everyone who helped me out.

@markus7017 could switch to a KAR instead of a JAR so missing Karaf feature dependencies are installed… or you could workaround it by also installing the Tradfri Binding so the coap feature gets reinstalled.