-
Notifications
You must be signed in to change notification settings - Fork 131
Example Door monitor
ggodart edited this page Jan 11, 2021
·
1 revision
WARNING: This example has not been verified
$timer_garage_door = new Timer();
$garage_door = new Serial_Item('DCCH', 'opened');
$garage_door -> add ('DCCL', 'closed');
if($state = state_now $garage_door) {
set $timer_garage_door 120;
play('rooms' => 'all', 'file' => "garage_door_" . $state . "*.wav");
}
if ((time_cron('0,5,10,15,30,45 22,23 * * *') and
('opened' eq ($garage_door->{state})) and
inactive $timer_garage_door)) {
speak("The garage door has been left opened. I am now closing it.");
set $garage_door_button ON;
set $garage_door_button OFF;
}