Shelly Binding

hmm, sounds strange, do you see the things twice?

Yes, same Item already added as thing and the same again in the inbox.

Thing:


Inbox:

With 3.0 Binding it is OK, and when I switch to 3.1 Binding, then it happens.

But by the last try to change to the 3.1 binding, it was with all Devices and now only one H&T, and after a while it will be removed from the inbox and again after a white the next H&T is on the inbox for a while.

Entries on LOG:

2021-01-29 07:30:21.735 [INFO ] [y.internal.handler.ShellyBaseHandler] - shellyht-956506: Event erzeugt: PERIODIC
2021-01-29 07:30:36.747 [INFO ] [y.internal.handler.ShellyBaseHandler] - shellyht-956506: Event erzeugt: PERIODIC
2021-01-29 07:33:28.638 [INFO ] [y.internal.handler.ShellyBaseHandler] - shellyht-956b19: Event erzeugt: SENSOR
2021-01-29 07:33:28.645 [WARN ] [network.InMemoryMessageExchangeStore] - coap Exchange[L5304] with manual token overrides existing Exchange[L5303] with open request: KeyToken[192.168.17.97:5683-]
2021-01-29 07:33:28.811 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'shelly:shellyht:956b19' to inbox.
2021-01-29 07:33:30.588 [INFO ] [y.internal.handler.ShellyBaseHandler] - shellyht-956b19: Event erzeugt: SENSOR
2021-01-29 07:36:57.050 [INFO ] [y.internal.handler.ShellyBaseHandler] - shellyht-956473: Event erzeugt: PERIODIC
2021-01-29 07:36:57.055 [WARN ] [network.InMemoryMessageExchangeStore] - coap Exchange[L6048] with manual token overrides existing Exchange[L6047] with open request: KeyToken[192.168.17.65:5683-]
2021-01-29 07:36:57.183 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'shelly:shellyht:956473' to inbox.
2021-01-29 07:36:57.527 [INFO ] [y.internal.handler.ShellyBaseHandler] - shellyht-956473: Event erzeugt: PERIODIC

Thanks for your help.

Hello,

i have a problem with shelly binding 2.5.12.
i add a new shelly 1pm to my openhab system but after i add it to my items and to my sitemap i can see the output switch turned on and off in round about 10sec steps.
After i power off my shelly the error has not resolved and it is still displayed to me with on and off as well as online and offline.

Do you know how to solve the problem?

The other shelly 1pm are working fine in my system.

Do you have enabled auto-on/off timer?

that looks strange, I donā€™t have an idea what causes the problem. I know other users with H&T running the 3.1 SNAPSHOT of the binding. Try to delete and re-discover the thing.

After a restart of OpenHAB all shelly devices (1, 2.5, H&T, etc) are on inbox.
When I remove the thing and add it again from the inbox all channel links from items to things (from the deletet and re-added thing) are broken. I must relink them all again (very mutch effort).

The UID from the thing has changed, I think this is the problem:
before: shelly:shellydevice:e098069504dd
after: shelly:shelly25-relay:e098069504dd

Should I now delete all things and add them again and made all channel links new -> mutch effort by 32 things?

ok, are you using password protection?

It seems that you added the thing and afterwards set the credentials in the binding options.

  • delete all things
  • set credentials in binding settings
  • re-discover and add them all
  • re-link items

This is a one time effort. You should avoid mixing devices using the brindingā€™s default and those having credentials in the thing config. The problem is: I can only change the thing type, but once the thing is created I canā€™t change the thing name (replace shellydevice with shelly25-relay)

You are right. I use password protection and I add the device without the credentials on the binding configuration.
The reason is, because the binding was not visible on openhab 3.0.0 with your dev binding around 20.12.2020.
But now it is here.
OK, I will remove all shelly things and add again and renew the link to the items.

:+1: as said, itā€™s a one time effort

Hi,

I have some trouble with the Shelly Binding in combination with the Google Assistant integration.

Short Overview:
Shelly RGBW2
Firmware 20201124-092159/v1.9.0@57ac4ad8
RGB Mode

