Shelly Binding

if it’s helps you, here is a part of my rollershutters items file

as you can see, item that i want to be visible by google assistant are tagged [ “Blinds”]

//volets salon

Group volet_salon                                                                                            (volets_maison)

Rollershutter   ShellysalonRollerControl         "le volet du salon"                                         (volet_salon,volets_maison)   [ "Blinds" ]     {channel="shelly:shelly25-roller:68867a:roller#control"}  
Dimmer          ShellysalonRollerRollerpos       "volet du salon (100=open, 0=closed)"                                                                      {channel="shelly:shelly25-roller:68867a:roller#rollerpos"}
String          ShellysalonRollerLastDirection   "Last roller direction"                                                                                    {channel="shelly:shelly25-roller:68867a:roller#lastDirection"}
String          ShellysalonRollerStopReason      "Roller stop reason"                                                                                       {channel="shelly:shelly25-roller:68867a:roller#stopReason"}

1 Like

Thank you. Do you set up the things via PaperUI or do you have a things file as well?

no only items

check out the google assistant documentation https://www.openhab.org/docs/ecosystem/google-assistant/
You can add tags using the rest API:

curl -X PUT --header “Content-Type: application/json” --header “Accept: application/json” “http://localhost:8080/rest/items/[itemname]/tags/Lighting

or the console:

smarthome:items addTag MickTest Lighting

How did I miss that? I have about 50 shellies in my house and MQTT is killing me here… WIll try out ASAP!

so you are a good test candidate for the next release :slight_smile:

2.4.2-SNAPSHOT release notes (wip_2019-09-06_coap)

  • Support for Shelly Flood
  • Support for Shelly EM (primarily)
  • Support for Shelly Dimmer (primarily)
  • Create special device (shelly-protected) when device is password protected
  • CoIoT/COAP support added (experimental, needs to be activated in thing config)
  • channel name meter.totalWatts changed to meter.totalKWH (returns kw/h, not Watts)
  • Roller: re-added OnOffType (so you could send OPEN or ON / CLOSE or OFF / STOP)
  • RGBW2: adjust numMeter (doesn’t report this as part of the device property) -> work around for meter.Watts missing
  • Sense: read IR code list for Sense from device rather than hard coded list
  • fixed update scheduling on exceptions (e.g. HT not reachable)
  • Activation of Channel Cache is delayed for 60s to make sure that Persinstence restore is already done
  • logging revised (include device name on most logs), more details about the bundle on startup

I’m going to close this release shortly. Let me know if you are aware of issues or have a small feature request.

This will be 2.4.2. After that I start re-factoring and get ready for PR submission. OH 2.5 will be release in December, I try to make it into this release.

3 Likes

Hi there! Thank you for developing this binding!

Unfortunately I had an issue trying to install the most recent shelly binding causing in an error of my existing config. All Z-wave devices got UNINITIALIZED after adding the shelly…jar manual installation procedure.
The Z-Wave binding is also a manually installed binding: org.openhab.binding.zwave-2.5.0-SNAPSHOT.jar

It took a while to get it back repaired with the following through Karaf:

feature:install openhab-transport-serial

After reboot, the Z-Wave Binding worked again as expected!

Hope this helps for troubleshooting. I will use the shelly’s 2.5 with MQTT until the binding is ready.

BR
Uwe

I‘m pretty sure that this was a side effect from another action,. I also run zwave and Shelly in parallel. Shelly doesn‘t deal with serial connections nor install/uninstalls any features or other modules/files. Maybe a cache problem?

I was emptying the cache and temp folders before and I also have stopped the openhab2 instance… Maybe some other hints how to try again adding the binding?

Do we need to recreate things/items to test this new snapshot?

yes, any changes to the channel definition require re-creation of the things

I think you already went the right way

  • delete the Shelly things
  • stop OH
  • delete old version from addons folder
  • clean cache
  • copy snapshot build to addons folder
  • start OH and wait until everything is initialized
  • run thing discovery from Inbox

