Shelly Binding

fyi:

  • I added support for the ext temp sensors of Shelly 1/1PM (for now the additional channels are static and become N/A when the temp sensors are not installed. I’ll change this to dynamic creation of channels. thanks @hmerk for testing
  • Next will be Shelly Duo, testing with @igi
  • Basic info for EM3 is above, testing with @RolfV, @violine
  • @jcosta46 I just received an EM for testing and will look into the totalEnergy problem
  • @javaboon Did you tried the build with the build I provided?

@RolfV, @violine first build for EM3 is ready to test
https://github.com/markus7017/myfiles/blob/master/shelly/org.openhab.binding.shelly-2.5.2-SNAPSHOT.jar?raw=true

1 Like

Hi Markus,
great! Thank you!
I updated the binding. It works!
In the appendix I have given the physical names and their units as examples for 1 phase.
Maybe you want to change that?

Look at the status output and the output in the PaperUI. Not all values are output.

@violine ok, will have a look to that

general: please don’t use the version in the repo for know, I inform here when problem is fixed

fyi: problem is fixed, dev build ok

external temp sensors for 1/1PM are now supported

does someone has a Shelly Door Window and could help with testing?

Hello Markus,
I’m counting the same problem described by @dilisi. Shortly I got the “UNINITIALIZED” status for Shely HT sensors after system (RPI) reboot and the OH will not receive sensor’s updates . You can find details in my last post on the community:
Unknown status for Shelly H&T Sensor after reboot.
I found until now that if I’ll restart the OH2 service after a system reboot, the define ShellyThings will change the state in “ONLINE”. But If I will again restart the OH2 service the state will again become “UNKNOWN” and I received the following error:

2020-02-29 20:34:42.145 [hingStatusInfoChangedEvent] - ‘shelly:shellyht:f2b672’ changed from INITIALIZING to UNKNOWN

2020-02-29 20:34:42.156 [hingStatusInfoChangedEvent] - ‘shelly:shellyht:f2b670’ changed from INITIALIZING to UNKNOWN

==> /var/log/openhab2/openhab.log <==

2020-02-29 20:34:47.322 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:

java.lang.NullPointerException: null

at org.openhab.binding.shelly.internal.handler.ShellyBaseHandler.authorizationFailed(ShellyBaseHandler.java:616) ~[?:?]

at org.openhab.binding.shelly.internal.handler.ShellyBaseHandler.lambda$0(ShellyBaseHandler.java:134) ~[?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_222]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_222]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_222]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:1.8.0_222]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]

at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]

Please let me know if I should use your developed builds (The official 2.5 SNAPSHOT build or your private 2.5 DEV build ) considering that I’m using now openHAB 2.5.1-2 (Release Build). Please let me know how to proceed next…

Thank you in advance!

yes, please the the dev build
is the device password protected?

Thank you for your prompt respond.
the device is with password protected. The password and user ID that I configure in the sensor WEB API (Internet & Security - > RESTRICT LOGIN ) I’m using inside of Shelly Binding Configuration and also for ShellyThings.

please provide a TRACE Log with the latest DEV build

Hi Markus,
Do you mean the problem with the 3EM?

Nope, for the HT issue above

but I already integrated the missing channels for EM3, will upload a new version later

In general:

  • If the device is in sleep mode there is no way to make it up (AFAIK, also no Wake-on-LAN)
  • the thing will state in state UNKNOWN until the device wakes up and can be initialized - that’s normal
  • even the device is in sleep mode and OH is restarted: that changes nothing to the device status, so it still remembers the IP address of the listener
  • a new event if triggered when the device wakes-up and send to the listener (http callback and/or CoIoT packet)
  • this is received by the binding and triggers an auto-initialization, you should see that in the log
  • once initialized the thing goes ONLINE

If that does not work for you or @dilisi I need a TRACE log showing initialization, restart and next device wakeup/event

My described problem has already been fixed (Shelly Binding). I also have no problem with the openHAB 2.5.1-2 (Release Build).

ok👍

Duo is implemented

@violine please check EM3 channels, please note: total is in the channel as kw/h, not W/min as the device reports

Hi Markus,
Is the download address the same?
https://github.com/markus7017/myfiles/blob/master/shelly/org.openhab.binding.shelly-2.5.2-SNAPSHOT.jar?raw=true

yes, that‘s the location getting continuous updates

Hello thank you for the nice binding. Can everybody help me. I have the follow error when Openhab start.

[ERROR] [y.mdns.internal.MDNSDiscoveryService] - Participant ‘org.openhab.binding.shelly.internal.discovery.ShellyDiscoveryParticipant’ threw an exception

java.lang.IllegalArgumentException: Illegal character in authority at index 7: http://ikhh._sub._http._tcp.local.’ address: '/192.168.178.XXX/settings

How i can update the binding. Only with the snapshot file or can i update the binding to 2.5.2 with a another way ?

Thank a lot for support

Here is a good information:
https://community.openhab.org/t/solved-openhabian-how-do-i-update-one-binding-to-latest-snapshot-only/69324/4
Please use the Karaf-console
https://www.openhab.org/docs/administration/console.html

Uninstall the version via PaperUI then add the jar file to /usr/share/openhab2/addons and restart OH.