Shelly Binding

Weak wifi signal means unreliable connection and potential data loss. Coap is UDP based so if the link layer is not able to recover from transmission problems the packet is lost. That seems not to Best regards, Markus the case, because you see the CoAP message. Nevertheless retransmission could take time.

Which signal strength do you have?

Did you tried a endless ping (with larger packets like 200 bytes) to the device? Do you see constant response times or something like 10ms, 100ms, 30ms, 700ms?

Believe me you proxy approach is not a smart idea., there must be something delaying the processing, maybe within the OH process, rules etc. or retransmission problems

Sure I agree that it’s definitely not the best option to have a proxy, just don’t know how to solve it otherwise.

Here’s a dump of a ping, so it’s max. around 50ms without any loss:

Antwort von 192.168.1.42: Bytes=200 Zeit=5ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=8ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=3ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=6ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=8ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=14ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=3ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=58ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=3ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=2ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=52ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=2ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=61ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=5ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=42ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=49ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=55ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=38ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=47ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=32ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=37ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=36ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=32ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=2ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=29ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=23ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=24ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=21ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=22ms TTL=255
Antwort von 192.168.1.42: Bytes=200 Zeit=25ms TTL=255

There’s not a rule which I’m aware of which should introduce that lag. Also the used machine has while running OH not more than 10% CPU usage (actually it’s my old laptop, connection wired, so for doing something small like that oversized).

Let me know if I can do any other tests which could potentially help fixing it.

I used them some time ago, for one-button control of rollershutters. Single click would always send STOP command. Double click would send UP if last movement was closing, or DOWN if last movement was opening. But I don’t use this anymore, I have switched two-button controlls with Shelly i3s. Just mentioning the use case…

I finally installed my 3EM today and tried the Shelly binding. Works fine!
Is there a reason to use this binding and not simply via MQTT? I also tested MQTT, and it works fine. The only thing is that it sends every change to the broker and to openHAB, so it are a lot of entries (I can’t find any setting in the Shelly interface to change this)

Maybe auto thing discovery, add things, link channels, done😎

It’s indeed very easy to configure all of it.
I have one question, I created items for currentWatts, totalKWH and current. Everything looks good in PaperUI, but when opening in Sitemap, I get these 2 messages:

==> /var/log/openhab2/openhab.log <==
2020-10-25 10:35:59.227 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '1.5' of item shelly3em_1_current with format '%f %unit%': Conversion = 'u'
2020-10-25 10:35:59.235 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '1.4' of item shelly3em_2_current with format '%f %unit%': Conversion = 'u'

As you see it’s for meter 1 & 2. Meter 3 is displaying properly. Config (items) is identical for all 3 meters.

please share your item & sitemap definition

For some strange reason the errors are gone now and displaying correct…

Number:Power                shelly3em_1_currentWatts       "Fase 1 Current Watts"    (Grp_db)    {channel="shelly:shellyem3:shelly3em:meter1#currentWatts"}
Number:Energy               shelly3em_1_totalKWH           "Fase 1 Total KWH"        (Grp_db)    {channel="shelly:shellyem3:shelly3em:meter1#totalKWH"}
Number:ElectricPotential    shelly3em_1_current            "Fase 1 Current"          (Grp_db)    {channel="shelly:shellyem3:shelly3em:meter1#current"}
DateTime                    shelly3em_1_lastUpdate         "Fase 1 Last Update"                  {channel="shelly:shellyem3:shelly3em:meter1#lastUpdate"}

Number:Power                shelly3em_2_currentWatts       "Fase 2 Current Watts"    (Grp_db)    {channel="shelly:shellyem3:shelly3em:meter2#currentWatts"}
Number:Energy               shelly3em_2_totalKWH           "Fase 2 Total KWH"        (Grp_db)    {channel="shelly:shellyem3:shelly3em:meter2#totalKWH"}
Number:ElectricPotential    shelly3em_2_current            "Fase 2 Current"          (Grp_db)    {channel="shelly:shellyem3:shelly3em:meter2#current"}
DateTime                    shelly3em_2_lastUpdate         "Fase 2 Last Update"                  {channel="shelly:shellyem3:shelly3em:meter2#lastUpdate"}

Number:Power                shelly3em_3_currentWatts       "Fase 3 Current Watts"    (Grp_db)    {channel="shelly:shellyem3:shelly3em:meter3#currentWatts"}
Number:Energy               shelly3em_3_totalKWH           "Fase 3 Total KWH"        (Grp_db)    {channel="shelly:shellyem3:shelly3em:meter3#totalKWH"}
Number:ElectricPotential    shelly3em_3_current            "Fase 3 Current"          (Grp_db)    {channel="shelly:shellyem3:shelly3em:meter3#current"}
DateTime                    shelly3em_3_lastUpdate         "Fase 3 Last Update"                  {channel="shelly:shellyem3:shelly3em:meter3#lastUpdate"}
			Default item=shelly3em_1_current
			Default item=shelly3em_1_currentWatts
			Default item=shelly3em_1_totalKWH
			Default item=shelly3em_2_current
			Default item=shelly3em_2_currentWatts 
			Default item=shelly3em_2_totalKWH
			Default item=shelly3em_3_current
			Default item=shelly3em_3_currentWatts
			Default item=shelly3em_3_totalKWH

Hi,
I have a problem with my Shelly RGBW2. The device is being discovered but stays in “initializing”.
All other Shelly devices are working fine.
I have tried the following without any success:

  • removing and re-adding the device
  • removing all shelly devices, uninstalling the binding, clean-cache, reinstalling the binding

After fresh installation I had the following (rgbw2 regarding) in the log:

