Shelly - Thing doesn't have power meters using configuration file

Hi guys,

I was using over a year Home Assistant, it’s great, until some update is available and there are braking changes. It’s really hard to reconfigure everything from scratch. My UI files had few thousands lines.
To make story short I started using openhab in this week.
I already configured most of the stuff I really want, but I came into some problems regarding Shelly devices.

I would rather like to use a configuration file for most of the stuff. Here is the code:

Thing shelly:shellyplugs:pc “Shelly: PC Plug” @ “Office” [ deviceIp=“192.168.31.241”, updateInterval=“600” ]

As you can see I am using shellyplugs which should have meters channels inside

In paper UI those things appear like this (without power meter channels):
Thing added using configuration files

Power meters are missing, so I added the same using Paper UI and it looks like this:
Thing added using Paper UI

Both should have channels for Power Meters, but the only thing configured using Paper UI has that.

Thing type is specified correctly, so I don’t have any idea how to solve this. There is nothing inside the documentation about using configuration path and missing channels.

Thank you for your time and ideas in advance
Bartek

Defining .things files for bindings that support automatic discovery is usually pretty lacking. Many of the binding developers prefer you to use the automatic discovery because often there is more capability (e.g. the Zwave binding only allows setting configuration parameters on devices that have been discovered). It also means a lot less documentation. Many of us here on the forum (myself included) prefer discovered Things too because you will never get a syntax error with such Things and all Channels are present and accounted for.

Ultimately I think your best bet will be to install the REST API Docs (interactive docs where you can interact with the API, installed from the UIs tab in PaperUI) and pull the JSON that defines the automatically discovered Thing and compare it with what is in your .thing file definition. Alternatively you can just look in the JSONDB file directly with a text editor. It’s located at $OH_USERDATA/jsondb/org.eclipse.smarthome.core.thing.Thing.json. Often one can discover the names of missing fields and the like that way.

Oh I see and then somehow I can add missing channels via configuration file to that thing. Is that correct?

I assume so. It all depends on what the binding expects.

Reading the Documentation I found this:

If a channel is missing make sure the thing was discovered correctly and is ONLINE. If a channel is missing delete the thing and re-discover it.

Edit:
Scanning the whole Documentation reveals the PlugS doesn’t support those channels.

How it doesnt support that, check section
Shelly Plug-S (thing-type: shellyplugs) it clearly says meter is available and as I mentioned that I can Access that file adding it via paper UI. Actually I cant Discover Shelly devices automatically. Only one thing was discovered, other devices not appearing there.

That feels like a clue … do you need to give them individual IDs, or even IPs, or should that all be auto ?

I have to provide IPs to all of them and add them manually via PaperUI so thats why I switched to config via file. Easier to maintain and to add than adding 8 devices manually using UI.

Okay. If they cannot be discovered as expected, they’re not going to manually configurable either. What firmware version(s) do you have, are you using iP v6 or VPN or cross-domain, are you using CoIoT or CoAP methods?

Every device is on my local Network connected via WiFi - Shelly firmware v1.8.3 newest one. I dont get it why you said that they are not going to manually configure either since I can do that using ipAddress connection? What is the difference between them?

I’m just saying if something is broken enough not to do an expected discovery (and you do not seem to have any circumstances that would block discovery), then no amount of xxx.things file editing is going to fix it.

I’m sorry, I missunderstiod the ( somewhat empty) table.

I found solution to my problem:

So actually I only needed the right syntax around Channel items.

2 Likes

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.