Shelly Binding

Please post the output of http://<device ip>/rpc/Shelly.GetConfig und Shelly.GetStatus

2023-09-11 14:33:50.728 [INFO ] [b.core.model.script.Shelly.GetStatus] - Shelly.GetStatus URL:
2023-09-11 14:33:50.729 [INFO ] [b.core.model.script.Shelly.GetStatus] - GetStatus Responce:

2023-09-11 14:33:52.004 [INFO ] [org.openhab.core.model.script.URL   ] - Get.Config URL
2023-09-11 14:33:52.005 [INFO ] [b.core.model.script.Shelly.GetConfig] - GetConfig Responce:

You need to run this link from your browser

I was not able to call the link directly at home’s network so I created a rule that didn’t show “HTTP/1.1 401 Unauthorized” :-). After I red @Oliver2 reply I decided to try the link once again - right hand side is Chrome.

Anyway, the output of Shelly.GetConfig and Shelly.GetStatus is attached below.

Shelly.GetConfig.json (2.0 KB)
Shelly.GetStatus.json (839 Bytes)

I have a question about the accumulated channels/values for a Shelly 3EM device. Since this thread is so long I’m not sure if it was answered already before, sorry.

This could also be a device implementation but not sure if the binding does anything to those numbers.

Speaking about

Both numbers are deviating quite a bit from my official grid powermeter. Both are too high.

So my current guess is that the Shelly device (or binding?) calculates every phase for itself and sums the values up in the end?
Which is most likely something different to what the grid meter does as I expect that it creates a total of the three phases at any point in time and counts that one.
Due to my solar panels (and battery) it happens often that one phase fetches power from the grid while another one feeds back power at the same time.
Therefore both counters are increasing while the grid meter potentially balances those out.

So is the assumption correct? And would this be considered a bug or a feature?

yes, the device doesn‘t provide a total value, so the only thing I could do is to sum up the 3 phases, except someone has a better idea

I guess there is no other choice in that case if the device does not provide the total counter.
Also found related threads somewhere else meanwhile:

For me it’s just cosmetical as I do not rely on energy measurements of the Shelly but just the actual power measurement.

I’m on OH 4.0.1 and try to use Shelly Binding 4.1.0 but receive error:

java.lang.ClassCastException: class org.openhab.binding.shelly.internal.handler.ShellyRelayHandler cannot be cast to class org.openhab.binding.shelly.internal.handler.ShellyThingInterface (org.openhab.binding.shelly.internal.handler.ShellyRelayHandler is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @2d7e3625; org.openhab.binding.shelly.internal.handler.ShellyThingInterface is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @153a7511)

Should that play together?

I’m still looking for a solution on missing Add-on channels as I only have i4dc devices.
So, I’d appreciate ideas/help.

As I mentioned above, this is a bug. This must be fixed by the developer.

In the meantime, feel free to create a bug report on:

Thanks @igi, I as initially posted I’m new to the shelly things. Different people has different preferences and it takes time to understand the binding developer preferences.
Also, as openhab is community driven such issues might be rated as low priority, depending on overall binding stability, so writing in the community should help me and others who encounter similar issues to understand what to expect.

Regarding your initial question: how can I create the channels manually.

The Shelly Binding creates the channels automatically. If they were not created, then it is mostly a bug.
You cannot create the channels manually in this case. Data would not be processed.

What you saw in your debug log is the generic status message from the Shelly device. But currently not all status messages from the data packet are processed by the binding.

You have to be patient until this is fixed. Markus is currently still on vacation.
If it is urgent, you might have to work with MQTT.

Well, I cannot say it’s urgent. I’m trying to restore my setup due to dead Beaglebone Black (I have replaced its gpios with two Shelly Uni and couple of Shelly i4DC + Add-on), so now I’m just missing the room’s temperature and some other sensors data, which is linked to few rules.
Anyway, MQTT usually works well but now I’m running my setup on Synology where 3-rd parity software isn’t welcomed at all (Docker container is an option but I’m afraid that the NAS resources (cpu in particular) will limit me at some point of time).

Will Shelly Wall Display be supported?

Yes, the Wall Display will be supported. Probably is it already in the last 4.1.0 DEV version at Github. Otherwise…soon.
Please remember the Wall Display is not working without the Cloud.
The Binding supports the relay and the sensors.

1 Like

Yes, Wall Display is already supported

I’ll have a look into Addons support for i4/i4DC when I’m back in about 2 weeks

hi @markus7017 ,
I have OH 3.1.0
I want to add Shelly+ 1pm. I tried to use 3.4.5 build jar but I got this error: 1:57:27.045 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/home/adomi/Veev_Server/addons/org.openhab.binding.shelly-3.4.5-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.shelly [295]
Unresolved requirement: Import-Package: org.eclipse.californium.core; version="[2.7.0,3.0.0)

is it possible to use this binding version with my OH? or OH should be updated?

Check READMEbeta

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

1 Like

So before I open an issue - just in case I am missing something blindingly obvious - here’s a funny one
Openhab 4.0.3 stable as openhabian on Pi 4B
Shelly binding installed from UI
Shelly plus 2pm version 1.0.3 with sensor add-on and DS18B20
When discovering the Sghelly and adding it to the things DB the temperature sensor in the add-on is added as a channel only if the Shelly is in switch mode. If in cover mode then the Shelly reports the add-on during the thing add process but the channel never gets created. Is it something obvious I am missing or should I open a bug?

Relevant messages when in switch mode