2020-10-26 16:31:01.278 [DEBUG] [discovery.ShellyDiscoveryParticipant] - shellyrgbw2-1e0362: Shelly device discovered: IP-Adress=192.168.178.119, type=shellyrgbw2
    2020-10-26 16:31:01.281 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shellyrgbw2-1e0362: HTTP GET for http://192.168.178.119/settings
    2020-10-26 16:31:01.437 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shellyrgbw2-1e0362: HTTP Response 200: {"device":{"type":"SHRGBW2","mac":"C82B961E0362","hostname":"shellyrgbw2-1E0362","num_outputs":1},"wifi_ap":{"enabled":false,"ssid":"shellyrgbw2-1E0362","key":""},"wifi_sta":{"enabled":true,"ssid":"Fritz!BOX","ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"mqtt": {"enable":false,"server":"192.168.33.3:1883","user":"","id":"shellyrgbw2-1E0362","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"max_qos":0,"retain":false,"update_period":30},"coiot": {"update_period":15,"execute_enable":true},"sntp":{"server":"time.google.com","enabled":true},"login":{"enabled":false,"unprotected":false,"username":"admin"},"pin_code":"zk1*Nb","name":null,"fw":"20200827-070157/v1.8.3@4a8bc427","factory_reset_from_switch":false,"discoverable":false,"build_info":{"build_id":"20200827-070157/v1.8.3@4a8bc427","build_timestamp":"2020-08-27T07:01:57Z","build_version":"1.0"},"cloud":{"enabled":true,"connected":true},"timezone":"Europe/Berlin","lat":53.551102,"lng":9.993680,"tzautodetect":true,"tz_utc_offset":3600,"tz_dst":false,"tz_dst_auto":true,"time":"16:31","unixtime":1603729861,"led_status_disable":true,"fw_mode":"SHRGBW2!color","actions":{"active":false,"names":["btn_on_url","btn_off_url","out_on_url","out_off_url","longpush_url","shortpush_url"]},"hwinfo": {"hw_revision":"prod-190822","batch_id":1},"mode":"color","alt_modes":["white"],"dcpower":0,"lights":[{"name":"LED-Licht Terrasse","ison":false,"red":255,"green":112,"blue":5,"white":161,"gain":25,"effect":0,"default_state":"last","auto_on":0.00,"auto_off":0.00,"schedule":false,"btn_type":"detached","btn_reverse":0,"schedule_rules":["0000asr-0123456-off"]}],"night_mode":{"enabled":0, "start_time":"00:00", "end_time":"00:00", "brightness":0}}
    2020-10-26 16:31:01.446 [DEBUG] [discovery.ShellyDiscoveryParticipant] - shellyrgbw2-1e0362: Shelly settings : {"device":{"type":"SHRGBW2","mac":"C82B961E0362","hostname":"shellyrgbw2-1E0362","num_outputs":1},"wifi_ap":{"enabled":false,"ssid":"shellyrgbw2-1E0362","key":""},"wifi_sta":{"enabled":true,"ssid":"Fritz!BOX","ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"mqtt": {"enable":false,"server":"192.168.33.3:1883","user":"","id":"shellyrgbw2-1E0362","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"max_qos":0,"retain":false,"update_period":30},"coiot": {"update_period":15,"execute_enable":true},"sntp":{"server":"time.google.com","enabled":true},"login":{"enabled":false,"unprotected":false,"username":"admin"},"pin_code":"zk1*Nb","name":null,"fw":"20200827-070157/v1.8.3@4a8bc427","factory_reset_from_switch":false,"discoverable":false,"build_info":{"build_id":"20200827-070157/v1.8.3@4a8bc427","build_timestamp":"2020-08-27T07:01:57Z","build_version":"1.0"},"cloud":{"enabled":true,"connected":true},"timezone":"Europe/Berlin","lat":53.551102,"lng":9.993680,"tzautodetect":true,"tz_utc_offset":3600,"tz_dst":false,"tz_dst_auto":true,"time":"16:31","unixtime":1603729861,"led_status_disable":true,"fw_mode":"SHRGBW2!color","actions":{"active":false,"names":["btn_on_url","btn_off_url","out_on_url","out_off_url","longpush_url","shortpush_url"]},"hwinfo": {"hw_revision":"prod-190822","batch_id":1},"mode":"color","alt_modes":["white"],"dcpower":0,"lights":[{"name":"LED-Licht Terrasse","ison":false,"red":255,"green":112,"blue":5,"white":161,"gain":25,"effect":0,"default_state":"last","auto_on":0.00,"auto_off":0.00,"schedule":false,"btn_type":"detached","btn_reverse":0,"schedule_rules":["0000asr-0123456-off"]}],"night_mode":{"enabled":0, "start_time":"00:00", "end_time":"00:00", "brightness":0}}
    2020-10-26 16:31:01.448 [TRACE] [discovery.ShellyDiscoveryParticipant] - shellyrgbw2-1e0362: thingType=shellyrgbw2, deviceType=SHRGBW2, mode=color, symbolic name=
    2020-10-26 16:31:01.450 [DEBUG] [discovery.ShellyDiscoveryParticipant] - shellyrgbw2-1e0362: Adding Shelly , UID=shelly:shellyrgbw2-color:1e0362
    ...
    2020-10-26 16:31:07.265 [INFO ] [helly.internal.handler.ShellyHandler] - Device config: ipAddress=192.168.178.119, http user/password=/, update interval=60, low battery threshold=20.0%
    2020-10-26 16:31:07.267 [INFO ] [helly.internal.handler.ShellyHandler] - Start initializing thing shellyrgbw2-1e0362 - 192.168.178.119, ip address 192.168.178.119
    2020-10-26 16:31:07.270 [TRACE] [helly.internal.handler.ShellyHandler] - HTTP GET for : http://192.168.178.119/settings
    2020-10-26 16:31:07.440 [TRACE] [helly.internal.handler.ShellyHandler] - HTTP response from : {"device":{"type":"SHRGBW2","mac":"C82B961E0362","hostname":"shellyrgbw2-1E0362","num_outputs":1},"wifi_ap":{"enabled":false,"ssid":"shellyrgbw2-1E0362","key":""},"wifi_sta":{"enabled":true,"ssid":"Fritz!BOX","ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"mqtt": {"enable":false,"server":"192.168.33.3:1883","user":"","id":"shellyrgbw2-1E0362","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"max_qos":0,"retain":false,"update_period":30},"coiot": {"update_period":15,"execute_enable":true},"sntp":{"server":"time.google.com","enabled":true},"login":{"enabled":false,"unprotected":false,"username":"admin"},"pin_code":"zk1*Nb","name":null,"fw":"20200827-070157/v1.8.3@4a8bc427","factory_reset_from_switch":false,"discoverable":false,"build_info":{"build_id":"20200827-070157/v1.8.3@4a8bc427","build_timestamp":"2020-08-27T07:01:57Z","build_version":"1.0"},"cloud":{"enabled":true,"connected":true},"timezone":"Europe/Berlin","lat":53.551102,"lng":9.993680,"tzautodetect":true,"tz_utc_offset":3600,"tz_dst":false,"tz_dst_auto":true,"time":"16:31","unixtime":1603729867,"led_status_disable":true,"fw_mode":"SHRGBW2!color","actions":{"active":false,"names":["btn_on_url","btn_off_url","out_on_url","out_off_url","longpush_url","shortpush_url"]},"hwinfo": {"hw_revision":"prod-190822","batch_id":1},"mode":"color","alt_modes":["white"],"dcpower":0,"lights":[{"name":"LED-Licht Terrasse","ison":false,"red":255,"green":112,"blue":5,"white":161,"gain":25,"effect":0,"default_state":"last","auto_on":0.00,"auto_off":0.00,"schedule":false,"btn_type":"detached","btn_reverse":0,"schedule_rules":["0000asr-0123456-off"]}],"night_mode":{"enabled":0, "start_time":"00:00", "end_time":"00:00", "brightness":0}}
    2020-10-26 16:31:07.446 [DEBUG] [helly.internal.handler.ShellyHandler] - Get number of meters from light status
    2020-10-26 16:31:07.448 [TRACE] [helly.internal.handler.ShellyHandler] - HTTP GET for shellyrgbw2-1e0362: http://192.168.178.119/status
    2020-10-26 16:31:07.540 [TRACE] [helly.internal.handler.ShellyHandler] - HTTP response from shellyrgbw2-1e0362: {"wifi_sta":{"connected":true,"ssid":"Fritz!BOX","ip":"192.168.178.119","rssi":-68},"cloud":{"enabled":true,"connected":true},"mqtt":{"connected":false},"time":"16:31","unixtime":1603729867,"serial":26095,"has_update":false,"mac":"C82B961E0362","cfg_changed_cnt":6,"actions_stats":{"skipped":0},"mode":"color","input":0,"lights":[{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"mode":"color","red":255,"green":112,"blue":5,"white":161,"gain":25,"effect":0,"power":0.00,"overpower":false}],"meters":[{"power":0.00,"is_valid":true,"overpower":false,"timestamp":1603729867,"counters":[0.000, 0.000, 0.000],"total":0}],"inputs":[{"input":0,"event":"","event_cnt":0}],"update":{"status":"idle","has_update":false,"new_version":"20200827-070157/v1.8.3@4a8bc427","old_version":"20200827-070157/v1.8.3@4a8bc427","beta_version":"20200814-175029/v1.8.2-rc1@59a25feb"},"ram_total":50728,"ram_free":37872,"fs_size":233681,"fs_free":147337,"uptime":1563337}
    2020-10-26 16:31:07.546 [INFO ] [helly.internal.handler.ShellyHandler] - Initializing device shellyrgbw2-1e0362, type SHRGBW2, Hardware: Rev: prod-190822, batch 1; Firmware: v1.8.3 / 20200827-070157 (4a8bc427); Thing Type=shellyrgbw2-color
    2020-10-26 16:31:07.549 [DEBUG] [helly.internal.handler.ShellyHandler] - Device shellyrgbw2-1e0362: has relays: false, is roller: false, is Plug S: false,  is Bulb/RGBW2: true, is HT/Smoke Sensor: false, has is Sense: false, Meter: true, has Battery: false, has LEDs: false, numRelays=0, numRoller=0, numMeter=1
    2020-10-26 16:31:07.551 [DEBUG] [helly.internal.handler.ShellyHandler] - Shelly settings info for  : {"device":{"type":"SHRGBW2","mac":"C82B961E0362","hostname":"shellyrgbw2-1E0362","num_outputs":1},"wifi_ap":{"enabled":false,"ssid":"shellyrgbw2-1E0362","key":""},"wifi_sta":{"enabled":true,"ssid":"Fritz!BOX","ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"mqtt": {"enable":false,"server":"192.168.33.3:1883","user":"","id":"shellyrgbw2-1E0362","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"max_qos":0,"retain":false,"update_period":30},"coiot": {"update_period":15,"execute_enable":true},"sntp":{"server":"time.google.com","enabled":true},"login":{"enabled":false,"unprotected":false,"username":"admin"},"pin_code":"zk1*Nb","name":null,"fw":"20200827-070157/v1.8.3@4a8bc427","factory_reset_from_switch":false,"discoverable":false,"build_info":{"build_id":"20200827-070157/v1.8.3@4a8bc427","build_timestamp":"2020-08-27T07:01:57Z","build_version":"1.0"},"cloud":{"enabled":true,"connected":true},"timezone":"Europe/Berlin","lat":53.551102,"lng":9.993680,"tzautodetect":true,"tz_utc_offset":3600,"tz_dst":false,"tz_dst_auto":true,"time":"16:31","unixtime":1603729867,"led_status_disable":true,"fw_mode":"SHRGBW2!color","actions":{"active":false,"names":["btn_on_url","btn_off_url","out_on_url","out_off_url","longpush_url","shortpush_url"]},"hwinfo": {"hw_revision":"prod-190822","batch_id":1},"mode":"color","alt_modes":["white"],"dcpower":0,"lights":[{"name":"LED-Licht Terrasse","ison":false,"red":255,"green":112,"blue":5,"white":161,"gain":25,"effect":0,"default_state":"last","auto_on":0.00,"auto_off":0.00,"schedule":false,"btn_type":"detached","btn_reverse":0,"schedule_rules":["0000asr-0123456-off"]}],"night_mode":{"enabled":0, "start_time":"00:00", "end_time":"00:00", "brightness":0}}
    2020-10-26 16:31:07.554 [TRACE] [helly.internal.handler.ShellyHandler] - HTTP GET for shellyrgbw2-1e0362: http://192.168.178.119/status
    2020-10-26 16:31:07.650 [TRACE] [helly.internal.handler.ShellyHandler] - HTTP response from shellyrgbw2-1e0362: {"wifi_sta":{"connected":true,"ssid":"Fritz!BOX","ip":"192.168.178.119","rssi":-68},"cloud":{"enabled":true,"connected":true},"mqtt":{"connected":false},"time":"16:31","unixtime":1603729867,"serial":26095,"has_update":false,"mac":"C82B961E0362","cfg_changed_cnt":6,"actions_stats":{"skipped":0},"mode":"color","input":0,"lights":[{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"mode":"color","red":255,"green":112,"blue":5,"white":161,"gain":25,"effect":0,"power":0.00,"overpower":false}],"meters":[{"power":0.00,"is_valid":true,"overpower":false,"timestamp":1603729867,"counters":[0.000, 0.000, 0.000],"total":0}],"inputs":[{"input":0,"event":"","event_cnt":0}],"update":{"status":"idle","has_update":false,"new_version":"20200827-070157/v1.8.3@4a8bc427","old_version":"20200827-070157/v1.8.3@4a8bc427","beta_version":"20200814-175029/v1.8.2-rc1@59a25feb"},"ram_total":50728,"ram_free":37872,"fs_size":233681,"fs_free":147337,"uptime":1563337}
    2020-10-26 16:31:07.801 [TRACE] [helly.internal.handler.ShellyHandler] - shellyrgbw2-1e0362: Properties updated
    2020-10-26 16:31:07.803 [TRACE] [helly.internal.handler.ShellyHandler] - Check/set Action event URLs for Relay or Roller for device shellyrgbw2-1e0362
    2020-10-26 16:31:07.805 [INFO ] [helly.internal.handler.ShellyHandler] - Unable to initialize thing shellyrgbw2-1e0362 - 192.168.178.119: null, retrying later
    2020-10-26 16:31:07.808 [DEBUG] [helly.internal.handler.ShellyHandler] - Update status job started, interval=20*3=60sec.
    ...
    2020-10-26 16:32:06.830 [INFO ] [helly.internal.handler.ShellyHandler] - Status update triggered thing initialization for device shellyrgbw2-1e0362
    2020-10-26 16:32:06.832 [INFO ] [helly.internal.handler.ShellyHandler] - Start initializing thing shellyrgbw2-1e0362 - 192.168.178.119, ip address 192.168.178.119
    2020-10-26 16:32:06.833 [TRACE] [helly.internal.handler.ShellyHandler] - HTTP GET for shellyrgbw2-1e0362: http://192.168.178.119/settings
    2020-10-26 16:32:06.988 [TRACE] [helly.internal.handler.ShellyHandler] - HTTP response from shellyrgbw2-1e0362: {"device":{"type":"SHRGBW2","mac":"C82B961E0362","hostname":"shellyrgbw2-1E0362","num_outputs":1},"wifi_ap":{"enabled":false,"ssid":"shellyrgbw2-1E0362","key":""},"wifi_sta":{"enabled":true,"ssid":"Fritz!BOX","ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"mqtt": {"enable":false,"server":"192.168.33.3:1883","user":"","id":"shellyrgbw2-1E0362","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"max_qos":0,"retain":false,"update_period":30},"coiot": {"update_period":15,"execute_enable":true},"sntp":{"server":"time.google.com","enabled":true},"login":{"enabled":false,"unprotected":false,"username":"admin"},"pin_code":"zk1*Nb","name":null,"fw":"20200827-070157/v1.8.3@4a8bc427","factory_reset_from_switch":false,"discoverable":false,"build_info":{"build_id":"20200827-070157/v1.8.3@4a8bc427","build_timestamp":"2020-08-27T07:01:57Z","build_version":"1.0"},"cloud":{"enabled":true,"connected":true},"timezone":"Europe/Berlin","lat":53.551102,"lng":9.993680,"tzautodetect":true,"tz_utc_offset":3600,"tz_dst":false,"tz_dst_auto":true,"time":"16:32","unixtime":1603729927,"led_status_disable":true,"fw_mode":"SHRGBW2!color","actions":{"active":false,"names":["btn_on_url","btn_off_url","out_on_url","out_off_url","longpush_url","shortpush_url"]},"hwinfo": {"hw_revision":"prod-190822","batch_id":1},"mode":"color","alt_modes":["white"],"dcpower":0,"lights":[{"name":"LED-Licht Terrasse","ison":false,"red":255,"green":112,"blue":5,"white":161,"gain":25,"effect":0,"default_state":"last","auto_on":0.00,"auto_off":0.00,"schedule":false,"btn_type":"detached","btn_reverse":0,"schedule_rules":["0000asr-0123456-off"]}],"night_mode":{"enabled":0, "start_time":"00:00", "end_time":"00:00", "brightness":0}}
    2020-10-26 16:32:06.991 [DEBUG] [helly.internal.handler.ShellyHandler] - Get number of meters from light status
    2020-10-26 16:32:06.992 [TRACE] [helly.internal.handler.ShellyHandler] - HTTP GET for shellyrgbw2-1e0362: http://192.168.178.119/status
    2020-10-26 16:32:07.089 [TRACE] [helly.internal.handler.ShellyHandler] - HTTP response from shellyrgbw2-1e0362: {"wifi_sta":{"connected":true,"ssid":"Fritz!BOX","ip":"192.168.178.119","rssi":-68},"cloud":{"enabled":true,"connected":true},"mqtt":{"connected":false},"time":"16:32","unixtime":1603729927,"serial":26096,"has_update":false,"mac":"C82B961E0362","cfg_changed_cnt":6,"actions_stats":{"skipped":0},"mode":"color","input":0,"lights":[{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"mode":"color","red":255,"green":112,"blue":5,"white":161,"gain":25,"effect":0,"power":0.00,"overpower":false}],"meters":[{"power":0.00,"is_valid":true,"overpower":false,"timestamp":1603729927,"counters":[0.000, 0.000, 0.000],"total":0}],"inputs":[{"input":0,"event":"","event_cnt":0}],"update":{"status":"idle","has_update":false,"new_version":"20200827-070157/v1.8.3@4a8bc427","old_version":"20200827-070157/v1.8.3@4a8bc427","beta_version":"20200814-175029/v1.8.2-rc1@59a25feb"},"ram_total":50728,"ram_free":37680,"fs_size":233681,"fs_free":147337,"uptime":1563396}
    2020-10-26 16:32:07.091 [INFO ] [helly.internal.handler.ShellyHandler] - Initializing device shellyrgbw2-1e0362, type SHRGBW2, Hardware: Rev: prod-190822, batch 1; Firmware: v1.8.3 / 20200827-070157 (4a8bc427); Thing Type=shellyrgbw2-color
    2020-10-26 16:32:07.093 [DEBUG] [helly.internal.handler.ShellyHandler] - Device shellyrgbw2-1e0362: has relays: false, is roller: false, is Plug S: false,  is Bulb/RGBW2: true, is HT/Smoke Sensor: false, has is Sense: false, Meter: true, has Battery: false, has LEDs: false, numRelays=0, numRoller=0, numMeter=1
    2020-10-26 16:32:07.095 [DEBUG] [helly.internal.handler.ShellyHandler] - Shelly settings info for shellyrgbw2-1e0362 : {"device":{"type":"SHRGBW2","mac":"C82B961E0362","hostname":"shellyrgbw2-1E0362","num_outputs":1},"wifi_ap":{"enabled":false,"ssid":"shellyrgbw2-1E0362","key":""},"wifi_sta":{"enabled":true,"ssid":"Fritz!BOX","ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"mqtt": {"enable":false,"server":"192.168.33.3:1883","user":"","id":"shellyrgbw2-1E0362","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"max_qos":0,"retain":false,"update_period":30},"coiot": {"update_period":15,"execute_enable":true},"sntp":{"server":"time.google.com","enabled":true},"login":{"enabled":false,"unprotected":false,"username":"admin"},"pin_code":"zk1*Nb","name":null,"fw":"20200827-070157/v1.8.3@4a8bc427","factory_reset_from_switch":false,"discoverable":false,"build_info":{"build_id":"20200827-070157/v1.8.3@4a8bc427","build_timestamp":"2020-08-27T07:01:57Z","build_version":"1.0"},"cloud":{"enabled":true,"connected":true},"timezone":"Europe/Berlin","lat":53.551102,"lng":9.993680,"tzautodetect":true,"tz_utc_offset":3600,"tz_dst":false,"tz_dst_auto":true,"time":"16:32","unixtime":1603729927,"led_status_disable":true,"fw_mode":"SHRGBW2!color","actions":{"active":false,"names":["btn_on_url","btn_off_url","out_on_url","out_off_url","longpush_url","shortpush_url"]},"hwinfo": {"hw_revision":"prod-190822","batch_id":1},"mode":"color","alt_modes":["white"],"dcpower":0,"lights":[{"name":"LED-Licht Terrasse","ison":false,"red":255,"green":112,"blue":5,"white":161,"gain":25,"effect":0,"default_state":"last","auto_on":0.00,"auto_off":0.00,"schedule":false,"btn_type":"detached","btn_reverse":0,"schedule_rules":["0000asr-0123456-off"]}],"night_mode":{"enabled":0, "start_time":"00:00", "end_time":"00:00", "brightness":0}}
    2020-10-26 16:32:07.097 [TRACE] [helly.internal.handler.ShellyHandler] - HTTP GET for shellyrgbw2-1e0362: http://192.168.178.119/status
    2020-10-26 16:32:07.122 [TRACE] [helly.internal.handler.ShellyHandler] - Refresh settings for device shellyswitch25-68fd1a
    2020-10-26 16:32:07.124 [TRACE] [helly.internal.handler.ShellyHandler] - HTTP GET for shellyswitch25-68fd1a: http://192.168.178.64/settings
    2020-10-26 16:32:07.194 [TRACE] [helly.internal.handler.ShellyHandler] - HTTP response from shellyrgbw2-1e0362: {"wifi_sta":{"connected":true,"ssid":"Fritz!BOX","ip":"192.168.178.119","rssi":-68},"cloud":{"enabled":true,"connected":true},"mqtt":{"connected":false},"time":"16:32","unixtime":1603729927,"serial":26096,"has_update":false,"mac":"C82B961E0362","cfg_changed_cnt":6,"actions_stats":{"skipped":0},"mode":"color","input":0,"lights":[{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"mode":"color","red":255,"green":112,"blue":5,"white":161,"gain":25,"effect":0,"power":0.00,"overpower":false}],"meters":[{"power":0.00,"is_valid":true,"overpower":false,"timestamp":1603729927,"counters":[0.000, 0.000, 0.000],"total":0}],"inputs":[{"input":0,"event":"","event_cnt":0}],"update":{"status":"idle","has_update":false,"new_version":"20200827-070157/v1.8.3@4a8bc427","old_version":"20200827-070157/v1.8.3@4a8bc427","beta_version":"20200814-175029/v1.8.2-rc1@59a25feb"},"ram_total":50728,"ram_free":37680,"fs_size":233681,"fs_free":147337,"uptime":1563396}
    2020-10-26 16:32:07.224 [TRACE] [helly.internal.handler.ShellyHandler] - shellyrgbw2-1e0362: Properties updated
    2020-10-26 16:32:07.228 [TRACE] [helly.internal.handler.ShellyHandler] - Check/set Action event URLs for Relay or Roller for device shellyrgbw2-1e0362
    2020-10-26 16:32:07.231 [DEBUG] [helly.internal.handler.ShellyHandler] - Unable to update status for thing shellyrgbw2-1e0362 - 192.168.178.119: null (class java.lang.NullPointerException)

