Shelly Binding

maybe you check this thread
2 days ago I wrote

The post describes to go forward with the DEV build or go back with an older firmware release

My Shelly devices (1, 2.5, dimmer, dimmer 2, H&T) auto updated themselves to 1.8.
Nothing is currently working.

I installed markus7017’s 2.5.8.202008141656 dev snapshot, which didn’t change anything.
Edit: Things are currently working with the dev snapshot, but I’m still interested in the future of the binding repo.

Is the main repo being updated to support 1.8 firmware? As far as I can see there are no activity (no PR no issues and so on), and last update was a year ago. What is the future for Shelly <-> OpenHAB integration?

Is it possible to downgrade the firmware in the devices?

If you check openHAB addons repo on github, you will find a lot of activity from @markus7017 regarding Shelly binding. Donā€˜t look at his private repos.
And yes, he is working on FW1.8 support, thatā€˜s why the dev version exists.

Aha, that’s wonderful. Thanks!

Let me know if I can be of any help markus7017.

We have the following repos

I tried the latest DEV build with ix3 running 1.7 and 1.8, it worked in both modes.

You need to change the button type to Momentary Switch, you have selected toggle mode

ā€œbtn_typeā€:ā€œtoggleā€

Go to the WebUI and select the correct button type for each channel.

I uploaded a new DEV build

  • fixes missing channel updates after thing configuration was updated
  • activated REST updates in parallel to CoAP 2 (like with CoAP 1)
  • refresh seetings when updated in Shelly App (CoAP v2 only)
  • fixed a pot. initial timing issue with CoAP discovery

An updated API Doc has been published by Alterco:
https://shelly-api-docs.shelly.cloud/?fbclid=IwAR23ukCi_3aBSTPRHYUIcpr0pLi0vcyL0fF0PnJQdFvkkc8_Zo5LkAcli_A#http-server


I need more testers. It’s time to contribute. Please also post an info here when you successfully updated your environment. Please include firmware version (1.7 or 1.8) in your post.

Again: DO NOT UPGRADE TO FIRMWARE VERSION 1.8.0 IF YOU DON’T WANT TO USE THE DEV BUILD. Version 1.8 breaks the CoIoT support of binding version included in openHAB Addon pack 2.5.7 and I’m not expecting that the current code base becomes part of version 2.5.8

Have fun :slight_smile:


Update 08/16 5pm

I updated the DEV build

  • feature: Detect the change of CoAP 1 to CoAP 2 message format (after upgrade from fw version 1.7 to 1.8) and re-discover.
  • feature: Use configured device name for building the label of discovered devices (could be set in the Shelly Web App)
  • fix: Support for CoAP 2 updates of multiple external sensors; CoAP updates for humidity verified
  • fix: Decoding for new button event types SHORT_LONG and LONG_SHORT added (Shelly ix3), trigger PRESSED renamed to TRIPLE_PRESSED (3x Shortpush)

Today I tested firmware 1.8 with Shelly 1+Addon, 1PM+Addon, 2.5, DW2, H&T, Flood. Looks good so far. Alterco intends to release version 1.8.2 next week.

The only thing I noticed is the latency with ix3 when pressing the button it takes 2-3sec until I see the channel update. Other devices are way faster, will re-check again.

Did someone tested with RGBW2 and input of other devices?


Latest DEV build - README - Installation - Firmware Index - Firmware Archive - API Doc


1 Like

Do you have COAP turned on for that device? That massively improved the input channel response for me. Pretty much instant now.

Hi Markus, I will try and update ASAP and test RGBW2 on 1.8 for you. I also have Dimmer and Dimmer 2 if you need feedback on those?

Hi @markus7017 ,

I have several Shelly devices running. Everything seems to be working on the DEV-Build except my Shelly EMs. I have two EMs installed to measure the power consumption of a dryer, a dishwasher and an A/C device. The dryer (Trockner) and the dishwasher (Spülmaschine) are connected to the first EM. The a/c (Klima) is connected to the second one.
I started using firmware 1.7.4. The dishwasher showed some pretty bizarre behaviour. It switched sign of the power consumption as you can see in below log (-6.5 to 6.9 e.g.). I tried to put the event log and the debug/trace log together hoping it would make it easier for you to understand what is happening. I did not have any kind of this behaviour using the release addon.
At first sight I would assume that the CoIoT messages and the http request updates do not match and that is why it is alternating. Is the CoIoT update always unsigned? Just a guess…

Dish Washer:

Summary
2020-08-17 15:13:55.836 [vent.ItemStateChangedEvent] - spuelmaschine_leistung changed from -6.6 to -6.4
2020-08-17 15:13:59.033 [vent.ItemStateChangedEvent] - spuelmaschine_leistung changed from -6.4 to -6.5

2020-08-17 15:13:59.753 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7f8be: CoIoT Message from /SHELLYEM1IP:5683 (MID=28959): {"G":[[0,112,0],[0,111,-6.716371],[0,121,6.947970]]}
2020-08-17 15:13:59.755 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7f8be: CoIoT Sensor data {"G":[[0,112,0],[0,111,-6.716371],[0,121,6.947970]]}
2020-08-17 15:13:59.756 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7f8be: 3 CoAP sensor updates received
2020-08-17 15:13:59.756 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7f8be:  Sensor value[0]: id=112, Value=0.0 (State, Type=S, Range=0/1, Link=0: Relay0)
2020-08-17 15:13:59.757 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7f8be:  Sensor value[1]: id=111, Value=-6.716371 (Power, Type=P, Range=0/2300, Link=0: Relay0)
2020-08-17 15:13:59.758 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7f8be:  Sensor value[2]: id=121, Value=6.94797 (Power, Type=P, Range=0/2300, Link=1: Device)
2020-08-17 15:13:59.763 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellyem-c7f8be: Channel meter1#currentWatts updated with 6.9 W (type class org.eclipse.smarthome.core.library.types.QuantityType).
2020-08-17 15:13:59.764 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7f8be: 1 channels updated from CoIoT status, serial=771