2023-09-24 19:36:20.445 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplus2pm-c049ef8b2474: Shelly Add-On detected with at least 1 external sensor
2023-09-24 19:36:22.667 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplus2pm-c049ef8b2474: NotifyStatus update received: {"id":1719399656,"src":"shellyplus2pm-c049ef8b2474","dst":"shellyplus2pm-c049ef8b2474","params":{"ble":null,"cloud":{"connected":false},"mqtt":{"connected":false},"sys":{"mac":"C049EF8B2474","restart_required":false,"time":"19:36","unixtime":1695573382,"uptime":86,"ram_size":257964,"ram_free":112932,"fs_size":458752,"fs_free":143360,"cfg_rev":10,"available_updates":null,"webhook_rev":2},"wifi":{"sta_ip":"","status":"got ip","ssid":"HomeAuto","rssi":-46},"input:0":{"id":0,"state":false},"input:1":{"id":1,"state":false},"switch:0":{"id":0,"source":"init","output":false,"apower":0.0,"voltage":227.6,"current":0.0,"pf":0.0,"aenergy":{"total":0.0,"by_minute":[0.0,0.0,0.0],"minute_ts":1695573380},"temperature":{"tC":67.0,"tF":152.6}},"switch:1":{"id":1,"source":"init","output":false,"apower":0.0,"voltage":227.7,"current":0.0,"pf":0.0,"aenergy":{"total":0.0,"by_minute":[0.0,0.0,0.0],"minute_ts":1695573380},"temperature":{"tC":67.0,"tF":152.6}},"temperature:100":{"id":100,"tC":32.8,"tF":91.1}},"result":{"ble":{},"cloud":{"connected":false},"mqtt":{"connected":false},"sys":{"mac":"C049EF8B2474","restart_required":false,"time":"19:36","unixtime":1695573382,"uptime":86,"ram_size":257964,"ram_free":112932,"fs_size":458752,"fs_free":143360,"cfg_rev":10,"available_updates":{},"webhook_rev":2},"wifi":{"sta_ip":"","status":"got ip","ssid":"HomeAuto","rssi":-46},"input:0":{"id":0,"state":false},"input:1":{"id":1,"state":false},"switch:0":{"id":0,"source":"init","output":false,"apower":0.0,"voltage":227.6,"current":0.0,"pf":0.0,"aenergy":{"total":0.0,"by_minute":[0.0,0.0,0.0],"minute_ts":1695573380},"temperature":{"tC":67.0,"tF":152.6}},"switch:1":{"id":1,"source":"init","output":false,"apower":0.0,"voltage":227.7,"current":0.0,"pf":0.0,"aenergy":{"total":0.0,"by_minute":[0.0,0.0,0.0],"minute_ts":1695573380},"temperature":{"tC":67.0,"tF":152.6}},"temperature:100":{"id":100,"tC":32.8,"tF":91.1}}}
2023-09-24 19:36:22.697 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplus2pm-c049ef8b2474: Adding channel sensors#temperature1

As you can see temperature sensor channel is created

Relevant messages when in cover mode

2023-09-24 19:43:58.649 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyplus2pm-c049ef8b2474: Shelly Add-On detected with at least 1 external sensor
2023-09-24 19:44:00.890 [DEBUG] [g.shelly.internal.api2.Shelly2ApiRpc] - shellyplus2pm-c049ef8b2474: NotifyStatus update received: {"id":212392860,"src":"shellyplus2pm-c049ef8b2474","dst":"shellyplus2pm-c049ef8b2474","params":{"ble":null,"cloud":{"connected":false},"mqtt":{"connected":false},"sys":{"mac":"C049EF8B2474","restart_required":false,"time":"19:44","unixtime":1695573840,"uptime":43,"ram_size":257688,"ram_free":109772,"fs_size":458752,"fs_free":143360,"cfg_rev":11,"available_updates":null,"webhook_rev":3},"wifi":{"sta_ip":"","status":"got ip","ssid":"HomeAuto","rssi":-42},"input:0":{"id":0,"state":false},"input:1":{"id":1,"state":false},"cover:0":{"id":0,"source":"init","state":"stopped","apower":0.0,"voltage":226.6,"current":0.0,"pf":0.0,"aenergy":{"total":0.0,"by_minute":[0.0,0.0,0.0],"minute_ts":1695573840},"pos_control":false,"temperature":{"tC":66.9,"tF":152.5}},"temperature:100":{"id":100,"tC":32.8,"tF":91.1}},"result":{"ble":{},"cloud":{"connected":false},"mqtt":{"connected":false},"sys":{"mac":"C049EF8B2474","restart_required":false,"time":"19:44","unixtime":1695573840,"uptime":43,"ram_size":257688,"ram_free":109772,"fs_size":458752,"fs_free":143360,"cfg_rev":11,"available_updates":{},"webhook_rev":3},"wifi":{"sta_ip":"","status":"got ip","ssid":"HomeAuto","rssi":-42},"input:0":{"id":0,"state":false},"input:1":{"id":1,"state":false},"cover:0":{"id":0,"source":"init","state":"stopped","apower":0.0,"voltage":226.6,"current":0.0,"pf":0.0,"aenergy":{"total":0.0,"by_minute":[0.0,0.0,0.0],"minute_ts":1695573840},"pos_control":false,"temperature":{"tC":66.9,"tF":152.5}},"temperature:100":{"id":100,"tC":32.8,"tF":91.1}}}

But sensor temperature channel never added

(no it is not showing if show advanced is clicked either)



it’s pretty simple: I never testet in switch mode; I’ll work on that when back from vacation.
Create an issue so I don’t forget it.

1 Like