It seems, that there is a problem in setting the event URLs.

Edit: I’m on OpenHAB 2.5.10

Hi Nils
have you tried it with the shelly binding?
As I can see you are using MQTT.
I had a problem with a RGBW2 until I switched the device type from color to white and back.
After then I was able to handle the shellyRGBW2.
Have a try, mine are running on firmware 20200827-070232/v1.8.3

BR Uwe

1 Like

Hi Uwe,

I’m not using MQTT, I’ve not even installed it. It’s the shelly Binding.
But:

I switched the device type from color to white and back.
After then I was able to handle the shellyRGBW2.

did the trick! Thanks for the hint, my RGBW2 is online now!

BR Nils

Can somebody confirm if this is a known and repeatable “feature” or bug?

I have 2 RGBW2 devices and they both operate the same. It seems that all the features are working except the ability to dim the white channel when the device is set to rgb mode.

Thank you

Hey There,

i am having a problem with adding shelly devices without paperUI. This is my shelly.things:

Thing shelly:shelly1:bcddc2772584 "Light" @ "Garage" [deviceIP="192.168.0.41", userID="peterpan", password="mypassword"]

The Devices are all listed in PaperUI as discovered devices. The Default Username and Password are already set in the binding configuration. When I add them via PaperUI everything works fine…

