Jump to content
Visit us at IFA2024 / Besuche uns auf der IFA2024 06.-10.09.2024 Stand H1.2-420 ×
Shelly wiring diagram Now LIVE ×

Script running conditionally


Recommended Posts

Hello!
I'm also trying here. I'm looking for someone who can help me with a script.
I copied a script from Smarthome-Europe.eu (https://smarthome-forum.eu/.../22404.../...) that can be used to manage absences by querying logged-in mobiles. I also used it to switch lamps on and off. So far, it works.
Unfortunately, I am stuck with the following:
I would like to switch on a lamp in a courtyard 15 minutes after sunset and switch it off at midnight (I have set this up on another Shelly using a schedule) on the condition that one of the two mobiles has been logged in once during the day.

Link to comment
Share on other sites

Hi Brendianer,

If I'm understanding you right:

 - the script could be scheduled to run at the times you give
 - when the script runs, it could check whether the mobiles have been logged in, and proceed accordingly
 - information about the login of the mobiles could be stored in a "virtual component" on the switch. Updating the value of the virtual component could, perhaps, be done with a more frequent scheduled script which runs every x minutes and checks whether the mobiles are logged in.

Or have I misunderstood your question?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Erstelle neue...