Usually PaperUI finds the old thing/items linkage, because the Thing ID doesn’t changed.

@markus7017, just install last snapshot build and works fine with coap on roller shutter. Only few warning :

22:28:04.613 [WARN ] [helly.internal.coap.ShellyCoapHandler] - SHSW-21#32B18F#1: Update for unknown sensor[4]: Index=118, Value=0.0
22:28:04.613 [WARN ] [helly.internal.coap.ShellyCoapHandler] - SHSW-21#32B18F#1: Update for unknown sensor[5]: Index=128, Value=0.0
22:28:04.860 [WARN ] [helly.internal.coap.ShellyCoapHandler] - SHSW-21#32B18F#1: Update for unknown sensor[4]: Index=118, Value=0.0
22:28:04.861 [WARN ] [helly.internal.coap.ShellyCoapHandler] - SHSW-21#32B18F#1: Update for unknown sensor[5]: Index=128, Value=0.0
22:28:06.200 [INFO ] [smarthome.event.ItemStateChangedEvent] - Compteur_PAPP changed from 590 to 600
22:28:07.925 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'Test_Volet' received command STOP
22:28:07.928 [INFO ] [shelly.internal.handler.ShellyHandler] - shellyswitch-32b18f: Roller command/position STOP
22:28:07.929 [INFO ] [shelly.internal.handler.ShellyHandler] - shellyswitch-32b18f: Stop roller
22:28:07.940 [INFO ] [smarthome.event.ItemStateChangedEvent] - Compteur_PAPP changed from 600 to 640
22:28:07.940 [INFO ] [smarthome.event.ItemStateChangedEvent] - Compteur_WhHP changed from 38074 to 38075
22:28:08.331 [WARN ] [helly.internal.coap.ShellyCoapHandler] - SHSW-21#32B18F#1: Update for unknown sensor[4]: Index=118, Value=0.0
22:28:08.332 [WARN ] [helly.internal.coap.ShellyCoapHandler] - SHSW-21#32B18F#1: Update for unknown sensor[5]: Index=128, Value=0.0
22:28:09.214 [INFO ] [smarthome.event.ItemStateChangedEvent] - Test_Volet changed from 0 to 81
22:28:09.215 [INFO ] [smarthome.event.ThingUpdatedEvent    ] - Thing 'shelly:shelly2-roller:bureau' has been updated.
22:28:11.420 [INFO ] [smarthome.event.ItemStateChangedEvent] - Compteur_PAPP changed from 640 to 590
22:28:18.380 [INFO ] [smarthome.event.ItemStateChangedEvent] - Compteur_WhHP changed from 38075 to 38076
22:28:19.088 [INFO ] [smarthome.event.ThingUpdatedEvent    ] - Thing 'shelly:shelly2-roller:bureau' has been updated.
22:28:19.106 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler ShellyHandler of thing shelly:shelly2-roller:bureau tried updating channel roller#control although the handler was already disposed.
22:28:19.107 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler ShellyHandler of thing shelly:shelly2-roller:bureau tried updating channel roller#rollerpos although the handler was already disposed.
22:28:19.107 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler ShellyHandler of thing shelly:shelly2-roller:bureau tried updating channel roller#lastDirection although the handler was already disposed.
22:28:19.107 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler ShellyHandler of thing shelly:shelly2-roller:bureau tried updating channel roller#stopReason although the handler was already disposed.
22:28:19.108 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler ShellyHandler of thing shelly:shelly2-roller:bureau tried updating channel roller#overtemp although the handler was already disposed.
22:28:19.108 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler ShellyHandler of thing shelly:shelly2-roller:bureau tried updating channel meter#lastPower1 although the handler was already disposed.
22:28:19.108 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler ShellyHandler of thing shelly:shelly2-roller:bureau tried updating channel meter#lastPower2 although the handler was already disposed.
22:28:19.109 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler ShellyHandler of thing shelly:shelly2-roller:bureau tried updating channel meter#lastPower3 although the handler was already disposed.
22:28:19.109 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler ShellyHandler of thing shelly:shelly2-roller:bureau tried updating channel meter#currentWatts although the handler was already disposed.
22:28:19.109 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler ShellyHandler of thing shelly:shelly2-roller:bureau tried updating channel meter#totalKWH although the handler was already disposed.
22:28:19.110 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler ShellyHandler of thing shelly:shelly2-roller:bureau tried updating channel meter#timestamp although the handler was already disposed.
22:28:19.110 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler ShellyHandler tried updating its thing's properties although the handler was already disposed.