After saving my shelly.things i see the following in the log:

2020-10-27 13:10:49.077 [hingStatusInfoChangedEvent] - 'shelly:shelly1:bcddc2772584' changed from UNINITIALIZED (HANDLER_CONFIGURATION_PENDING) to UNINITIALIZED (HANDLER_MISSING_ERROR)

2020-10-27 13:10:49.149 [me.event.ThingUpdatedEvent] - Thing 'shelly:shelly1:bcddc2772584' has been updated.

It would be fantastic if you can help me here. :frowning:

Trying to get up and running with the DW2 but having trouble.

Looks like the HTTP server on the DW2 itself is only active for short periods e.g. when the contact sensor changes state. However, the DW2 channels are never updated in the UI. I am guessing the DW2 sends an event to OH when the contact sensor changes state? If so, how is it sent e.g. UDP port? Could be the traffic is being dropped as I have it on an IOT VLAN that is isolated.

EDIT:

Found the info I need actually in the binding doco:

The binding enables CoIoT protocol by default if the device is running firmware 1.6 or newer. CoIoT is based on CoAP and uses a UDP based signaling using IP Multicast (224.0.1.187, port 5683). Again if the device is not on the same local IP subnet you need special router/switch configurations to utilized CoAP via IP Multicast. Otherwise disable the Auto-CoIoT feature in the binding config (not the thing config), disable CoIoT events in the thing configuration and enable sensors events (http callback). Nevertheless in this setup the binding can communicate the device, but you are loosing the benefits of CoIoT.