2020-08-17 15:13:59.762 [vent.ItemStateChangedEvent] - spuelmaschine_leistung changed from -6.5 to 6.9

2020-08-17 15:14:02.037 [TRACE] [y.internal.handler.ShellyBaseHandler] - shellyem-c7f8be: Updating status
2020-08-17 15:14:02.038 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shellyem-c7f8be: HTTP GET for http://SHELLYEM1IP/status
2020-08-17 15:14:02.137 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shellyem-c7f8be: HTTP Response 200: {"wifi_sta":{"connected":true,"ssid":"MYWIFISSID","ip":"SHELLYEM1IP","rssi":-37},"cloud":{"enabled":true,"connected":true},"mqtt":{"connected":false},"time":"15:14","unixtime":1597677241,"serial":2,"has_update":true,"mac":"ECFABCC7F8BE","relays":[{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"is_valid":true}],"emeters":[{"power":-6.69,"reactive":4.06,"voltage":236.39,"is_valid":true,"total":7553.7,"total_returned":8198.7},{"power":6.86,"reactive":-6.20,"voltage":236.39,"is_valid":true,"total":22851.8,"total_returned":0.0}],"update":{"status":"pending","has_update":true,"new_version":"20200813-140346/v1.8.1@1b2a49be","old_version":"20200702-133509/v1.7.4@1d8b9fca"},"ram_total":49312,"ram_free":34984,"ram_lwm":29336,"fs_size":233681,"fs_free":158632,"uptime":11505}
2020-08-17 15:14:02.139 [TRACE] [.internal.handler.ShellyRelayHandler] - shellyem-c7f8be: Updating 1 relay(s)
2020-08-17 15:14:02.140 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shellyem-c7f8be: HTTP GET for http://SHELLYEM1IP/status/relay/0
2020-08-17 15:14:02.222 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shellyem-c7f8be: HTTP Response 200: {"wifi_sta":{"connected":true,"ssid":"MYWIFISSID","ip":"SHELLYEM1IP","rssi":-37},"cloud":{"enabled":true,"connected":true},"mqtt":{"connected":false},"time":"15:14","unixtime":1597677241,"serial":2,"has_update":true,"mac":"ECFABCC7F8BE","relays":[{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"is_valid":true}],"emeters":[{"power":-6.69,"reactive":4.06,"voltage":236.39,"is_valid":true,"total":7553.7,"total_returned":8198.7},{"power":6.86,"reactive":-6.20,"voltage":236.39,"is_valid":true,"total":22851.8,"total_returned":0.0}],"update":{"status":"pending","has_update":true,"new_version":"20200813-140346/v1.8.1@1b2a49be","old_version":"20200702-133509/v1.7.4@1d8b9fca"},"ram_total":49312,"ram_free":35172,"ram_lwm":29336,"fs_size":233681,"fs_free":158632,"uptime":11505}
2020-08-17 15:14:02.224 [TRACE] [y.internal.handler.ShellyBaseHandler] - shellyem-c7f8be: Updating 2 e-meter(s)
2020-08-17 15:14:02.226 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellyem-c7f8be: Channel meter1#currentWatts updated with -6.7 W (type class org.eclipse.smarthome.core.library.types.QuantityType).
2020-08-17 15:14:02.244 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellyem-c7f8be: Channel meter2#currentWatts updated with 6.9 W (type class org.eclipse.smarthome.core.library.types.QuantityType).
2020-08-17 15:14:02.246 [TRACE] [y.internal.handler.ShellyBaseHandler] - shellyem-c7f8be: 1 more updates requested

2020-08-17 15:14:02.240 [vent.ItemStateChangedEvent] - spuelmaschine_leistung changed from 6.9 to -6.7
2020-08-17 15:14:14.782 [vent.ItemStateChangedEvent] - spuelmaschine_leistung changed from -6.7 to 6.8
2020-08-17 15:14:17.642 [vent.ItemStateChangedEvent] - spuelmaschine_leistung changed from 6.8 to -6.4
2020-08-17 15:14:29.784 [vent.ItemStateChangedEvent] - spuelmaschine_leistung changed from -6.4 to 7.1
2020-08-17 15:14:32.833 [vent.ItemStateChangedEvent] - spuelmaschine_leistung changed from 7.1 to -6.6
2020-08-17 15:14:44.791 [vent.ItemStateChangedEvent] - spuelmaschine_leistung changed from -6.6 to 7.4
2020-08-17 15:14:45.028 [vent.ItemStateChangedEvent] - spuelmaschine_leistung changed from 7.4 to -6.6
2020-08-17 15:14:59.794 [vent.ItemStateChangedEvent] - spuelmaschine_leistung changed from -6.6 to 7.0
2020-08-17 15:15:00.428 [vent.ItemStateChangedEvent] - spuelmaschine_leistung changed from 7.0 to -6.4
2020-08-17 15:15:14.799 [vent.ItemStateChangedEvent] - spuelmaschine_leistung changed from -6.4 to 7.1
2020-08-17 15:15:15.640 [vent.ItemStateChangedEvent] - spuelmaschine_leistung changed from 7.1 to -6.5