OpenHAB 3.0.1
Channel color#hsb linked to Item Test (Color)

I can control Color and Brightness over the openHAB Web interface, for example Color Red 71% Brightness:

2021-02-02 19:54:18.847 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Test' received command 0,100,71
2021-02-02 19:54:18.847 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'Test' predicted to become 0,100,71
2021-02-02 19:54:18.847 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Test' changed from 0,100,21 to 0,100,71

Now I change the Brightness to a lower value to see the difference e.g. 10%, after that I open the Google Home App (Brightness 10% is shown correct) and set the Brightness again to 71%

2021-02-02 19:57:23.238 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Test' received command 71
2021-02-02 19:57:23.254 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'Test' predicted to become 71
2021-02-02 19:57:23.254 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Test' changed from 0,100,10 to 0,100,71

The Slider in the Webinterface changes also to 71% but the Shelly controller remains on 10% Brightness.

The only difference I could find, that the command coming from Google Home is not the same as if I set it from the Webinterface.

But in the end i would compare the change event which is the sameā€¦ or do I miss something?

Hi,

After reading through all that I could find to the topic without finding a solution to my problem, Iā€™m going to try this thread here now.

I have setup a lot of Shellys in my home already and use them successfully with the binding. Everything works really smoothly - other than events!

Iā€™m currently trying to get an event from a Shelly1 whenever the switch (SW) is pushed so I can also turn on a Hue Lightstrip. In essence it is working but it takes between 2-60 seconds until openhab notices the button push.

All Shellys including the one Iā€™m trying to subscribe to the event are on the latest firmware 1.9.4 and Iā€™m running OpenHAB 3.0.1 inside a docker container on my Synology NAS with network:host

The binding is in default state, so autoCoIoT is enabled.
All my things are setup using files, no UI configuration.

shelly.things

Thing shelly:shelly1:CellarLight  "Shelly1 Cellar Light" @ "Cellar"  [deviceIp="192.168.188.139", userId="", password="", eventsSwitch=true, eventsPush=true, eventsButton=true]

shelly.rules

rule "Switch Cellar Lights CHANGED"
when 
    Item Shelly_CellarLight_Switch changed
then
    logInfo("rules.switch_cellar_ligths", "Shelly_CellarLight_Switch updated to " + Shelly_CellarLight_Switch.state)
    CellarStairsLights_Switch.sendCommand(Shelly_CellarLight_Switch.state.toString)
end

rule "Switch Cellar Lights PRESSED"
when 
    Channel "shelly:shelly1:CellarLight:relay#button" triggered SHORT_PRESSED
then
    logInfo("rules.switch_cellar_ligths", "button SHORT_PRESSED")
end

No matter what I do, I never receive any event. It seems only the refresh poll mechanism will do an update on the Switch and then fire the CHANGED rule

Can anyone help and point me into the right direction?

Thanks!!
Matthias

Did you checked the README with regards to network aspects when using CoAP, esp. if the Shelly is on a different subnet? Are you on DEV build?

Hey Markus,

yes, Iā€™ve read the README - at least if you are referring to Shelly Binding Docs.

The Shelleys are all in the same Subnet as the OpenHAB server, even though OpenHAB is running inside docker. (Iā€™m using network: host)

Iā€™m not on a DEV build. Iā€™m using the official 3.0.1 docker image running on Debian

Here is an excerpt of my docker-compose.yml

openhab3:
  image: openhab/openhab:3.0.1-debian
  container_name: openhab3
  hostname: openhab3
  network_mode: host
  tty: true
  cap_add:
    - NET_ADMIN
    - NET_RAW
  privileged: true
  restart: always
  environment:
    OPENHAB_HTTP_PORT: "8080"
    OPENHAB_HTTPS_PORT: "8443"
    USER_ID: "1026"
    GROUP_ID: "100"
    EXTRA_JAVA_OPTS: "-Duser.timezone=Europe/Berlin"
  ports:
    - "8080:8080"
    - "8443:8443"
  volumes:
    - /etc/localtime:/etc/localtime:ro
    - /volume1/docker/openhab3/conf:/openhab/conf
    - /volume1/docker/openhab3/userdata:/openhab/userdata
    - /volume1/docker/openhab3/addons:/openhab/addons
  command: "tini -s ./start.sh server"