What are the benefits of CoAP over HTTP callback?

There is no white setting when you are in RGB mode

I suppose that you run the discovery before setting the credentials in the binding config. Delete the thing and re-discover. Go to the Inbox and check/copy the thing name:


(format shelly:xxxx:yyy), copy this name to the thing config.

yes, only for setup purposes. The device needs to be online while you want to add it to your OH setup. If already added delete the device. Press the button to wakeup the device, run OH discovery, add the thing. This automatically initializes the device and also the CoAP listener. The device will then send a CoAP event if something happens and a status update every 12h. CoAP has the big advantage that the updates are near-realtime and it’s less battery consuming compared to http.

Hi,
I have a problem with this configuration:
Openhab 2.5.9 (docker on Synology)
Shelly binding 2.5.10
Shelly i3 firmware: v1.8.3/20200827-070910(4a8bc427)

I’m trying to use a shelly i3 to trigger an action in openhab
I created a thing (manual):

Thing shelly:shellyix3:SHI3-UFF-O-111 “Shelly i3 Porta Laboratorio” @ “Studio”
[deviceIp=“192.168.20.111”, userId=“”, password=“”]

an Item:

String shI3PulsanteLuceUfficioEvent “Pulsante Luce Ufficio LastEvent [%s]” (gUfficio,gShelly)
{channel=“shelly:shellyix3:SHI3-UFF-O-111:status2#lastEvent”}

and a rule:

rule “Test shelly I3”
when
Item shI3PulsanteLuceUfficioEvent changed
then
gEcho.sendCommand(“Ciao”)
end

Everything is working fine but with a minute delay!

I enable debug and make some tests…

22:13:12.633 [DEBUG] [elly.internal.util.ShellyChannelCache] - shellyix3-a4cf12f46e20: Channel status2#input updated with ON (type class org.eclipse.smarthome.core.library.types.OnOffType).
22:13:12.634 [INFO ] [smarthome.event.ItemStateChangedEvent] - shI3PIRScaleAlto changed from OFF to ON
22:13:12.639 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘sh25ScaleNord’ received command ON
22:13:12.648 [INFO ] [arthome.event.ItemStatePredictedEvent] - sh25ScaleNord predicted to become ON
22:13:12.653 [INFO ] [smarthome.event.ItemStateChangedEvent] - sh25ScaleNord changed from OFF to ON
22:13:12.654 [DEBUG] [y.internal.handler.ShellyRelayHandler] - shellyswitch25-68c63af9b1f6: Set relay output to ON
22:15:12.735 [DEBUG] [elly.internal.util.ShellyChannelCache] - shellyix3-a4cf12f46e20: Channel status2#input updated with OFF (type class org.eclipse.smarthome.core.library.types.OnOffType).
22:15:12.738 [INFO ] [smarthome.event.ItemStateChangedEvent] - shI3PIRScaleAlto changed from ON to OFF
22:16:18.659 [DEBUG] [elly.internal.util.ShellyChannelCache] - shellyix3-a4cf12f470b6: Channel status2#input updated with ON (type class org.eclipse.smarthome.core.library.types.OnOffType).
22:16:18.660 [INFO ] [smarthome.event.ItemStateChangedEvent] - shI3PulsanteLuceUfficioInput changed from OFF to ON
22:16:18.666 [DEBUG] [elly.internal.util.ShellyChannelCache] - shellyix3-a4cf12f470b6: Channel status2#eventCount updated with 24 (type class org.eclipse.smarthome.core.library.types.DecimalType).
22:16:18.668 [INFO ] [smarthome.event.ItemStateChangedEvent] - shI3PulsanteLuceUfficioCount changed from 23 to 24
22:18:26.115 [INFO ] [del.core.internal.ModelRepositoryImpl] - Refreshing model ‘shelly.rules’
22:19:18.835 [DEBUG] [elly.internal.util.ShellyChannelCache] - shellyix3-a4cf12f470b6: Channel status2#input updated with OFF (type class org.eclipse.smarthome.core.library.types.OnOffType).
22:19:18.837 [INFO ] [smarthome.event.ItemStateChangedEvent] - shI3PulsanteLuceUfficioInput changed from ON to OFF
22:19:18.837 [DEBUG] [elly.internal.util.ShellyChannelCache] - shellyix3-a4cf12f470b6: Channel status2#eventCount updated with 25 (type class org.eclipse.smarthome.core.library.types.DecimalType).
22:19:18.850 [INFO ] [smarthome.event.ItemStateChangedEvent] - shI3PulsanteLuceUfficioCount changed from 24 to 25
22:19:18.882 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘gEcho’ received command Ciao
22:19:18.886 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘EchoStudio_TTS’ received command Ciao
22:19:18.893 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘EchoCucina_TTS’ received command Ciao
22:19:18.958 [INFO ] [arthome.event.ItemStatePredictedEvent] - EchoStudio_TTS predicted to become Ciao
22:19:18.979 [INFO ] [arthome.event.ItemStatePredictedEvent] - EchoCucina_TTS predicted to become Ciao
22:19:19.051 [INFO ] [smarthome.event.ItemStateChangedEvent] - EchoStudio_TTS changed from to Ciao
22:19:19.075 [INFO ] [smarthome.event.ItemStateChangedEvent] - EchoCucina_TTS changed from to Ciao
22:19:20.272 [INFO ] [smarthome.event.ItemStateChangedEvent] - EchoCucina_TTS changed from Ciao to
22:19:27.695 [INFO ] [smarthome.event.ItemStateChangedEvent] - EchoStudio_TTS changed from Ciao to

after reading the post I understood that with new firmware this action are passed via CoIoT that is a multicast protocol running on UDP port 5683.
I natte the port in my docker, but I suspect that no updates arrives and my state changed only after a 60seconds poll from the binding.

I checked the traffic on my Synology (docker host) with tcp dump:

22:59:24.990955 IP 192.168.20.111.5683 > 224.0.1.187.5683: UDP, length 168
22:59:40.011136 IP 192.168.20.111.5683 > 224.0.1.187.5683: UDP, length 168
22:59:55.031772 IP 192.168.20.111.5683 > 224.0.1.187.5683: UDP, length 168
23:00:05.730896 IP 192.168.20.2.50858 > 192.168.20.111.http: Flags [S], seq 2582112739, win 29200, options [mss 1460,sackOK,TS val 210407445 ecr 0,nop,wscale 7], length 0
23:00:05.736835 IP 192.168.20.111.http > 192.168.20.2.50858: Flags [S.], seq 112700138, ack 2582112740, win 2144, options [mss 536,nop,nop,sackOK], length 0
23:00:05.737021 IP 192.168.20.2.50858 > 192.168.20.111.http: Flags [.], ack 1, win 29200, length 0
23:00:05.737335 IP 192.168.20.2.50858 > 192.168.20.111.http: Flags [P.], seq 1:218, ack 1, win 29200, length 217: HTTP: GET /status HTTP/1.1
23:00:05.782130 IP 192.168.20.111.http > 192.168.20.2.50858: Flags [P.], seq 1:537, ack 218, win 1927, length 536: HTTP: HTTP/1.1 200 OK
23:00:05.782249 IP 192.168.20.2.50858 > 192.168.20.111.http: Flags [.], ack 537, win 30016, length 0
23:00:05.785020 IP 192.168.20.111.http > 192.168.20.2.50858: Flags [P.], seq 537:752, ack 218, win 1927, length 215: HTTP
23:00:05.785089 IP 192.168.20.2.50858 > 192.168.20.111.http: Flags [.], ack 752, win 31088, length 0
23:00:05.785250 IP 192.168.20.2.50858 > 192.168.20.111.http: Flags [F.], seq 218, ack 752, win 31088, length 0
23:00:05.787391 IP 192.168.20.111.http > 192.168.20.2.50858: Flags [.], ack 219, win 1926, length 0
23:00:05.788444 IP 192.168.20.111.http > 192.168.20.2.50858: Flags [F.], seq 752, ack 219, win 1926, length 0
23:00:05.788516 IP 192.168.20.2.50858 > 192.168.20.111.http: Flags [.], ack 753, win 31088, length 0
23:00:09.228437 IP 192.168.20.111.mdns > 224.0.0.251.mdns: 0* [0q] 6/0/0 PTR _http._tcp., PTR shellyix3-A4CF12F470B6._http._tcp.local., (Cache flush) SRV shellyix3-A4CF12F470B6.local.:80 0 0, (Cache flush) TXT “id=shellyix3-A4CF12F470B6” “fw_id=20200827-070910/v1.8.3@4a8bc427” “arch=esp8266”, (Cache flush) A 192.168.20.111, (Cache flush) NSEC (465)
23:00:10.047802 IP 192.168.20.111.5683 > 224.0.1.187.5683: UDP, length 168
23:00:10.733668 ARP, Request who-has 192.168.20.111 tell 192.168.20.2, length 28
23:00:10.735413 ARP, Reply 192.168.20.111 is-at a4:cf:12:f4:70:b6 (oui Unknown), length 46
23:00:25.048074 IP 192.168.20.111.5683 > 224.0.1.187.5683: UDP, length 168
23:00:40.048958 IP 192.168.20.111.5683 > 224.0.1.187.5683: UDP, length 168
23:00:55.066872 IP 192.168.20.111.5683 > 224.0.1.187.5683: UDP, length 168

That seems to confirm my suspect.
The Multicast traffic arrives to the host, but I see no trace on openhab logs and the status is changed after a request from openhab (192.168.20.2) versus the Shelly i3 (192.168.20.111).

Is there a way to enable CoIoT on docker?
(The network host mode is not possible)

Regards
Andrea

I know that someone figured this out,. You need to make changes to your docker setup, but I’m nit familar with this. Check this issue: https://github.com/openhab/openhab-addons/issues/7838, try to contact the author. @redm123

Could anybody else help?

I auto helped myself :slight_smile:

My guess was right, the problem was docker with network in bridge mode (no mDns nor Multicast in general…)

To solve the problem you must create a macvlan network in docker:

Lets say you have a docker host with IP address 192.168.20.2/24 and you want to create an openhab container with ip 192.168.20.30/24 (same network, different ip)

docker network create
-d macvlan
–subnet=192.168.20.0/24
–gateway=192.168.20.1
-o parent=ovs_eth0 vlan120

the parent (ovs_eth0) is the physical interface that connect the host to the network, in my Synology is ovs_eth0 but usually is eth0. You can check with ifconfig.
VLAN120 is the name of the new network, you can of course use whatever you want.

then you can create the openhab container:

sudo docker run
–name openhab-vlan120
–net=vlan120
–dns=8.8.8.8
–ip=192.168.20.30
-v /volume1/homes/openhab2.5/conf:/openhab/conf
-v /volume1/homes/openhab2.5/userdata:/openhab/userdata
-v /volume1/homes/openhab2.5/addons:/openhab/addons
-d
-e USER_ID=1028
-e GROUP_ID=100
–restart=always
openhab/openhab:2.5.9

If your host is also the DNS, you must define a --dns option, because the container in mtacvlan mode is UNABLE to comunicate with the docker host.
the new machine is at ip 192.168.20.30 and the shelly binding and all the other bindings with multicast are working fine.

Hope can help someone else.
Andrea

On the Shelly web app there’s the ability to control the white channel independently from the rgb channel. I thought there may be something wrong with my set up. Is the brightness of the white channel something that could be added in future revisions?

Hello,
I have problems with my DW2. I deletetd my DW 2 in the things via Paper UI and I updated to Shelly Binding 2.5.10 and I resettet my DW2 to factory reset. After that I added it again with the shelly app.
The Shelly Binding found a new device and I added it. Now I get no more updates in the logfile, but I can see the updates in the browser UI and in the app. CoIoT is enabled in the device and the binding.
What can I try?