The dryer seems to be working alright but it does not receive any updates via CoIoT. It receives http updates only. Probably that is the reason why it is working. Still it is not the desired behaviour since there should be CoIoT updates.

Dryer:

Summary
2020-08-17 15:13:55.838 [vent.ItemStateChangedEvent] - trockner_leistung changed from 7.5 to 7.1

2020-08-17 15:13:59.023 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shellyem-c7f8be: HTTP Response 200: {"wifi_sta":{"connected":true,"ssid":"MYWIFISSID","ip":"SHELLYEM1IP","rssi":-37},"cloud":{"enabled":true,"connected":true},"mqtt":{"connected":false},"time":"15:13","unixtime":1597677237,"serial":2,"has_update":true,"mac":"ECFABCC7F8BE","relays":[{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"is_valid":true}],"emeters":[{"power":-6.54,"reactive":3.85,"voltage":236.32,"is_valid":true,"total":7553.7,"total_returned":8198.7},{"power":7.16,"reactive":-6.21,"voltage":236.32,"is_valid":true,"total":22851.8,"total_returned":0.0}],"update":{"status":"pending","has_update":true,"new_version":"20200813-140346/v1.8.1@1b2a49be","old_version":"20200702-133509/v1.7.4@1d8b9fca"},"ram_total":49312,"ram_free":34836,"ram_lwm":29336,"fs_size":233681,"fs_free":158632,"uptime":11502}
2020-08-17 15:13:59.024 [TRACE] [y.internal.handler.ShellyBaseHandler] - shellyem-c7f8be: Updating 2 e-meter(s)
2020-08-17 15:13:59.025 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellyem-c7f8be: Channel meter1#currentWatts updated with -6.5 W (type class org.eclipse.smarthome.core.library.types.QuantityType).
2020-08-17 15:13:59.028 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellyem-c7f8be: Channel meter2#currentWatts updated with 7.2 W (type class org.eclipse.smarthome.core.library.types.QuantityType).
2020-08-17 15:13:59.036 [TRACE] [y.internal.handler.ShellyBaseHandler] - shellyem-c7f8be: 1 more updates requested

2020-08-17 15:13:59.034 [vent.ItemStateChangedEvent] - trockner_leistung changed from 7.1 to 7.2
2020-08-17 15:14:02.244 [vent.ItemStateChangedEvent] - trockner_leistung changed from 7.2 to 6.9
2020-08-17 15:14:05.457 [vent.ItemStateChangedEvent] - trockner_leistung changed from 6.9 to 7.0
2020-08-17 15:14:17.646 [vent.ItemStateChangedEvent] - trockner_leistung changed from 7.0 to 7.1
2020-08-17 15:14:32.842 [vent.ItemStateChangedEvent] - trockner_leistung changed from 7.1 to 6.6
2020-08-17 15:14:45.032 [vent.ItemStateChangedEvent] - trockner_leistung changed from 6.6 to 7.5
2020-08-17 15:14:51.253 [vent.ItemStateChangedEvent] - trockner_leistung changed from 7.5 to 7.1
2020-08-17 15:15:00.434 [vent.ItemStateChangedEvent] - trockner_leistung changed from 7.1 to 6.6
2020-08-17 15:15:15.646 [vent.ItemStateChangedEvent] - trockner_leistung changed from 6.6 to 6.9
2020-08-17 15:15:30.845 [vent.ItemStateChangedEvent] - trockner_leistung changed from 6.9 to 6.4

The second EM shows similar behaviour to the first one, to be more precisely to the dishwasher and its alternating problem. Here it is somehow different changing from a realistic value (around 700) to nothing (0). Again, this behaviour is new to the DEV-Build.

A/C:

Summary
2020-08-17 15:13:56.274 [vent.ItemStateChangedEvent] - klima_leistung changed from 710.5 to 707.4
2020-08-17 15:13:59.500 [vent.ItemStateChangedEvent] - klima_leistung changed from 707.4 to 710.7
2020-08-17 15:14:02.685 [vent.ItemStateChangedEvent] - klima_leistung changed from 710.7 to 712.9

2020-08-17 15:14:04.066 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2: CoIoT Message from /SHELLYEM2IP:5683 (MID=30095): {"G":[[0,112,0],[0,111,710.978079],[0,121,0.000000]]}
2020-08-17 15:14:04.068 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2: CoIoT Sensor data {"G":[[0,112,0],[0,111,710.978079],[0,121,0.000000]]}
2020-08-17 15:14:04.070 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2: 3 CoAP sensor updates received
2020-08-17 15:14:04.071 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2:  Sensor value[0]: id=112, Value=0.0 (State, Type=S, Range=0/1, Link=0: Relay0)
2020-08-17 15:14:04.072 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2:  Sensor value[1]: id=111, Value=710.978079 (Power, Type=P, Range=0/2300, Link=0: Relay0)
2020-08-17 15:14:04.074 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2:  Sensor value[2]: id=121, Value=0.0 (Power, Type=P, Range=0/2300, Link=1: Device)
2020-08-17 15:14:04.076 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellyem-c7eb54: Channel meter1#currentWatts updated with 0.0 W (type class org.eclipse.smarthome.core.library.types.QuantityType).
2020-08-17 15:14:04.077 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2: 1 channels updated from CoIoT status, serial=29505

