Shelly Binding

Thank u Markus.

Marcus finally I found a neutralization.

Steps:

  1. Open Openhab 3.3 GUI like http://192.168.1.130:8080/developer/api-explorer
  2. execute GET (for shelly binding)
  3. copy result and edit PUT method
  4. execute PUT
  5. IP is NULL

:+1:

you could also fund that data in the JSONDB

Hello @markus7017. I am trying not to be high maintenance but I am still struggling with getting the gen2 binding to work. I have followed the github procedure to the letter, several times. The californium and element connectors show up in the bundle list but the binding does not take.
As prescribed at the appropriate time in the process I remove the .things. But they’ll still showing in the OpenHAB dashboard (just not as online). Perhaps this is what is holding up OpenHAB from pulling in the gen2 binding?

dis you tried openhab-cli clean cache?

what do you mean with pulling the gen2 binsing?
you could check OH console for the binding status

I should have mentioned, tried clean-cache as well after stopping and removing the things. The binding gen2 binding will just never show with bundle:list in the openhab console. It is like the file is not in the addons folder

Hello Markus,

do I have to pay attention to something with the authentication?
I have some Pro 4PM and 1 Plus Shellys and I can’t connect with authentication. The message is still that I should check username and password.
Openhab 3.3, Shelly Firmware 10.3, Shelly Binding org.openhab.binding.shelly-3.4.0-gen2.jar from yesterday.

hm, I worked on this and it worked with my test setup
Are you using the password in the binding config (recommended)
or the Thing Config?

User is always admin, password as selected.
Please provide a DEBUG log of the initialization.

The gen2 release is moving more and more to stable. I created already 2 PRs, which needs to be merged to have the final PR, which then merges the Plus/Pro support in the official distro. It would be super helpful if more people supporting on testing. The binding supports both - Gen1 devices (like Shelly 1/2/2.5, sensors etc.) as well as Plus/Pro devices. Now is the time to harden this release before it goes into the official repo. So PLEASE SUPPORT ON TESTING. Just remove the current binding from the admins folder (and save it) and copy the gen2 jar into the folder. Delete things and re-discover, OH will restore the Channel/Item linkage. Don’t forget “openhab-cli backup”.


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]

Hello,

Thank you for the feedback.
I had specified the user data in the thing.
There is still a difference between adding the scanned thing and manually adding (in this case) a Shelly Plus 1.

If I search for devices, he finds e.g. the Shelly Plus 1, in the GUI I can then enter a username and password.
The following is then in the log:

2022-07-27 10:51:40.393 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘shelly:shellydevice:a8032abd93f8’ changed from INITIALIZING to UNKNOWN (CONFIGURATION_PENDING): Initialisierung oder GerĂ€t im Schlafmodus.
2022-07-27 10:51:40.609 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘shelly:shellydevice:a8032abd93f8’ changed from UNKNOWN (CONFIGURATION_PENDING): Initialisierung oder GerĂ€t im Schlafmodus. to OFFLINE (CONFIGURATION_ERROR): Zugriff verweigert. ÜberprĂŒfen Sie Benutzerkennung und Passwort.
2022-07-27 10:51:51.138 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘shelly:shellydevice:a8032abd93f8’ changed from OFFLINE (CONFIGURATION_ERROR): Zugriff verweigert. ÜberprĂŒfen Sie Benutzerkennung und Passwort. to UNKNOWN (CONFIGURATION_PENDING): Initialisierung oder GerĂ€t im Schlafmodus.

If I add a Shelly Plus 1 manually, then I can only specify the password in the GUI. There is no username field.

The following is in the log:

2022-07-27 10:53:54.007 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘shelly:shellyplus1:d76eda6e06’ changed from INITIALIZING to UNKNOWN (CONFIGURATION_PENDING): Initialisierung oder GerĂ€t im Schlafmodus.
2022-07-27 10:53:54.231 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘shelly:shellyplus1:d76eda6e06’ changed from UNKNOWN (CONFIGURATION_PENDING): Initialisierung oder GerĂ€t im Schlafmodus. to OFFLINE (CONFIGURATION_ERROR): Zugriff verweigert. ÜberprĂŒfen Sie Benutzerkennung und Passwort.

On the question of where the user data was specified.
How can I adjust the binding config if it is not a binding that was installed via GUI but added via *.jar file?

Thank you in advance.

Edit:

The scanned device has the following config:

UID: shelly:shellydevice:a8032abd93f8
label: shellyplus1-a8032abd93f8 - 192.168.0.229
thingTypeUID: shelly:shellydevice
configuration:
deviceIp: 192.168.0.229
userId: admin
password: pass

The manually added device, the following:

UID: shelly:shellyplus1:fc7c0a03f1
label: ShellyPlus 1 (SNSW-001X16EU")
thingTypeUID: shelly:shellyplus1
configuration:
deviceIp: 192.168.0.229
password: pass
updateInterval: 60

Hi, I have over 30 Shelly devices with ‘non-admin’ username.
if I wanna test your gen2 binding I have to change all usernames back to admin?

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?