Shelly Binding

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.

Hello Markus,

Thank you again for your complete answer. I’m not sure why is still not working for me. I tried again to add the Shelly sensors via Paper UI to openhab2 after:

  • I remove the things/items related to them and clear the catch.
    But I got the following messages in log file after I included in OH2:

2020-03-01 20:21:53.194 [WARN ] [y.internal.handler.ShellyBaseHandler] - shellyht-f2b670: WARNING: Firmware might be too old (or beta release), installed: /20181128-144724 (), required minimal v1.5.2. The binding was tested with version 1.50+ only. Older versions might work, but do not support all features or show technical issues. Please consider upgrading to v1.5.0 or newer!

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

2020-03-01 20:21:53.202 [me.event.ThingUpdatedEvent] - Thing ‘shelly:shellyht:f2b670’ has been updated.

2020-03-01 20:21:53.613 [me.event.ThingUpdatedEvent] - Thing ‘shelly:shellyht:f2b670’ has been updated.

2020-03-01 20:21:53.637 [me.event.ThingUpdatedEvent] - Thing ‘shelly:shellyht:f2b670’ has been updated.

2020-03-01 20:21:53.639 [hingStatusInfoChangedEvent] - ‘shelly:shellyht:f2b670’ changed from UNKNOWN to ONLINE

2020-03-01 20:21:53.668 [vent.ItemStateChangedEvent] - Shellyht_Temp_Birouri changed from NULL to 21.90 °C

2020-03-01 20:21:55.813 [vent.ItemStateChangedEvent] - Shellyht_Temp_Birouri changed from 21.90 °C to 21.88 °C

2020-03-01 20:22:32.315 [temChannelLinkRemovedEvent] - Link ‘Shellyht_Temp_Birouri => shelly:shellyht:f2b670:sensors#temperature’ has been removed.

2020-03-01 20:25:20.410 [.ItemChannelLinkAddedEvent] - Link ‘Shellyht_Birouri_Temperature-shelly:shellyht:f2b670:sensors#temperature’ has been added.

2020-03-01 20:25:43.175 [me.event.ThingUpdatedEvent] - Thing ‘shelly:shellyht:f2b670’ has been updated.

2020-03-01 20:25:45.166 [hingStatusInfoChangedEvent] - ‘shelly:shellyht:f2b670’ changed from ONLINE to UNKNOWN

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

2020-03-01 20:25:50.168 [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]

And after weakup event:

2020-03-01 21:28:57.924 [hingStatusInfoChangedEvent] - 'shelly:shellyht:f2b670' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)

2020-03-01 21:28:57.971 [hingStatusInfoChangedEvent] - 'shelly:shellyht:f2b670' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING

2020-03-01 21:28:58.505 [me.event.InboxRemovedEvent] - Discovery Result with UID 'shelly:shellyht:f2b672' has been removed.

2020-03-01 21:29:00.003 [hingStatusInfoChangedEvent] - 'shelly:shellyht:f2b670' changed from INITIALIZING to UNKNOWN

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