2020-08-17 15:14:04.079 [vent.ItemStateChangedEvent] - klima_leistung changed from 712.9 to 0.0

2020-08-17 15:14:05.818 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shellyem-c7eb54: HTTP Response 200: {"wifi_sta":{"connected":true,"ssid":"MYWIFISSID","ip":"SHELLYEM2IP","rssi":-33},"cloud":{"enabled":true,"connected":true},"mqtt":{"connected":false},"time":"15:14","unixtime":1597677245,"serial":23729,"has_update":true,"mac":"ECFABCC7EB54","relays":[{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"is_valid":true}],"emeters":[{"power":711.61,"reactive":-496.07,"voltage":234.15,"is_valid":true,"total":16112.8,"total_returned":334.0},{"power":0.00,"reactive":0.00,"voltage":234.15,"is_valid":true,"total":0.0,"total_returned":0.0}],"update":{"status":"pending","has_update":true,"new_version":"20200813-140346/v1.8.1@1b2a49be","old_version":"20200702-133509/v1.7.4@1d8b9fca"},"ram_total":49312,"ram_free":35200,"ram_lwm":29568,"fs_size":233681,"fs_free":158632,"uptime":252489}
2020-08-17 15:14:05.820 [TRACE] [.internal.handler.ShellyRelayHandler] - shellyem-c7eb54: Updating 1 relay(s)
2020-08-17 15:14:05.820 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shellyem-c7eb54: HTTP GET for http://SHELLYEM2IP/status/relay/0
2020-08-17 15:14:05.903 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shellyem-c7eb54: HTTP Response 200: {"wifi_sta":{"connected":true,"ssid":"MYWIFISSID","ip":"SHELLYEM2IP","rssi":-33},"cloud":{"enabled":true,"connected":true},"mqtt":{"connected":false},"time":"15:14","unixtime":1597677245,"serial":23729,"has_update":true,"mac":"ECFABCC7EB54","relays":[{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"is_valid":true}],"emeters":[{"power":711.61,"reactive":-496.07,"voltage":234.15,"is_valid":true,"total":16112.8,"total_returned":334.0},{"power":0.00,"reactive":0.00,"voltage":234.15,"is_valid":true,"total":0.0,"total_returned":0.0}],"update":{"status":"pending","has_update":true,"new_version":"20200813-140346/v1.8.1@1b2a49be","old_version":"20200702-133509/v1.7.4@1d8b9fca"},"ram_total":49312,"ram_free":35020,"ram_lwm":29568,"fs_size":233681,"fs_free":158632,"uptime":252489}
2020-08-17 15:14:05.904 [TRACE] [y.internal.handler.ShellyBaseHandler] - shellyem-c7eb54: Updating 2 e-meter(s)
2020-08-17 15:14:05.906 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellyem-c7eb54: Channel meter1#currentWatts updated with 711.6 W (type class org.eclipse.smarthome.core.library.types.QuantityType).
2020-08-17 15:14:05.908 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellyem-c7eb54: Channel meter1#totalKWH updated with 16.113 kWh (type class org.eclipse.smarthome.core.library.types.QuantityType).
2020-08-17 15:14:05.911 [TRACE] [y.internal.handler.ShellyBaseHandler] - shellyem-c7eb54: 0 more updates requested

2020-08-17 15:14:05.914 [vent.ItemStateChangedEvent] - klima_leistung changed from 0.0 to 711.6
2020-08-17 15:14:19.085 [vent.ItemStateChangedEvent] - klima_leistung changed from 711.6 to 0.0
2020-08-17 15:14:21.099 [vent.ItemStateChangedEvent] - klima_leistung changed from 0.0 to 714.0
2020-08-17 15:14:34.083 [vent.ItemStateChangedEvent] - klima_leistung changed from 714.0 to 0.0
2020-08-17 15:14:36.289 [vent.ItemStateChangedEvent] - klima_leistung changed from 0.0 to 713.9
2020-08-17 15:14:49.097 [vent.ItemStateChangedEvent] - klima_leistung changed from 713.9 to 0.0
2020-08-17 15:14:51.512 [vent.ItemStateChangedEvent] - klima_leistung changed from 0.0 to 714.9

Afterwards, I update the second EM (A/C) to firmware 1.8.1. Following the update, it did not get any updates at all since the http updates are ignored because of the reliance on CoIoT v2. Contrary, the CoIoT updates are ignored (not processed) for some other reasons.

