Thanks for sharing this! I made a simplified version for myself based on your variables and it works great to set the correct mode when arriving home.
Setting modes based on time of day and presence
So I have been using this Piston for a few months that you helped me streamline. So far it has been working fairly well but there are a couple of issues that I would like assistance with addressing.
- When night time mode triggers (11:00PM) it doesnât turn off the lights in the light variable. I thing this might be a simple change but Iâm not sure.
- Sometimes when leaving certain lights will not go off, Iâm not 100% how to troubleshoot this issue as it is random when it happens.
- How hard would it be to set Arlo mode based on presence in this same Piston?
Hi All,
Im new here. Please go soft!
I have tried to install this app. I get this error when I run the testâŚ
Error setting location mode. Mode âHome - Dayâ does not exist.
Where do you need to create the Home - Day location? Within the IDE im guessing? Do you need one for each mode?
Modes have to be created and named in the IDE.
You need a mode matching each one on listed in post 1, or rename them in the piston as desired.
This works great Robin! Thanks for putting togetherâŚ
If I wanted to add a few new modes in would it just be a case of adding the new âtimeâ then defining in the âtime of homeâ and âtime of nightââŚ
I wanted to add a new day mode from 10am to 2pm then a evening mode (between 6pm and 6:30pm) and then one between 6:30pm and 20:00
Itâs a bit more in depth than that⌠ternary operators need updating.
If I get time later Iâll see if I can update it for you.
This should do the trick:
Rather than trying to guess your mode names, Iâve just called them:
- Sleep
- Home - 1
- Home - 2
- Home - 3
- Home - 4
- Home - 5
- Home - 6
- Away - 1
- Away - 2
- Away - 3
- Away - 4
- Away - 5
- Away - 6
You just need to change these mode names to your desired names in both of the ternary operators (âtimeOfDayHomeâ & âtimeOfDayAwayâ)
If you donât need all the steps, just have 2 of 3 times in the middle apply the same mode name.
Quick Facts
Piston state: Home - Bathtime was initiated on Tue, Apr 3 2018 @ 2:55:11 PM BST
Last executed: 03/04/2018, 14:55:11
Next scheduled: 03/04/2018, 18:00:20
Subscriptions: 3 events, 23 controls
Devices used: 26
Memory used: 31% (31498 bytes)
External URL: (click to open/execute)
That is working correctly⌠your example:
Triggered at 14:55 so time was less than â<â time4 (18:00), so Home-Bathtime was set.
You need to move everything along by one mode, Iâm guessing less than 18:30 is the intended bath time?
p.s. I wish I could get my little one to stop and come upstairs for a bath on such a tight schedule lol
Its a challenge I can tell you, but a 4 months we are still managing it!
So needs to be this?
($time24 < time0 ? âSleepâ : ($time24 < time1 ? âHome - Morningâ : ($time24 < time2 ? âHome - Afternoonâ : ($time24 < time3 ? âHome - Bathtimeâ : ($time24 < time4 ? âHome - Eveningâ : ($time24 < time5 ? âHome - Nightâ : ($time24 < time6 ? âHome - Dawnâ : âSleepâ)))))))
Thanks again.
Unless youâre planning bathtime for 10am no⌠You need to move it all right, not left.
$time24 < time3 ? âHome - Bathtimeâ :
in words:
If Time now is less than time3 then set mode {bathtime] elseâŚ
So you want:
$time24 < time5 ? âHome - Bathtimeâ :
Thanks a bunch for the piston! I made a small change to the if statement for my needs⌠I am basically telling webcore to check either if the presence is home / away or changes to home / away⌠I made this change since it wasnât properly changing the modes based on when we left the house⌠at least for me it wasnât⌠It would only change when it ran again based on the time slots⌠I also have the mode change section changing the profile on my BlueIris installâŚ
Hi,
How would one go about making the string used for dawnTime in the example to be say 20 minutes before sunrise? I have seen other examples using different methods, just curious as to how it would be done in this specific example.
Thanks in advance!
How would I go about if I wanted to create an offset to âsunriseâ and âsunsetâ. Say âsunrise + 30 minâ.