2020-03-01 21:29:04.997 [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 still need to install your dev build even I’m using now openHAB 2.5.1-2 (Release Build).
Another thing:
I’m not sure if the checkbox present i the sensor Web GUI -> Internet & Security -> Enable action execution via CoAP (CoIOT) protocol.
I checked it since I sow that it’s used for sensor comunication (by default was not checked) 

Also as you can see in the log message the sensors have old firmware (20181128-144724). I tried to upgrade via Web GUI or following those instructions but It didn’t work.

Maybe this is related to my issue.

Please let me know what I could do next!
Thank you for your support !

That means

  • your firmware is very old (2018)
  • you are not using the current binding version, you should see a message that requests 1.5.2+

Don’t use the version you in stall in PaperUI, this has to be deinstalled. Get the DEV build from the link provided and copy it to the addons folder

no need for

Hello Markus,
Please let me know how I can install the latest firmware. I tried to upgrade via Web GUI or following those instructions but It didn’t work. In the WEB GUI I found the message that I’m using the last version and If I tried the instruction from the upper link I recieved the following msg:
{“status”:“updating”,“has_update”:false,“new_version”:"",“old_version”:“20181128-144724/???”}

check the information here: https://github.com/markus7017/myfiles/blob/master/shelly/READMEbeta.md
replace 2.5.1 by 2.5.2

Is the HT connected to the Internet?

@marian.tudor I sent you a PM

Hi Markus,

I have a ShellyEM connected to my solar panels and i’m receiving data. Both P1 and P2 are connected. I also have grafana and influxdb to visualise and calculate the watt’s.

But i have an issue when the returned value’s are 0, it seems like that 0 value’s are not always stored for some reason. See screenshot below, (green line)

When i execute a query for the P1 i see only these value’s listed while the solar panels are connected for 2/3 weeks from now. I should expect more especially during the night.

select * from ShellyEMSHEM_Meter1_Watt where value=0
name: ShellyEMSHEM_Meter1_Watt
time value


1582211969696000000 0
1582215169884000000 0
1582303050969000000 0
1582385102060000000 0
1582469083687000000 0
1582472886131000000 0
1582476387330000000 0
1582560833034000000 0
1582648599437000000 0
1582735990639000000 0
1582820637895000000 0
1582903561061000000 0
1582995963708000000 0
1583081902047000000 0
1583166024211000000 0

When I connect to my shellyem using http://x.x.x.x/status
I see 0 value’s during evening/night.

for example, the database contains value’s like these.

select * from ShellyEMSHEM_Meter1_Watt limit 20
name: ShellyEMSHEM_Meter1_Watt
time value


1582211849006000000 -71.44
1582211909337000000 -68.78
1582211969696000000 0
1582212694125000000 -108.99
1582212754495000000 -107.73
1582212814841000000 -100.92
1582212875269000000 -95.66
1582212935623000000 -100.37
1582212995974000000 -103.7
1582213056391000000 -102.95
1582213116740000000 -104.27
1582213177155000000 -97.87
1582213237515000000 -95.73
1582213297862000000 -96.13
1582213358271000000 -93.03
1582213418640000000 -88.02
1582213479003000000 -86.93
1582213539468000000 -84.2
1582213599883000000 -84.85
1582213660210000000 -83.27

Thank you!

1 Like

What’s in your persistence file? (You are storing these values through persistence to InfluxDB?) The default is every change which means that a long set of 0’s won’t get stored. You might want to force an update periodically by time. Or try every update. See this on persistence. Apologies if you’ve already done this.

Good point! i’m very new to openhab but i think you put to the right direction.

I had configured on everyChange, and I changed that to everyMinute which seems like to solution. Grafana is showing me also 0 values.

Strategies {
everyMinute : “0 * * * * ?”
everyHour : “0 0 * * * ?”
everyDay : “0 0 0 * * ?”
}

Items {
gHeatAct*, gHeatSet*, gHeatValve* : strategy = everyChange, everyHour
ShellyEMSHEM_Meter1_Watt,ShellyEMSHEM_Meter2_Watt : strategy = everyMinute
}

Thank you!

Very cool! Do you like to contribute a how-to as a practical use case?

Hi Markus,

No problem! let me know where :slight_smile:

I would suggest adding this to the README
Just send me a text block+the image (markup format) and I will copy that into the README

fyi:

I‘m planning to close the current PR at the weekend. This comes together with firmware 1.6 for the Shelly devices, which include significant CoIoT improvements (fixes + new status values). This allows using CoIoT updates for most of the sensor values near-realtime. Due to reduced polling it also addresses the timeout issue (I see ghat ver rare, but it‘s not gone).

It‘s 1.6-rc5, which is already close to the final release coming in March. @igor and I did already lots of testing, quality is good and we have an excellent back channel to their dev team.

If you are interested to support with testing send me a PM and I‘ll provide infos to get access to the latest DEV build and beta firmware

Again, I‘m still looking for someone with Door Window. Alterco can‘t provide test samples, because they have Corona impacted productions delays.

hi!
found this page at https://www.shelly-support.eu/forum
i c that you need somthing bout DW. what you need? i’ve 2 devices here. one an garage door, ond on desk near me.
new in OH but over 50 shellys on stage dancing the time warp again! :smiley:
wir können uns aber auch gern auf deutsch untehalten

simon / da_Woody

1 Like