Summary
2020-08-17 15:51:20.885 [TRACE] [y.internal.handler.ShellyBaseHandler] - shellyem-emhwr2: Updating status
2020-08-17 15:51:20.886 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shellyem-emhwr2: HTTP GET for http://SHELLYEM2IP/status
2020-08-17 15:51:21.052 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shellyem-emhwr2: HTTP Response 200: {"wifi_sta":{"connected":true,"ssid":"MYWIFISSID","ip":"SHELLYEM2IP","rssi":-32},"cloud":{"enabled":true,"connected":true},"mqtt":{"connected":false},"time":"15:51","unixtime":1597679481,"serial":91,"has_update":false,"mac":"ECFABCC7EB54","cfg_changed_cnt":2,"actions_stats":{"skipped":0},"relays":[{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"is_valid":true,"source":"input"}],"emeters":[{"power":618.17,"reactive":-455.59,"voltage":230.04,"is_valid":true,"total":16493.0,"total_returned":334.0},{"power":0.00,"reactive":0.00,"voltage":230.04,"is_valid":true,"total":0.0,"total_returned":0.0}],"update":{"status":"idle","has_update":false,"new_version":"20200813-140346/v1.8.1@1b2a49be","old_version":"20200813-140346/v1.8.1@1b2a49be"},"ram_total":50232,"ram_free":35488,"fs_size":233681,"fs_free":155369,"uptime":1117}
2020-08-17 15:51:21.054 [TRACE] [.internal.handler.ShellyRelayHandler] - shellyem-emhwr2: Updating 1 relay(s)
2020-08-17 15:51:21.056 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shellyem-emhwr2: HTTP GET for http://SHELLYEM2IP/status/relay/0
2020-08-17 15:51:21.132 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shellyem-emhwr2: HTTP Response 200: {"wifi_sta":{"connected":true,"ssid":"MYWIFISSID","ip":"SHELLYEM2IP","rssi":-34},"cloud":{"enabled":true,"connected":true},"mqtt":{"connected":false},"time":"15:51","unixtime":1597679481,"serial":91,"has_update":false,"mac":"ECFABCC7EB54","cfg_changed_cnt":2,"actions_stats":{"skipped":0},"relays":[{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"is_valid":true,"source":"input"}],"emeters":[{"power":618.17,"reactive":-455.59,"voltage":230.04,"is_valid":true,"total":16493.0,"total_returned":334.0},{"power":0.00,"reactive":0.00,"voltage":230.04,"is_valid":true,"total":0.0,"total_returned":0.0}],"update":{"status":"idle","has_update":false,"new_version":"20200813-140346/v1.8.1@1b2a49be","old_version":"20200813-140346/v1.8.1@1b2a49be"},"ram_total":50232,"ram_free":35288,"fs_size":233681,"fs_free":155369,"uptime":1117}
2020-08-17 15:51:21.134 [DEBUG] [y.internal.handler.ShellyBaseHandler] - Skipping Meter/Sensor/Input updates, because device is running CoIoT version 2
2020-08-17 15:51:21.138 [TRACE] [y.internal.handler.ShellyBaseHandler] - shellyem-emhwr2: 0 more updates requested

2020-08-17 15:52:34.016 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2:  Sensor value[2]: id=4105, Value=618.52 (power, Type=P, Range=0/31800;-1, Link=2: emeter_0)
2020-08-17 15:52:34.024 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2: CoIoT data for id 4105, type P/power not processed, value=618.52; payload={"G":[[0,9103,2],[0,1101,0],[0,4105,618.52],[0,4106,16503.4],[0,4107,334.0],[0,4108,230.55],[0,4205,0.00],[0,4206,0.0],[0,4207,0.0],[0,4208,230.55],[0,6102,0]]}
2020-08-17 15:52:34.026 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2:  Sensor value[3]: id=4106, Value=16503.4 (energy, Type=E, Range=U32;-1, Link=2: emeter_0)
2020-08-17 15:52:34.030 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2: CoIoT data for id 4106, type E/energy not processed, value=16503.4; payload={"G":[[0,9103,2],[0,1101,0],[0,4105,618.52],[0,4106,16503.4],[0,4107,334.0],[0,4108,230.55],[0,4205,0.00],[0,4206,0.0],[0,4207,0.0],[0,4208,230.55],[0,6102,0]]}
2020-08-17 15:52:34.032 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2:  Sensor value[4]: id=4107, Value=334.0 (energyReturned, Type=E, Range=U32;-1, Link=2: emeter_0)
2020-08-17 15:52:34.034 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2: CoIoT data for id 4107, type E/energyReturned not processed, value=334.0; payload={"G":[[0,9103,2],[0,1101,0],[0,4105,618.52],[0,4106,16503.4],[0,4107,334.0],[0,4108,230.55],[0,4205,0.00],[0,4206,0.0],[0,4207,0.0],[0,4208,230.55],[0,6102,0]]}
2020-08-17 15:52:34.035 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2:  Sensor value[5]: id=4108, Value=230.55 (voltage, Type=V, Range=0/265;-1, Link=2: emeter_0)
2020-08-17 15:52:34.040 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2: CoIoT data for id 4108, type V/voltage not processed, value=230.55; payload={"G":[[0,9103,2],[0,1101,0],[0,4105,618.52],[0,4106,16503.4],[0,4107,334.0],[0,4108,230.55],[0,4205,0.00],[0,4206,0.0],[0,4207,0.0],[0,4208,230.55],[0,6102,0]]}
2020-08-17 15:52:34.042 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2:  Sensor value[6]: id=4205, Value=0.0 (power, Type=P, Range=0/31800;-1, Link=3: emeter_1)
2020-08-17 15:52:34.044 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2: CoIoT data for id 4205, type P/power not processed, value=0.0; payload={"G":[[0,9103,2],[0,1101,0],[0,4105,618.52],[0,4106,16503.4],[0,4107,334.0],[0,4108,230.55],[0,4205,0.00],[0,4206,0.0],[0,4207,0.0],[0,4208,230.55],[0,6102,0]]}
2020-08-17 15:52:34.045 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2:  Sensor value[7]: id=4206, Value=0.0 (energy, Type=E, Range=U32;-1, Link=3: emeter_1)
2020-08-17 15:52:34.047 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2: CoIoT data for id 4206, type E/energy not processed, value=0.0; payload={"G":[[0,9103,2],[0,1101,0],[0,4105,618.52],[0,4106,16503.4],[0,4107,334.0],[0,4108,230.55],[0,4205,0.00],[0,4206,0.0],[0,4207,0.0],[0,4208,230.55],[0,6102,0]]}
2020-08-17 15:52:34.049 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2:  Sensor value[8]: id=4207, Value=0.0 (energyReturned, Type=E, Range=U32;-1, Link=3: emeter_1)
2020-08-17 15:52:34.051 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2: CoIoT data for id 4207, type E/energyReturned not processed, value=0.0; payload={"G":[[0,9103,2],[0,1101,0],[0,4105,618.52],[0,4106,16503.4],[0,4107,334.0],[0,4108,230.55],[0,4205,0.00],[0,4206,0.0],[0,4207,0.0],[0,4208,230.55],[0,6102,0]]}
2020-08-17 15:52:34.068 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2:  Sensor value[9]: id=4208, Value=230.55 (voltage, Type=V, Range=0/265;-1, Link=3: emeter_1)
2020-08-17 15:52:34.069 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2: CoIoT data for id 4208, type V/voltage not processed, value=230.55; payload={"G":[[0,9103,2],[0,1101,0],[0,4105,618.52],[0,4106,16503.4],[0,4107,334.0],[0,4108,230.55],[0,4205,0.00],[0,4206,0.0],[0,4207,0.0],[0,4208,230.55],[0,6102,0]]}
2020-08-17 15:52:34.071 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-emhwr2:  Sensor value[10]: id=6102, Value=0.0 (overpower, Type=A, Range=0/1;-1, Link=1: relay_0)