Edit : I use textual config not paperui

sounds good, please provide the log so I could check what sensors 118 and 128 are or go to the thing ptoperties and copy the coapDeviceDescriptiom here

@furax54 @markus7017
118 and 128 are the new input sensors from beta firmware. These will be available in the next official firmware.

1 Like

ok, I‘m add the same handling for Relay/Roller as we have it for the Dimmer

1 Like

thx for release,

all works fine throught this method:

delete the Shelly things
stop OH
delete old version from addons folder
clean cache
copy snapshot build to addons folder
start OH and wait until everything is initialized
run thing discovery from Inbox

Ps always the same flood of update events (might disapears in final revision)
thx for your great work again

Hi and thanks again!

I tried another run with the way you have proposed…

Again all Z-Wave things moved to uninitialised and I have fixed it with:

feature:install openhab-transport-serial

OH has discovered the Shelly 2.5 in Rollershutter mode but it is still not initialised:

Shellyswitch25-xxxxx - OFFLINE-COMMUNICATION_ERROR
and more detailed:

Status: OFFLINE - COMMUNICATION_ERROR Shelly API call failed on url=http://192.168.0.91/settings, response=ERROR: java.util.concurrent.TimeoutException: Total timeout 2500 ms elapsed - class java.io.IOException

Also the logs are flooded with the following every three seconds:

2019-10-15 12:03:34.837 [INFO ] [helly.internal.handler.ShellyHandler] - Thing shellyswitch25-68742c successfully initialized.

2019-10-15 12:03:35.970 [INFO ] [helly.internal.handler.ShellyHandler] - Thing shellyswitch25-68757f successfully initialized.

2019-10-15 12:03:38.320 [INFO ] [helly.internal.handler.ShellyHandler] - Status update triggered thing initialization for device shellyswitch25-68742c

2019-10-15 12:03:38.321 [INFO ] [helly.internal.handler.ShellyHandler] - Start initializing thing shellyswitch25-68742C, ip address 192.168.0.91

2019-10-15 12:03:38.628 [INFO ] [helly.internal.handler.ShellyHandler] - Initializing device shellyswitch25-68742c, type SHSW-25, Hardware: Rev: prod-2019-03, batch 1; Firmware: v1.5.3 / 20190822-102551 (1c2d4dd5); Thing Type=shelly25-roller

2019-10-15 12:03:38.738 [INFO ] [helly.internal.handler.ShellyHandler] - Current settings for relay[0]: btn_on_url=http://192.168.0.184:8080/shelly/event/shellyswitch25-68742c/relay/0?type=btn_on/btn_off_url=http://192.168.0.184:8080/shelly/event/shellyswitch25-68742c/relay/0?type=btn_off, out_on_url=http://192.168.0.184:8080/shelly/event/shellyswitch25-68742c/relay/0?type=out_on, out_off_url=http://192.168.0.184:8080/shelly/event/shellyswitch25-68742c/relay/0?type=out_off

Any idear what is wrong?

Many thanks in advance!
BR
Uwe

PS: Using newest snapshot: wip_2019-09-06_coap on a Raspberry 4 with Openhabian - openHAB 2.4.0-1 (Release Build)

so, i’m back, the openHAB reinstalled, Shellys re-added, same situations,

what i can do?

I have no vlue what causes that problem. I‘m still on 2.4 and run Shelly and zwave in parallel without any issues

really the complete sequence? yes, I still need to change the level for sone messages, but you should see the initialization sequence only once per thing, othetwisr something is wrong in your setup