Shelly Binding

no,
for Gen1 the binding takes the configured userid+password and does a HTTP basic auth
for Gen2 only the password is relevant, the devices don’t allow to setup a different user id so I removed it from thing config for Gen2 devices. Gen2 devices require a digest auth.

I recommend

  • use the same password for all devices
  • specify the password in the binding config
  • in this case it works across all devices
  • this also means you don’t need to edit each device config

@MiniOh
To set the password in the binding config,

  • Go to Things
  • click +
  • you see the Shelly binding and beside the cogwheel, click this and you get into the binding settings

this should be done before you start the discovery. Otherwise, the binding will create a thing of type shellydevice. If you then setup the user/password it and auth is successful it will switch to the correct thing type (@MiniOh this is also the difference when discovering the device vs. adding manual).

I it doesn’t work for you enable DEBUG log and post the thing initialization here as a text file

I tested a Plus 2PM with auth enabled and it works here. I could try also a Pro device

I did’t try to addf a password-protected device using a .things definition. Let’s focus on adding via UI.

OK thank you.
Setting the password in the binding instead of in the thing via UI works immediately and the device is online.

ok, then I need to check password via thing config

please try the updated build

Hi all,

Is the TRV supported in the current prod/standard binding or will I need to install the DEV build?

Also, is there any good documentation on how to update the standard binding in OH3 or does it just do it automagically? Or does it only get updated when you update OH3 itself?

Thanks,

Ben

Working :+1:

Hi,

yes, TRV is supported, please use the gen2 build.

DEV/gen2 build must not be installed in parallel to the version, which comes with the distro.

In general: Uninstall der Dist version from the UI, copy the Californium and gen2 jar to the adding folder, see READMEbeta.


3.4.0-Gen2 build for Plus/Pro+Gen1 | 3.4.0-DEV Gen1 stable build
README | READMEbeta for more info on first installation
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]

Hey there,
I just updated to OH3.3 and also migrated from Gen1 Shelly binding to Gen2. So far everything works fine for the Gen1 devices. Even my good old shelly4pro.
I also added one of the new black shellypro4pm using auto-discovery but havent been able to see the power-consumption channels for each of the 4 realy’s. Theres only an “Accumulated Power Consumption” available.
Is currentWatts & totalKWH not jet implemented for the dedicated relays or am I doing something wrong?
Thanks much for your help
Sebastian

Thanks. If I upgrade OpenHAB from 3.2 to 3.3 will I get a new version of the Shelly binding that recognises the TRV or will I still need to install the DEV/gen2 build after the upgrade?

No. If I understood correctly you will get TRV-support with the 3.4 release (October?).
If you want it now you need the developer version. Read the readme 3posts above.

Edit: my bad, was fixed on Gen2-support.

No, TRV is already supported.

My bad, was thinking about gen 2

I’m using 3.4 with Shelly1 and temperature sensors. I’ve alleady some Shelly1 I did configure under 3.3 which are ok. Now I added a Temperature sensor to another Shelly1 under 3.4. The temperature sensor is shown in the shelly interface but not in openhab. I did a delete and rescann, but no difference. No channel data for the temperature sensor is shown.

Apologies, just to clarify:

If I upgrade OH from 3.2 to 3.3 it will automatically install version 3.3 of the Shelly binding which includes support for the TRV?

This means that I don’t need to install the Dev version, correct?

If this is all true, how does it know whether to upgrade to the gen1 or gen2 version of the binding? And which version of the binding is installed by default on a new OpenHAB installation?

Apologies if answered before but why are there two versions of the binding? What if I have both gen1 and gen2 devices on my network, which should I use?

Thanks,

Ben.

Thank you very much for your effort @markus7017 .
Successfully installed the 3.4.0 Beta to get my two 2PMs (connected to the shelly 2x wall switch) into openhab.
Not sure if I’m doing something wrong or it’s simply not (yet) supported. Unfortunately I was not able to find any info on if this is the case.

I’m trying to set up (multi) button-presses within latest version of Openhab 3 and the beta of the binding to activate some rules.

rule "test button press"
when
    Channel "shelly:shellyplus2pm-relay:485519a284e8:relay1#button" triggered
then
    logInfo ("schalter.rules", "shelly button pressed")
end

But nothing is happening/showing up in the logs when I’m pressing the left button of the wall switch.
When I configure the channel via UI, it keeps being “idle” and also no other rule is executed - only when I manually “run” the rule. But not when triggered by the physical button.

Sidenote:

Any idea of what I’m missing or is it the (currently) expected outcome?

Edit:
I changed eventsCoIoT to “false” (was true) and now I see some data in debugging. Seems (!) to have made a difference…
But something really weird whenever I press a button now:

“Thing ‘shelly:shellyplus2pm-relay:485519a284e8’ changed from UNKNOWN (CONFIGURATION_PENDING): The device was restarted and is again being initialized” to Online

For gen2 devices, you need the dev version. This is independent to TRV support.

If the 3.3.0 version discovers the TRV you are fine, otherwise you need to uninstall this one from the UI and install the -gen2 build following the instructions.

I‘m in the process to merge the current code base into the dist, but my expectation is that this will take another 3-6 weeks.

In the meantime use the gen2 build. Hardening for Gen1 devices is almost done, now we move to the gen2 devices and just today I received dev samples of all new devices Shelly presented on their event.

3.4.0-Gen2 build for Plus/Pro+Gen1 | 3.4.0-DEV Gen1 stable build
README | READMEbeta for more info on first installation
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]

I‘ll check the Pro 4PM

Did you tried the latest Gen2 build? I just did some fixing a few days ago

will add this to the test list for Gen2

Thank, newest build solved this. The temperature channel is shown.

the newest build shows an error:

> 2022-07-30 10:31:18.031 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
> java.lang.NoClassDefFoundError: org/openhab/binding/shelly/internal/api1/Shelly1ApiJsonDTO$ShellyStatusLight
> 	at org.openhab.binding.shelly.internal.api1.Shelly1HttpApi.getLightStatus(Shelly1HttpApi.java:286) ~[?:?]
> 	at org.openhab.binding.shelly.internal.handler.ShellyLightHandler.updateDeviceStatus(ShellyLightHandler.java:330) ~[?:?]
> 	at org.openhab.binding.shelly.internal.handler.ShellyBaseHandler.refreshStatus(ShellyBaseHandler.java:499) ~[?:?]
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
> 	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[?:?]
> 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[?:?]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
> 	at java.lang.Thread.run(Thread.java:834) [?:?]
> Caused by: java.lang.ClassNotFoundException: org.openhab.binding.shelly.internal.api1.Shelly1ApiJsonDTO$ShellyStatusLight cannot be found by org.openhab.binding.shelly_3.4.0.202207162149
> 	at org.eclipse.osgi.internal.loader.BundleLoader.generateException(BundleLoader.java:529) ~[org.eclipse.osgi-3.17.200.jar:?]
> 	at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:524) ~[org.eclipse.osgi-3.17.200.jar:?]
> 	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:416) ~[org.eclipse.osgi-3.17.200.jar:?]
> 	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:168) ~[org.eclipse.osgi-3.17.200.jar:?]
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[?:?]
> 	... 9 more