Hope this feedback helps. Thanks in advance and I would be glad to answer further questions.

Cheers
Michael

Yes, this was done already in 2.5.7. The binding checks the firmware version at load time and auto-enables CoAP with version 1.6 or newer. Old CoIoT versions are lacking some of the status updates so I implemented some kind of hybrid model: CoIoT events + REST polling. The bid advantage of CoIoT is that the device automatically sends an update, when some of the status values changed. Firmware 1.8 brought CoIoT version 2, which fixes inconsistencies and adds almost all status values (nevertheless WiFi signa strength is missing so far). The binding is able to detect and decode both CoIoT versions on the fly. Of course, this makes testing more complex and time consuming, so every contribution to testing or test results are welcome

Yep, as I already mentioned. Go and do the tests. If you encounter an issue report it here and I’ll do my best to fix it. Or just report a successful result, which gives others a feeling on stability of the current build.

Please make sure to use the latest DEV build. I made some improvements to change the CoIoT-version on-the-fly (doing a firmware upgrade while the binding is active). Nevertheless, please restart OH to make sure that we have a clean status after the devices have been upgraded. This is not EM-specific. You need to re-initialize the thing after the firmware upgrade by

  • disable/re-enable the thing or
  • edit the thing configuration (you have to change a value) or
  • delete/de-discover the thing or
  • restart OH

This makes sure that the status is in sync, the CoAP description has been re-discovered and the correct CoAP version is bound.

If this doesn’t fix the problem we could spin-off a PM discussion and come back with the result.

I have been using the latest DEV build. I installed it this morning. Anyway, I thought truncating the things and the item file, respectively, would do the trick. However, I did another test, I updated both EMs to 1.8.1 again, reinstalled the DEV build (because I went back to the release build) and restartet OH service.

The alternating problem is gone now. But the updates are not working. After startup the updates of the items worked for about 2-3 minutes. I checked the debug log and found out that the updates are triggered by http updates.

