Shelly Binding

I am going to check that this evening.

Hi,can someone post an example from his .items files how looks like the syntax from a shelly 2.5

Thanks
Nikos

Yes I have two Shelly flood :slight_smile:
How may I help to get them working by your binding?

I checked with “bundle:list” in karaf, but could not find any shelly binding.
How could I force an installation?

nice

  • connect the device to your network
  • launch the app, get the ip address from the device information
  • make a screenshot of the UI panel (showing the sensor status)
  • open the browser and execute the following urls
    http:://settings
    http:://status
  • send me the files as PM or post here
    Thx
1 Like
  • delete the jar from the addons folder
  • open OH console and run
feature:install esh-io-transport-mdns
log:set TRACE org.openhab.binding.shelly
  • open a terminal window and run “tail -f openhab.log”
  • copy the binding jar to the addons folder and check what happens in the terminal

if this isn’t success the only additional module is gson, try

  • delete jar
  • open OH console
bundle:install http://central.maven.org/maven2/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar
  • copy jar to addons folder

Not working for me either on a fresh VM Ubuntu 18.04.3 LTS with openHAB 2.4 stable.
Followed all steps above, Shelly binding is not shown with bundle:list command and there is nothing in the logs.

Status:
{“wifi_sta”:{“connected”:true,“ssid”:“XXXXX”,“ip”:"XXXXXXXX“,“rssi”:-88},“cloud”:{“enabled”:false,“connected”:false},“mqtt”:{“connected”:true},“time”:“11:07”,“serial”:1,“has_update”:false,“mac”:“XXXXXXX”,“is_valid”:true,“flood”:false,“tmp”:{“value”:21.62,“units”:“C”,“tC”:21.62,“tF”:70.93, “is_valid”:true},“bat”:{“value”:95,“voltage”:2.92},“act_reasons”:[“button”], “rain_sensor”:false,“update”:{“status”:“idle”,“has_update”:false,“new_version”:“20190821-095233/v1.5.2@4148d2b7”,“old_version”:“20190821-095233/v1.5.2@4148d2b7”},“ram_total”:50592,“ram_free”:39632,“fs_size”:233681,“fs_free”:154365,“uptime”:22}

Settings:
{“device”:{“type”:“SHWT-1”,“mac”:“XXXXXXXX”,“hostname”:“shellyflood-XXXXXX”,“sleep_mode”:true},“wifi_ap”:{“enabled”:false,“ssid”:“shellyflood-XXXXXX”,“key”:""},“wifi_sta”:{“enabled”:true,“ssid”:“XXXXXX”,“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”:true,“server”:“XXXXXX”,“user”:“XXXXXX”,“reconnect_timeout_max”:60.000000,“reconnect_timeout_min”:2.000000,“clean_session”:true,“keep_alive”:60,“will_topic”:“shellies/shellyflood-XXXXXX/online”,“will_message”:“false”,“max_qos”:0,“retain”:false,“update_period”:30},“sntp”: {“server”:“time.google.com”},“login”:{“enabled”:true,“unprotected”:false,“username”:“XXXXXXX”,“password”:“XXXXXX”},“pin_code”:"",“coiot_execute_enable”:false,“name”:"",“fw”:“20190821-095233/v1.5.2@4148d2b7”,“build_info”:{“build_id”:“20190821-095233/v1.5.2@4148d2b7”,“build_timestamp”:“2019-08-21T09:52:33Z”,“build_version”:“1.0”},“cloud”:{“enabled”:false,“connected”:false},“timezone”:“Europe/Berlin”,“lat”:50.110901,“lng”:8.682130,“tzautodetect”:true,“time”:“11:09”,“sensors”:{“temperature_threshold”:1.0,“temperature_unit”:“C”},“sleep_mode”:{“period”:24,“unit”:“h”},“report_url”:null, “rain_sensor”:false}

Markus,
I followed your description above and could not find anything in the openhab.log regarding shelly. And also the “bundle:list” command did not show anything.
Do you have any other ideas. I really would like to use your binding.
Thank you for your help.

let me do a rebuild tomorrow, maybe the jar is not consistent

thanks for the Flood infos, I’ll work on this tomorrow

Hi Markus,
the Binding works perfect for my Shelly1 but I have some trouble with the ShellyHT. It works for a while, then suddenly for a longer time it is unreachable (Status in PaperUI is „Initializing“) and also suddenly it appears again.
Here is the log with both scenarios:

2019-08-23 22:37:57.217 [DEBUG] [elly.internal.api.ShellyEventServlet] - CallbackServlet: HTTP/1.1 Request from XXXXXXXXX:56390/shelly/event/shellyht-d0ed0a/sensordata?{hum=[61],temp=[23.25]}

    2019-08-23 22:37:57.220 [DEBUG] [helly.internal.handler.ShellyHandler] - Event received for device shellyht-d0ed0a: class=sensordata, index=, parameters={hum=[61],temp=[23.25]}

    2019-08-23 22:37:57.223 [DEBUG] [helly.internal.handler.ShellyHandler] - Trigger sensordata event, channel sensors#event, payload={"device":"shellyht-d0ed0a", "class":"sensordata", "index":"","parameters":[{"hum":"61"}, {"temp":"23.25"}]}

    2019-08-23 22:37:57.225 [DEBUG] [helly.internal.handler.ShellyHandler] - Request a refresh of the settings for device shellyht-d0ed0a

    2019-08-23 22:37:59.875 [DEBUG] [helly.internal.handler.ShellyHandler] - Shelly status info for shellyht-d0ed0a: {"wifi_sta":{"connected":true,"ssid“:“XXXXX“,“ip“:“XXXXXXXXX“,“rssi":-63},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"22:38","serial":1,"has_update":false,"mac“:“XXXXXXXXX“,“is_valid":true,"tmp":{"value":23.25,"units":"C","tC":23.25,"tF":73.85, "is_valid":true},"hum":{"value":61.5, "is_valid":true},"bat":{"value":96,"voltage":2.92},"act_reasons":["sensor"],"connect_retries":0,"update":{"status":"unknown","has_update":false,"new_version":"","old_version":"20190821-095211/v1.5.2@4148d2b7"},"ram_total":50584,"ram_free":40476,"fs_size":233681,"fs_free":163401,"uptime":4}

    2019-08-23 22:37:59.877 [DEBUG] [helly.internal.handler.ShellyHandler] - shellyht-d0ed0a: Updating sensor

    2019-08-23 22:38:00.021 [DEBUG] [helly.internal.handler.ShellyHandler] - 0 more updates requested

    2019-08-23 22:39:42.255 [DEBUG] [helly.internal.handler.ShellyHandler] - Shelly status info for shellyht-d0ed0a: {"wifi_sta":{"connected":true,"ssid“:“XXXXXX,“ip“:“XXXXXXXX“,“rssi":-62},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"22:39","serial":1,"has_update":false,"mac“:“XXXXXXXX“,“is_valid":true,"tmp":{"value":23.25,"units":"C","tC":23.25,"tF":73.85, "is_valid":true},"hum":{"value":61.5, "is_valid":true},"bat":{"value":96,"voltage":2.92},"act_reasons":["sensor"],"connect_retries":0,"update":{"status":"idle","has_update":false,"new_version":"20190821-095211/v1.5.2@4148d2b7","old_version":"20190821-095211/v1.5.2@4148d2b7"},"ram_total":50584,"ram_free":40632,"fs_size":233681,"fs_free":163401,"uptime":107}

    2019-08-23 22:39:42.258 [DEBUG] [helly.internal.handler.ShellyHandler] - shellyht-d0ed0a: Updating sensor

    2019-08-23 22:54:47.611 [INFO ] [helly.internal.handler.ShellyHandler] - Thing Shelly HT not reachable, update canceled!

    2019-08-24 13:36:45.519 [INFO ] [helly.internal.handler.ShellyHandler] - Thing Shelly HT not reachable, update canceled!

    2019-08-24 13:38:30.365 [DEBUG] [elly.internal.api.ShellyEventServlet] - CallbackServlet: HTTP/1.1 Request from XXXXXXXX:21907/shelly/event/shellyht-d0ed0a/sensordata?{hum=[80],temp=[24.25]}

    2019-08-24 13:38:30.369 [DEBUG] [helly.internal.handler.ShellyHandler] - Event received for device shellyht-d0ed0a: class=sensordata, index=, parameters={hum=[80],temp=[24.25]}

    2019-08-24 13:38:30.374 [DEBUG] [helly.internal.handler.ShellyHandler] - Trigger sensordata event, channel sensors#event, payload={"device":"shellyht-d0ed0a", "class":"sensordata", "index":"","parameters":[{"hum":"80"}, {"temp":"24.25"}]}

    2019-08-24 13:38:30.379 [DEBUG] [helly.internal.handler.ShellyHandler] - Request a refresh of the settings for device shellyht-d0ed0a

    2019-08-24 13:38:30.877 [DEBUG] [helly.internal.handler.ShellyHandler] - Shelly status info for shellyht-d0ed0a: {"wifi_sta":{"connected":true,"ssid“:“XXXXX“,“ip“:“XXXXXXXX“,“rssi":-67},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"","serial":1,"has_update":false,"mac“:“XXXXXXXXXX“,“is_valid":true,"tmp":{"value":24.25,"units":"C","tC":24.25,"tF":75.65, "is_valid":true},"hum":{"value":80.5, "is_valid":true},"bat":{"value":92,"voltage":2.89},"act_reasons":["sensor"],"connect_retries":0,"update":{"status":"unknown","has_update":false,"new_version":"","old_version":"20190821-095211/v1.5.2@4148d2b7"},"ram_total":50584,"ram_free":40616,"fs_size":233681,"fs_free":163401,"uptime":2}

    2019-08-24 13:38:30.881 [DEBUG] [helly.internal.handler.ShellyHandler] - shellyht-d0ed0a: Updating sensor

    2019-08-24 13:38:30.985 [DEBUG] [helly.internal.handler.ShellyHandler] - 0 more updates requested

I get this error when I want to install??

[ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-binding-shelly'

Can somebody help me?

That behaviour of Shelly HT is absolutely normal and will happen to the Flood as well. Both devices are battery operated, so they are in deep sleep mode most of the time and not reachable. That’s why i said polling rhem is a bad idea. With the latest firmwareupdate the HT supports actions and Markus is working on rhe CoAP implementation, so stay tuned for the next versions😉

even if the temperature or humidity changes significantly?

Depends on your treshold settings.
Just try to open the device webserver when you see the error os occuring in the log.

I know - increase/decrease was above the thresholds

Did you set treshold below 1 degree? If not, don‘t see anything wrong.

I saw that there is a firmware 1.52, maybe they fixed something (1.51 was already a fix for the event handling)

You could find a new buld in the snapshot branch
https://github.com/markus7017/org.openhab.binding.shelly/blob/snapshot/target/org.openhab.binding.shelly-2.4.0-SNAPSHOT.jar

2.4.2-SNAPSHOT release notes

  • Support for Shelly Flood
  • Support for Shelly EM (primarily)
  • Create special device (shelly-protected) when device is password protected
  • channel name meter.totalWatts changed to meter.totalKWH (returns kw/h, not Watts)

HT got a new firmware: 1.52
Shelly 2.5 even newer: 1.53

Please verify Shelly Flood and provide a TRACE log