[APP][Pro&Cloud] Shelly

@Phuturist

I got the Shelly Door/Window sensor today. However, not all open/close signals are received by Homey. I checked in the Shelly app log, and there I see everything logged fine. It looks like some signals are missed completely, but it seems rather random. I don’t see any settings I could make. Any idea?

Yes, the driver currently using polling which is unreliable for these battery operated devices since the device is asleep most of the time. I implemented it this way because the Shelly API documentation is missing info about the event callbacks and my own Shelly DW which I use for testing broke down.

But I have more info now about the end points and will switch to using callback methods in the next release. This should make it more reliable.

Thanks, looking forward to it. When do you expect to release the next release?
In the advanced settings there is a possibility to enter an IP address with username and password. I am not using that, not sure if I need to (and not sure what it is for)? Thanks!

Somewhere in the future.

You can use it to update the IP address if it has changed and set or remove authentication if you have updated it in the official Shelly app.

v1.19.1 - 2020-05-03

Added the callback trigger card functionality to the Shelly Door/Window sensor. This is more reliable then the current polling implementation. See the documentation on how to use this.

2 Likes

@Phuturist Thanks for adding this! It seems to be more reliable. The only thing is that it misses a lot of triggers. There needs to be at least 5-6 seconds between 2 triggers for the app to register it. The Shelly App logs all events, even if there is half a second in-between. Any idea?

My app just parses the incoming requests from Shelly. If it “misses” events than the Shelly probably didn’t send the callback. Do you know how to run the app from the command line? I could create a debug version that would tell more.

@Phuturist I have installed apps from the command line before if that is what you mean, so I could try.

Use this GitHub branch : https://github.com/jghaanstra/cloud.shelly/tree/debug

And from command line use the command homey app run to run the app from the command line allowing it to spit out debug logging. Now trigger the sensor a couple of times and see what the command line spits out and compare it with the data from the Shelly app.

@Phuturist

I ran the app from the command line.

The only thing it says is [shellydw] [0] Device asleep or disconnected.

When I open the door and wait 5-10 seconds, Homey receives the trigger (via the normal Shelly app) and activates a flow. But nothing changes in the Debug app (still asleep or disconnected despite the published app receiving a trigger).

I tested it with the floodsensor I have, and when it alarms, it shows an array of metrics in the debug app as soon as I dry the connectors and the alarm stops.

Did you actually set the callback URL’s using the maintenance actions under the device settings? And if so, could you post them here by copy pasting them from the Shelly smartphone app.

@Phuturist No I haven’t. The only thing I have (and want) is a flow that is triggered when a door is opened (and/or closed). Do I need the URL fields? I read the app description, but not sure what I need to do with it and/or if I need it.

If you want more reliable event reports you will have to use the callback urls. Long press on the device in Homey. Select the cogwheel. Go into maintenance actions. Choose the option to set the callback urls.

@Phuturist

ok, thanks. I have done that. When I now debug and open/close the door in 1-2 seconds, I get two triggers in the debug screen (open_dark and close). So all good so far.

However, I have two flows that change a Y/N variable and also push me a notification on my mobile. One flow uses ‘Het contactalarm gaat aan’ and the other flow uses ‘Het contactalarm gaat uit’.

These flows are not activated.

Also when I go to the Shelly App (v1.19.1) and look in the history of events (…), the triggers are not registered.

So at the debug level it seems to receive the events, but they don’t seem to be processed in the app (which probably results in the flows not being triggered)?

Hmmm, I need to look into that. I have updated the debug version on Github. Can you re-download and test again.

For now you can use a different trigger card called “Knop actie” for triggering flows for you open and close events (I also realize this is a strange description, it was previously only used for button events and I need to update it).

@Phuturist

No change. The batch jobs logs the events fine.

My old flows do the same (flow triggered if there is 5-10 seconds inbetween 2 triggers).

The new flow, using ‘knop actie’ as the trigger and sending me the value of the ‘actie’ tag is doing nothing at all (flow not triggered).

Can you post the output of the debug logging here. I did not actually change anything other than adding debug logging. I first need to know what is wrong.

@Phuturist Do you mean the onscreen output from the batch job? Or is there a file or something that I can find somewhere? Not sure where to find the debug log. Thanks for your help!

Just copy and paste the output from the console (onscreen).

@phuturist