Summary
2020-08-17 18:05:01.502 [TRACE] [y.internal.handler.ShellyBaseHandler] - shellyem-c7eb54: Updating status
2020-08-17 18:05:01.503 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shellyem-c7eb54: HTTP GET for http://SHELLYEM2IP/status
2020-08-17 18:05:01.634 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shellyem-c7eb54: HTTP Response 200: {"wifi_sta":{"connected":true,"ssid":"MYWIFISSID","ip":"SHELLYEM2IP","rssi":-34},"cloud":{"enabled":true,"connected":true},"mqtt":{"connected":false},"time":"18:05","unixtime":1597687501,"serial":146,"has_update":false,"mac":"ECFABCC7EB54","cfg_changed_cnt":0,"actions_stats":{"skipped":0},"relays":[{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"is_valid":true,"source":"input"}],"emeters":[{"power":-8.28,"reactive":0.00,"voltage":232.40,"is_valid":true,"total":16904.4,"total_returned":340.9},{"power":0.00,"reactive":0.00,"voltage":232.40,"is_valid":true,"total":0.0,"total_returned":0.0}],"update":{"status":"idle","has_update":false,"new_version":"20200813-140346/v1.8.1@1b2a49be","old_version":"20200813-140346/v1.8.1@1b2a49be"},"ram_total":50232,"ram_free":35912,"fs_size":233681,"fs_free":155369,"uptime":809}
2020-08-17 18:05:01.637 [TRACE] [.internal.handler.ShellyRelayHandler] - shellyem-c7eb54: Updating 1 relay(s)
2020-08-17 18:05:01.638 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shellyem-c7eb54: HTTP GET for http://SHELLYEM2IP/status/relay/0
2020-08-17 18:05:01.719 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shellyem-c7eb54: HTTP Response 200: {"wifi_sta":{"connected":true,"ssid":"MYWIFISSID","ip":"SHELLYEM2IP","rssi":-33},"cloud":{"enabled":true,"connected":true},"mqtt":{"connected":false},"time":"18:05","unixtime":1597687501,"serial":146,"has_update":false,"mac":"ECFABCC7EB54","cfg_changed_cnt":0,"actions_stats":{"skipped":0},"relays":[{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"is_valid":true,"source":"input"}],"emeters":[{"power":-8.30,"reactive":0.00,"voltage":232.43,"is_valid":true,"total":16904.4,"total_returned":340.9},{"power":0.00,"reactive":0.00,"voltage":232.43,"is_valid":true,"total":0.0,"total_returned":0.0}],"update":{"status":"idle","has_update":false,"new_version":"20200813-140346/v1.8.1@1b2a49be","old_version":"20200813-140346/v1.8.1@1b2a49be"},"ram_total":50232,"ram_free":35576,"fs_size":233681,"fs_free":155369,"uptime":810}
2020-08-17 18:05:01.721 [TRACE] [y.internal.handler.ShellyBaseHandler] - shellyem-c7eb54: Updating 2 e-meter(s)
2020-08-17 18:05:01.724 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellyem-c7eb54: Channel meter1#currentWatts updated with -8.3 W (type class org.eclipse.smarthome.core.library.types.QuantityType).
2020-08-17 18:05:01.735 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellyem-c7eb54: Channel meter1#totalKWH updated with 16.904 kWh (type class org.eclipse.smarthome.core.library.types.QuantityType).
2020-08-17 18:05:01.742 [TRACE] [y.internal.handler.ShellyBaseHandler] - shellyem-c7eb54: 0 more updates requested

Right after it stoppped updating I found this line in the logs.

2020-08-17 18:05:04.743 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellyem-c7eb54: Enabling channel cache (21 updates / 60s)

And afterwards (and already before) the CoIoT updates were not processed.

Summary
2020-08-17 18:05:15.746 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54: CoIoT Message from /SHELLYEM2IP:5683 (MID=56767): {"G":[[0,9103,0],[0,1101,0],[0,4105,-8.63],[0,4106,16904.4],[0,4107,340.9],[0,4108,232.02],[0,4205,0.00],[0,4206,0.0],[0,4207,0.0],[0,4208,232.02],[0,6102,0]]}
2020-08-17 18:05:15.747 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54: CoIoT Sensor data {"G":[[0,9103,0],[0,1101,0],[0,4105,-8.63],[0,4106,16904.4],[0,4107,340.9],[0,4108,232.02],[0,4205,0.00],[0,4206,0.0],[0,4207,0.0],[0,4208,232.02],[0,6102,0]]}
2020-08-17 18:05:15.749 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54: 11 CoAP sensor updates received
2020-08-17 18:05:15.750 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54:  Sensor value[0]: id=9103, Value=0.0 (cfgChanged, Type=EVC, Range=U16, Link=4: device)
2020-08-17 18:05:15.750 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54:  Sensor value[1]: id=1101, Value=0.0 (output, Type=S, Range=0/1, Link=1: relay_0)
2020-08-17 18:05:15.751 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54:  Sensor value[2]: id=4105, Value=-8.63 (power, Type=P, Range=0/31800;-1, Link=2: emeter_0)
2020-08-17 18:05:15.751 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54: CoIoT data for id 4105, type P/power not processed, value=-8.63; payload={"G":[[0,9103,0],[0,1101,0],[0,4105,-8.63],[0,4106,16904.4],[0,4107,340.9],[0,4108,232.02],[0,4205,0.00],[0,4206,0.0],[0,4207,0.0],[0,4208,232.02],[0,6102,0]]}
2020-08-17 18:05:15.752 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54:  Sensor value[3]: id=4106, Value=16904.4 (energy, Type=E, Range=U32;-1, Link=2: emeter_0)
2020-08-17 18:05:15.752 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54: CoIoT data for id 4106, type E/energy not processed, value=16904.4; payload={"G":[[0,9103,0],[0,1101,0],[0,4105,-8.63],[0,4106,16904.4],[0,4107,340.9],[0,4108,232.02],[0,4205,0.00],[0,4206,0.0],[0,4207,0.0],[0,4208,232.02],[0,6102,0]]}
2020-08-17 18:05:15.753 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54:  Sensor value[4]: id=4107, Value=340.9 (energyReturned, Type=E, Range=U32;-1, Link=2: emeter_0)
2020-08-17 18:05:15.753 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54: CoIoT data for id 4107, type E/energyReturned not processed, value=340.9; payload={"G":[[0,9103,0],[0,1101,0],[0,4105,-8.63],[0,4106,16904.4],[0,4107,340.9],[0,4108,232.02],[0,4205,0.00],[0,4206,0.0],[0,4207,0.0],[0,4208,232.02],[0,6102,0]]}
2020-08-17 18:05:15.753 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54:  Sensor value[5]: id=4108, Value=232.02 (voltage, Type=V, Range=0/265;-1, Link=2: emeter_0)
2020-08-17 18:05:15.754 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54: CoIoT data for id 4108, type V/voltage not processed, value=232.02; payload={"G":[[0,9103,0],[0,1101,0],[0,4105,-8.63],[0,4106,16904.4],[0,4107,340.9],[0,4108,232.02],[0,4205,0.00],[0,4206,0.0],[0,4207,0.0],[0,4208,232.02],[0,6102,0]]}
2020-08-17 18:05:15.754 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54:  Sensor value[6]: id=4205, Value=0.0 (power, Type=P, Range=0/31800;-1, Link=3: emeter_1)
2020-08-17 18:05:15.755 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54: CoIoT data for id 4205, type P/power not processed, value=0.0; payload={"G":[[0,9103,0],[0,1101,0],[0,4105,-8.63],[0,4106,16904.4],[0,4107,340.9],[0,4108,232.02],[0,4205,0.00],[0,4206,0.0],[0,4207,0.0],[0,4208,232.02],[0,6102,0]]}
2020-08-17 18:05:15.755 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54:  Sensor value[7]: id=4206, Value=0.0 (energy, Type=E, Range=U32;-1, Link=3: emeter_1)
2020-08-17 18:05:15.755 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54: CoIoT data for id 4206, type E/energy not processed, value=0.0; payload={"G":[[0,9103,0],[0,1101,0],[0,4105,-8.63],[0,4106,16904.4],[0,4107,340.9],[0,4108,232.02],[0,4205,0.00],[0,4206,0.0],[0,4207,0.0],[0,4208,232.02],[0,6102,0]]}
2020-08-17 18:05:15.756 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54:  Sensor value[8]: id=4207, Value=0.0 (energyReturned, Type=E, Range=U32;-1, Link=3: emeter_1)
2020-08-17 18:05:15.756 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54: CoIoT data for id 4207, type E/energyReturned not processed, value=0.0; payload={"G":[[0,9103,0],[0,1101,0],[0,4105,-8.63],[0,4106,16904.4],[0,4107,340.9],[0,4108,232.02],[0,4205,0.00],[0,4206,0.0],[0,4207,0.0],[0,4208,232.02],[0,6102,0]]}
2020-08-17 18:05:15.757 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54:  Sensor value[9]: id=4208, Value=232.02 (voltage, Type=V, Range=0/265;-1, Link=3: emeter_1)
2020-08-17 18:05:15.757 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54: CoIoT data for id 4208, type V/voltage not processed, value=232.02; payload={"G":[[0,9103,0],[0,1101,0],[0,4105,-8.63],[0,4106,16904.4],[0,4107,340.9],[0,4108,232.02],[0,4205,0.00],[0,4206,0.0],[0,4207,0.0],[0,4208,232.02],[0,6102,0]]}
2020-08-17 18:05:15.757 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shellyem-c7eb54:  Sensor value[10]: id=6102, Value=0.0 (overpower, Type=A, Range=0/1;-1, Link=1: relay_0)