So Iā€™m pretty sure, multicast should be working, but it is possible Iā€™m missing something here. Is there a way I can debug this in any way?

Since I did not use rules in the past, there might also be something wrong with them?

Hi, I see that the Shelly UNI is not supported, is there any plans to support it?
Thanks

Itā€™s already done, switch to DEV build

This also includes Shelly Motion

ā€”

Latest DEV build: 2.5.13 - 3.1.0 - README - Installation - Bugs/Features - Firmware Index - Firmware Archive - API Doc
Note: The binding version included in the final OH 3.0 distro is significantly older than the DEV build. I canā€™t make it in-time. Make sure you deleted older versions of the binding when installing the 2.5.13-SNAPSHOT or 3.1.0-SNAPSHOT if you are already on OH 3.

1 Like

are you on DEV build?

Hi Markusm

I have installed OH 3.1.0-SS on 6th Jan. Is this same Version of Binding? I see your file was created about 19days ago, it looks like, right?

This because Shelly Support requested me to update my shelly h&t to latest firmware and set a static IP rather than static DHCP because of ongoing troubleshooting why batteries are drained off within 1 month at most. Note: 1 device is on battery, a second one on USB power supply because of battery issue
Since the changes I was able to get them online in OH (after restart binding while h&t where accassible) but now they are no longer reachable nor do they wake up and report states. (Shelly Cloud is disabled as I donā€™t like to use it)

Any suggestions?

Regards
Joerg

No, the official 3.1 SNAPSHOT is based on the latest merged PR, my DEV builds are always the latest ones, currently another PR is pending, but it needs to pass the review before it gets merged. Use the version linked above and follow the How to install

I donā€™t know if that fixes your issues, but I donā€™t work on old code bases. Enable DEBUG log and check device+coap initialization. You need to see > 3 Coap messages. If you see only 2 multicast ip is not working (the 1st 2 messages come in with regular udp)

Currently I stuck with de-installation :-/ as this is somehow not working through MainUI. Stating unistall and than stuck. Running OH (already restartet) on Windows.

bundle:uninstall org.openhab.binding.shelly
doesnā€™t work either

Is there another way to uninstrall through Karaf??

Hi, I recently bought an ix3 to drive a duo light.
As soon as I configured it, the binding picked it up, I included it, and everything was fine.
I added a few rules to control the light by listening to the channels associated with the ix3ā€™s buttons (the ones ending with ā€œstatusX#buttonā€) and, again, all fine.
Then I moved the ix3 from my desk to the wall box and, for some unknown reason, it stopped reporting keypresses (the log messages about SHORT_PRESSED and LONG_PRESSED, all gone).
Thatā€™s when I did something probably stupid, I removed the thing for the ix3 and the associated items, I reset it, and I tried to include it again.
The binding found it, I included it, but still no events in the channel.
So I went to the web interface of the ix3 to see if there were actions to report the keypress to the binding using oH REST APIs, which was not the case.
OK, I thought, itā€™s probably using CoIoT to receive events.
So I tried to log specifically the binding and I saw several CoIoT updates but nothing from the ix3ā€™s IP.
So this thing is not sending events via actions (REST calls to oH), is not sending events via CoIoT, how could ever the binding receive them?
Is there something Iā€™m missing here? What could I try to look for to fix this problem?

I also found something strange about status updates in general: the binding receives them via CoIoT from various Shelly devices (I have a dozen) but it also polls their REST API to gather status updates. Is this normal? Or maybe it is because when I originally included the devices CoIoT was not available and everything was based on setting actions on the Shellys to report events and now, maybe, the two ways of working are overlapping somehow?

Forgot to write: Iā€™m using oH 2.5.