# \[APP\] Shelly - Smart solutions for every home and office

**URL:** <https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765>\
**Category:** Apps\
**Tags:** app, official, homey, homey-pro, homey-cloud\
**Created:** [August 28, 2018, 8:54pm UTC](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765 "2018-08-28T20:54:43Z")\
**Posts on this page:** 20\
**Page:** 63

<div class="post-metadata">

**Author:** ![Phuturist](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/phuturist/32/49_2.png) [@Phuturist](https://community.homey.app/u/Phuturist)\
**Post date:** [December 1, 2020, 6:16pm UTC](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765/1255 "2020-12-01T18:16:28Z")

</div>

Yes, fork the Github repo for the [1.25.6 version](https://github.com/jghaanstra/cloud.shelly/tree/3f5cc268fc7038e88ed25a18be686da45e21e204), update app.json on [line 277](https://github.com/jghaanstra/cloud.shelly/blob/3f5cc268fc7038e88ed25a18be686da45e21e204/app.json#L277) and change it to ` "value": "^shelly1?l-|pm-"`. The install the app using the command line with `homey app install`.

---

<div class="post-metadata">

**Author:** ![Tom\_Starren](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tom_starren/32/3697_2.png) [@Tom\_Starren](https://community.homey.app/u/Tom_Starren)\
**Post date:** [December 1, 2020, 6:29pm UTC](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765/1256 "2020-12-01T18:29:43Z")

</div>

Would it also work to manually add actions to the buttons which homey then captures and start a flow?

---

<div class="post-metadata">

**Author:** ![Sebastian\_Lotz](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sebastian_lotz/32/16545_2.png) [@Sebastian\_Lotz](https://community.homey.app/u/Sebastian_Lotz)\
**Post date:** [December 1, 2020, 7:48pm UTC](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765/1257 "2020-12-01T19:48:12Z")

</div>

Hello @Phuturist,

trying right now…

I found two things so far:

1. If you reboot a shelly, an action flow card ist fired, because there is an new (resetted) eventCounter.  
You need to check if it is counting up - and if not - reset it to the new value (possibly 0) and don’t fire an event.

Something like this (initialise with ‘-1’, as the first eventCounter will be ‘0’):

```
        case 'inputEventCounter0':
      if value > this.getStoreValue('actionEventCounter') then
          this.setStoreValue('actionEventCounter', 'value')
          this.homey.flow.getTriggerCard('triggerCallbacks').trigger({"id": this.getData().id, "device": this.getName(), "action": this.getStoreValue('actionEvent')}, {"id": this.getData().id, "device": this.getName(), "action": this.getStoreValue('actionEvent')});
      else
           this.setStoreValue('actionEventCounter', 'value')
      break;

```

maybe there is a better alternative…

1. If you delete the action events with ‘null’ an reboot the device, the action events are still there. The shelly doesn’t seem to accept the delete. They a shown in the on the html frontend as well. If you delete it there, it does seem to work, but if you reboot, they are still there again.  
Could you check that with your shellys, maybe they react differently…

So I reseted the device that there are only coap messages (and mqtt) if I press a button.  
Result with 1.93RC3:  
After I resetted the device (and the action events are gone in the shelly) it was better.  
The mqtt-message was sent e.g. 20:33:10.78 and the coap message was sent 20:33:11.16 so 380 ms later.

Tried several times…  
2nd try: 430 ms later  
3rd try: 280 ms later  
4rd try: 290 ms later

so much better.

But it seems that we really need to get rid of the action events, as they slow down the coap…

Seb

---

<div class="post-metadata">

**Author:** ![Phuturist](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/phuturist/32/49_2.png) [@Phuturist](https://community.homey.app/u/Phuturist)\
**Post date:** [December 1, 2020, 9:07pm UTC](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765/1258 "2020-12-01T21:07:04Z")

</div>

> [@Sebastian\_Lotz](#):
>
> If you reboot a shelly, an action flow card ist fired, because there is an new (resetted) eventCounter.

It’s kind of weird it sends an CoAP message for the eventCounter after a reboot. I’ll ask the guys at Allterco Robotics why this is happens. Having to catch that in my app would be annoying.

> [@Sebastian\_Lotz](#):
>
> If you delete the action events with ‘null’ an reboot the device, the action events are still there. The shelly doesn’t seem to accept the delete.

Weird, I’m pretty sure I tested it when I implemented it like that. But perhaps I didnt check after a reboot. Watching soccer right now but will check tomorrow and see what needs to be done to permanently delete the action events. It’s good to hear this (and perhaps 1.9.3 RC2 ) helps with the performance.

---

<div class="post-metadata">

**Author:** ![Sebastian\_Lotz](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sebastian_lotz/32/16545_2.png) [@Sebastian\_Lotz](https://community.homey.app/u/Sebastian_Lotz)\
**Post date:** [December 1, 2020, 9:28pm UTC](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765/1259 "2020-12-01T21:28:46Z")

</div>

> [@Phuturist](#):
>
> t’s kind of weird it sends an CoAP message for the eventCounter after a reboot. I’ll ask the guys at Allterco Robotics why this is happens. Having to catch that in my app would be annoying.

No, it is probably not. After the reboot, a new coap message is send. In the coap message is every value in it, so even the InputEventCounter. But it is “0”, because, nothing happend so far… But it is there. The coap messages allways have the same layout, just different data. But the coap lib, that you are using, detects a change of a value an sents that new value to your routine.  
So it is not, that the eventCounter = 0 that is the problem, but the “change” that is detected.  
Right now you are acting on every change, so that you get a InputEventCounter-change delivered you fire an action flow card. But in the special event of a reboot there is a change as well (from e.g. 24 to 0), but you can check, that the new value is smaler. Normaly Shelly counts up…

> Weird, I’m pretty sure I tested it when I implemented it like that. But perhaps I didnt check after a reboot. Watching soccer right now but will check tomorrow and see what needs to be done to permanently delete the action events. It’s good to hear this (and perhaps 1.9.3 RC2 ) helps with the performance.

I think you did and it worked in the past. I think that because you added an reset of the device, because without it, it didn’t work. I can remember that. But not working anymore (at least for my Shelly’s)

Seb

---

<div class="post-metadata">

**Author:** ![Phuturist](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/phuturist/32/49_2.png) [@Phuturist](https://community.homey.app/u/Phuturist)\
**Post date:** [December 1, 2020, 9:41pm UTC](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765/1260 "2020-12-01T21:41:27Z")

</div>

> [@Sebastian\_Lotz](#):
>
> No, it is probably not. After the reboot, a new coap message is send. In the coap message is every value in it, so even the InputEventCounter. But it is “0”, because, nothing happend so far… But it is there. The coap messages allways have the same layout, just different data. But the coap lib, that you are using, detects a change of a value an sents that new value to your routine.  
> So it is not, that the eventCounter = 0 that is the problem, but the “change” that is detected.  
> Right now you are acting on every change, so that you get a InputEventCounter-change delivered you fire an action flow card. But in the special event of a reboot there is a change as well (from e.g. 24 to 0), but you can check, that the new value is smaler. Normaly Shelly counts up…

Ok, makes sense. It would be easier to drop the eventCounter message when the value of the counter is 0. That avoids having to save data under the device and is easier to implement. I’ll look into that soon.

> [@Sebastian\_Lotz](#):
>
> I think you did and it worked in the past. I think that because you added an reset of the device, because without it, it didn’t work. I can remember that. But not working anymore (at least for my Shelly’s)

I’ll check it again.

---

<div class="post-metadata">

**Author:** ![Phuturist](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/phuturist/32/49_2.png) [@Phuturist](https://community.homey.app/u/Phuturist)\
**Post date:** [December 1, 2020, 11:06pm UTC](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765/1261 "2020-12-01T23:06:50Z")

</div>

> [@Sebastian\_Lotz](#):
>
> If you reboot a shelly, an action flow card ist fired, because there is an new (resetted) eventCounter.

> [@Sebastian\_Lotz](#):
>
> If you delete the action events with ‘null’ an reboot the device, the action events are still there.

I hope to have solved both these issues in version 3.0.6 which is currently only available on Github. Feel free to try it out. I might push it to the test channel at a later time.

---

<div class="post-metadata">

**Author:** ![Tom\_Starren](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tom_starren/32/3697_2.png) [@Tom\_Starren](https://community.homey.app/u/Tom_Starren)\
**Post date:** [December 1, 2020, 11:13pm UTC](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765/1262 "2020-12-01T23:13:32Z")

</div>

I upgraded to homey 5.0 latest rc and installed the test version of the Shelly app.

As explained above I also see the delay on some of the shelly devices. Tested on one of them to upgrade to the latest rc firmware of Shelly and this is working faster. Shall test further with the other shelly devices.

One thing I noticed is that with the new Shelly 1L in button detached mode Homey doesn’t receive an action when pressed.

---

<div class="post-metadata">

**Author:** ![Phuturist](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/phuturist/32/49_2.png) [@Phuturist](https://community.homey.app/u/Phuturist)\
**Post date:** [December 1, 2020, 11:18pm UTC](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765/1263 "2020-12-01T23:18:40Z")

</div>

You could try the version currently available on Github if you know how to do a command line install with `homey app install`. That should properly remove the HTTP action event URL’s that are causing some delay according to @Sebastian_Lotz.

> [@Tom\_Starren](#):
>
> One thing I noticed is that with the new Shelly 1L in button detached mode Homey doesn’t receive an action when pressed.

Odd, sounds like a bug in the firmware for the Shelly 1L though. I dont have this device so I cant test it.

---

<div class="post-metadata">

**Author:** ![Phuturist](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/phuturist/32/49_2.png) [@Phuturist](https://community.homey.app/u/Phuturist)\
**Post date:** [December 2, 2020, 7:02am UTC](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765/1264 "2020-12-02T07:02:29Z")

</div>

> [@Phuturist](#):
>
> You could try the version currently available on Github if you know how to do a command line install with `homey app install` . That should properly remove the HTTP action event URL’s that are causing some delay according to @Sebastian_Lotz.

Yes, it’s confirmed by the Allterco Robotics that HTTP request are handled before CoAP and thus can cause a delay.

> Yes HTTP actions has highest priority ESp8266 cannot handle multiple request at time for that reason we not recommend costumer to set more than 2 actions per event. But if TCP responce is slow this will delay whole proces even they are 1 or 2. If they use Homey they don’t need local HTTP requests i think.

---

<div class="post-metadata">

**Author:** ![Tom\_Starren](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tom_starren/32/3697_2.png) [@Tom\_Starren](https://community.homey.app/u/Tom_Starren)\
**Post date:** [December 2, 2020, 7:19am UTC](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765/1265 "2020-12-02T07:19:24Z")

</div>

I have factory resetted one of the shelly devices and the speed is somewhat as before. Let me find out how to install software via SSH (or if you have the whole command by hand please share it). Will the app be still visible in Homey gui and will it auto-update to the latest version when available?

For the Shelly 1L can I debug this for you somehow? If yes, let me know what to do and I’m glad to help.

---

<div class="post-metadata">

**Author:** ![Sebastian\_Lotz](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sebastian_lotz/32/16545_2.png) [@Sebastian\_Lotz](https://community.homey.app/u/Sebastian_Lotz)\
**Post date:** [December 2, 2020, 10:46am UTC](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765/1266 "2020-12-02T10:46:29Z")

</div>

Got the same response from shelly as well:

> Hi, yes, the http actions have highest priority - to increase the coap response time please limit the number of http actions. Also, please update to the latest firmware which should be available in a couple of days, this should help especially with the Shelly 2.5.

Will try the new version…

---

<div class="post-metadata">

**Author:** ![Phuturist](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/phuturist/32/49_2.png) [@Phuturist](https://community.homey.app/u/Phuturist)\
**Post date:** [December 2, 2020, 10:52am UTC](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765/1267 "2020-12-02T10:52:45Z")

</div>

> [@Tom\_Starren](#):
>
> I have factory resetted one of the shelly devices and the speed is somewhat as before. Let me find out how to install software via SSH (or if you have the whole command by hand please share it). Will the app be still visible in Homey gui and will it auto-update to the latest version when available?

Instruction can be found here: [[HOW TO] CLI install method](https://community.homey.app/t/how-to-cli-install-method/198). It will be visible but won’t auto update. But you can just install the test version again from the app store (which won’t auto update as well as far as I know).

> [@Tom\_Starren](#):
>
> For the Shelly 1L can I debug this for you somehow? If yes, let me know what to do and I’m glad to help.

If you know how to use wireshark you could monitor the traffic and see if the device send the CoAP messages. If you learned how to run apps from the command line I can also create a debug version of the app to see if Homey receive any messages. Just let me know.

---

<div class="post-metadata">

**Author:** ![Sebastian\_Lotz](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sebastian_lotz/32/16545_2.png) [@Sebastian\_Lotz](https://community.homey.app/u/Sebastian_Lotz)\
**Post date:** [December 2, 2020, 11:29am UTC](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765/1268 "2020-12-02T11:29:53Z")

</div>

Now removing the action commands works!  
I tried it with a shelly dimmer that still had the action URLs listet in the web frontent. After pushing a button the events were gone an the action flow card was fired much faster.

Looking into other devices now.  
I found some strange behaivior with longpushes an a shelly1 that I will look into.

…and a reboot doesn’t fire an action flow card anymore! This seems to be fixed.

Sebastian

btw. I changed the homey IP-Adress some weeks ago.  
These action urls (and maybe others) are not removed - I expexted that!  
But such stuff could still make it slow.  
So, if somebody still has a problem with the performance, he needs to reset the device first and use a firmware of 1.93RC2 or newer. If that is not helping -\> wireshark.

---

<div class="post-metadata">

**Author:** ![Sebastian\_Lotz](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sebastian_lotz/32/16545_2.png) [@Sebastian\_Lotz](https://community.homey.app/u/Sebastian_Lotz)\
**Post date:** [December 2, 2020, 11:32am UTC](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765/1269 "2020-12-02T11:32:27Z")

</div>

> [@Tom\_Starren](#):
>
> Let me find out how to install software via SSH (or if you have the whole command by hand please share it).

You need to update the shelly, too.  
The new RC firmware can be downloaded here:

[http://repo.shelly.cloud/firmware/rc/](http://repo.shelly.cloud/firmware/rc/)

and pushed to the device via:  
http:///ota?url=[http://repo.shelly.cloud/firmware/rc/SHSW-1.zip](http://repo.shelly.cloud/firmware/rc/SHSW-1.zip)  
(Be aware: you have to use the right filenames for you devices! SWSH is e.g. for a Shelly1)

Please do only use it to test the CoAP bug.

---

<div class="post-metadata">

**Author:** ![Sebastian\_Lotz](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sebastian_lotz/32/16545_2.png) [@Sebastian\_Lotz](https://community.homey.app/u/Sebastian_Lotz)\
**Post date:** [December 2, 2020, 12:00pm UTC](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765/1270 "2020-12-02T12:00:44Z")

</div>

@Phuturist  
There is still a bug, that if you remove the URLs and reboot the shelly, the URLs are back again…  
It seem not to be stored persistantly.

Cheers.

---

<div class="post-metadata">

**Author:** ![Phuturist](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/phuturist/32/49_2.png) [@Phuturist](https://community.homey.app/u/Phuturist)\
**Post date:** [December 2, 2020, 12:33pm UTC](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765/1271 "2020-12-02T12:33:47Z")

</div>

Sounds more like a Shelly firmware bug. I’m using the method as described in the REST API documentation. I’ll do some testing myself but will pass it on to Allterco Robotics if I can reproduce.

---

<div class="post-metadata">

**Author:** ![Sebastian\_Lotz](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sebastian_lotz/32/16545_2.png) [@Sebastian\_Lotz](https://community.homey.app/u/Sebastian_Lotz)\
**Post date:** [December 2, 2020, 12:45pm UTC](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765/1272 "2020-12-02T12:45:13Z")

</div>

opened a ticket at shelly

---

<div class="post-metadata">

**Author:** ![Tom\_Starren](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tom_starren/32/3697_2.png) [@Tom\_Starren](https://community.homey.app/u/Tom_Starren)\
**Post date:** [December 2, 2020, 12:48pm UTC](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765/1273 "2020-12-02T12:48:37Z")

</div>

> [@Phuturist](#):
>
> If you know how to use wireshark you could monitor the traffic and see if the device send the CoAP messages. If you learned how to run apps from the command line I can also create a debug version of the app to see if Homey receive any messages. Just let me know.

I know wireshark but how can I capture these packets?

@Sebastian_Lotz  
So I need to update the Shelly application, upgrade the firmware and then remove the action links from homey? When I reset the Shelly device the http actions are empty and disabled, but is it still using them somewhere?

---

<div class="post-metadata">

**Author:** ![Phuturist](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/phuturist/32/49_2.png) [@Phuturist](https://community.homey.app/u/Phuturist)\
**Post date:** [December 2, 2020, 12:52pm UTC](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765/1274 "2020-12-02T12:52:31Z")

</div>

> [@Phuturist](#):
>
> Sounds more like a Shelly firmware bug. I’m using the method as described in the REST API documentation. I’ll do some testing myself but will pass it on to Allterco Robotics if I can reproduce.

> [@Sebastian\_Lotz](#):
>
> opened a ticket at shelly

I can not reproduce this on a Shelly 1. I still had the HTTP report URL’s and triggered an action event resulting in the removal of the HTTP report URL’s. I then rebooted the device directly after that through the device settings and the URL’s did not return.

Are your Shelly devices connected to the cloud? Perhaps it’s syncing setting with the cloud and restoring them after a reboot. And did you also reboot directly after the removal of the HTTP URL’s.

[Previous page](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765.md?page=62)

[Next page](https://community.homey.app/t/app-shelly-smart-solutions-for-every-home-and-office/765.md?page=64)
