gpio doorbel mute at night time
Posted: Thursday 30 May 2019 11:50
Hello everyone,
I have make my phisical doorbel connected to the gpio of my raspberry pi. This works very well, when you push the doorbel button outsite, domoticz send a message to my phone and run directly a phython script that makes my doorbel ring for a half second.
Now is my question how can I make in a script the physical doorbel mute at night time?
I have make a try, but it was unfortunately not a lucy try.
Is there someone thats can help me further to fix this, please?
Thank you in advance!
Kind regards.
I have make my phisical doorbel connected to the gpio of my raspberry pi. This works very well, when you push the doorbel button outsite, domoticz send a message to my phone and run directly a phython script that makes my doorbel ring for a half second.
Now is my question how can I make in a script the physical doorbel mute at night time?
I have make a try, but it was unfortunately not a lucy try.
Is there someone thats can help me further to fix this, please?
Code: Select all
#!/bin/sh
fireup()
{
while :; do
currenttime=$(date +%H:%M)
if [[ "$currenttime" > "07:00" ]] || [[ "$currenttime" < "22:00" ]]; then
python /home/pi/domoticz/scripts/python/gpio_deurbel.py
else
do_something_else_or_nothing
fi
test "$?" -gt 128 && break
done &
}
Kind regards.