Couldn’t it be possible to use the same device to check its state and if is on for example, turn the same device off?
I have an outdoor lamp that often stays on controlled by a zbmini and would like to create a scene that would look periodically check its state after turning it on, something like this:
IF lamp is on
WAIT 10 minutes
IF lamp is still on
send notification
AND return to WAIT
What I would truly like is a cycle like foreach or while, but am open to any ideas:
WHILE lamp is on
WAIT 10 minutes
SEND notification
What is the end goal of such checking? Do you just want to receive a notification every 10 minutes that the lamp is ON when it is ON and nothing else?
And how do you want to receive these notifications, email, webhook, push notifications?
The first option is to use a 24/7 computer that can run Firefox. Then we install an add-on called PageProbe and set it to monitor the web/cast ewelink. (Been here and done that)
Specifically, this specific device and its condition. This can be done live or every X minutes, it can perform actions, for example a webhook call, which will then take care of executing the notification.
A similar solution can be created for Android with Macrodroid, but it must be a dedicated device that will have to have the ewelink app active all the time.
Unfortunately, eWeLink scenes are very poor in terms of functionality. Here you would need to implement the state of the device it is in.
Or use external services that are compatible with ewelink and can read the device status via API.
If ewelink app / cast app supported Intent, it could be even easier to do it based on Macrodroid.
That’s what I was thinking too, but if I have to use 3 devices, it would be easier to go with another brand which could probably do these bit more complex tasks with a single device - price could be similar but third the space and less space for errors.
I see, so there is absolutely no way to do this the easy way What would you recommend if I’d like to receive push notifications in given circumstances? If I got a raspberry PI for example, could it handle these and hopefully more tasks what I could not accomplish without external devices? What would such a solution require - I mean other than the sonoff USB stick, which I guess is a necessity in such cases. Could a raspberry send push notifications somehow?
I’m having problems with push notifications anyway: I use the system with my wife and no matter what I do, if I make a scene in the eweling app, only I get notified, her phone stays silent.
Sorry for the many questions, I’m quite new to this topic but curious about what I can accomplish with the already purchased devices and what would be needed to extend the possible use cases.
Thank you very much for your help!
The simple one is a matter of defining the scale per person.
But if it’s something like two mouse clicks, then probably not.
You can actually do it without additional devices if you have a paid plan and a bit of determination.
If I remember correctly, they probably go only to the main account, although I may be wrong.
I would give up push notifications and do it based on MacroDroid + WebHooks + Sequematic.
In the previous post, I wrote how to get the live status of the device.
However, if you don’t like those methods, you can do it a little differently.
We will need:
eWeLink Advanced Plan / You must have ewelink WEB because we will need a webhook!
Account at https://sequematic.com
Macrodroid installed on Android, or other software capable of performing actions according to webhook.
You go to ewelink web and create two scenes.
The first scene will activate the notification and the second will terminate the notification.
We create the automation logic entirely on https://sequematic.com, where we will execute the sequence every 10 minutes and react to the Variables that ewelink will send us via webhook.
To receive notifications we will use MacroDroid and its webhook-based trigger.
MacroDroid has the ability to create a macro that will allow you to fully adjust the notification style, any message, notification, time schedules, whatever you want, to your needs. The wife can also have her own individual notifications.
Step by step…
Step one, install macrodroid, create a macro, select the trigger, find the webhook, set it and write down the url. Add actions as you like.
Step two, go to “sequematic.com” Create an account (free), Go to dashboard, go to Variables, create “light”.
Go to New sequence, name it “Triggered by a eWeLink”, start editing, set the trigger, select the clock icon, select “Periodically”, set 10 minutes and save.
Add actions, select the {} icon and select “Check variable value”, provide the name “light” and select “equals” and the number 12 and save.
In "If light is equal to 12, then..." add a webhook, an electrical plug icon and select “Call a custom webhook”, change “Method” to POST and enter the webhook address from MacroDroid as the URL and save.
Now go to eWeLink WEB, Scenes and create an “In ON” scene. Select your device as “If” and its status as ON.
In “Then” select webhook and enter your unique url from “sequematic.com”
Make sure the value is 12 at the end and save. https://sequematic.com/variable-change/XXXXXXXXXXXXXXX/light/=12
Create a second scene in a similar way and name it “In OFF”, change the device status to OFF and provide the same address as the URL, but change the value to 55. https://sequematic.com/variable-change/XXXXXXXXXXXXXXX/light/=55
Now when you turn on the device, a sequence will be initiated that will run every 10 minutes and generate a reaction on the macrodroid side, thus you receive a notification that something is ON. When you turn off the device, on the ewelink side will send a different value and as a result you will stop receiving notifications every 10 minutes.
Please note, this is not live status monitoring, it is based on the values sent from ewelink according to the response to the device status.
It works ok and relatively fast and will do exactly what you want!
The only paid element is ewelink, the rest is free.
It may seem complicated, but it’s not, you can do it!
This is not a solution for automatically turning off the device, but for the issue where you mention the notification every 10 minutes.
The above solution that I presented mainly concerns the issue of checking whether the light is on, and repeating it every 10 minutes, and when the change says that it is off, stop sending the notification, but the sequence process itself is still running on the server and it does not interfere with anything, it is waiting for the value to change status and start sending notifications.
Of course, when zbmini is OFF you will not receive notifications, because it would be pointless.
Separately, you can add, for example, a one-time notification that zbmini has switched to OFF, but for now maybe focus on the notification when it is ON.