So, basically were down to CoIoT data not being processed if I am getting this right. The rest seems to be resolved by the service restart. Sorry for the inconvenience about that.

EDIT: Forgot to mention… After the item stops being updated, the http updates are ignored due to relying on CoIoT v2 as mentioned in my previous post.

I sent you a PM

@mischateeh help to find one more bug with 1PM+Firmware 1.8.1: The CoAP updates for totalKWH was not processed correctly, this is fixed (not relevant with firmware < 1.8)


Who has a Shelly Button 1 and Unify WiFi Access Points?

We are chasing a problem that the button requires 8sec to connect to certain Unify AP models. Maybe you could share your experiences
a) You Button 1 connects to the Unify within 1-3sec (click button, until you see the green light)
b) You Button 1 blinks for 8sec before you see the green light and the event on the OH side

I you have this configuration: please report Unify AP model, firmware version and board revision (you can find those in the Unify Controller) and what you are experiencing. So far we can’t nail it down to firmware version, any settings, DHCP etc. It seems related to the board revision (chipset) of the access point. This is a try to get more samples and have a proof point.

I’ve only the first channel configured as toggle because I’ve a switch connected to it, channel 2 and 3 are correctly configured as momentary, I’ve tried to remove the thing and set it up again, as you can see in the attached log at the begininng the status is reported correctly but after this no more updates.

I’ve checked and on MQTT the status is correctly reported from the i3…

openhab.log (23.3 KB)

I see that you are not running the latest DEV build, please update
restart OH and do nothing
after 60sec the channel cache gets enable, just wait
and then you should see every 15s a CoAP message

If this is not working something is wrong with the device communication.

I attached the same switch to 2 havong a momentary switch
each time I press the button both inputs get updated, event count increases
However, I notice that it takes 3sec, but that’s when the device sends the CoAP message
I’ll contact Alterco and check if this might be a firmware issue, other devices are much faster

Updated to the last DEV build, nothing changed for me…
Shelly 1,2,2.5,EM, RGBW2, GAS correctly reporting but not the i3

Ok,small update, I’ve noticed that from Paper UI I was still seeing the binding version 2.5.7 installed, which was not reported by bundle:list, I’ve fully cleared the cache an tmp folder, removed the binding from the console again, reinstalled the last DEV version and now the input status of the i3 is reported but…only every 60 seconds, not in realtime…there’s something to change?

Hi everybody,

I recently added two shelly Duo GU10 to my OH. Unfortunately I do no get data except for On/Off and the dimmer value. E.g. the light temperature or the consumption data of the meter are still Null.

Does anybody have a DUO GU10 running in his OH ? Or am I behind a compatible release ?. My OH is 2.5.4 with shelly Binding 2.5.4