2015-07-19 22:30:46 +02:00
|
|
|
#!/bin/bash
|
|
|
|
if [ "$1" = "" ]
|
|
|
|
then
|
2016-02-20 21:57:07 +01:00
|
|
|
echo "usage: $0 {main|chill|status|labsocket|alarm|screen} {on|off}"
|
|
|
|
echo "usage: $0 {projector} {on|hdmi1|hdmi2|dvi|vga1|off}"
|
2016-04-18 22:06:28 +02:00
|
|
|
echo "usage; $0 {receiver} {on|off|hdmi|jack1|jack2|optical}"
|
2016-05-07 09:05:12 +02:00
|
|
|
echo "usage: $0 {maindoor} {open}"
|
2015-07-19 22:30:46 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
function dolight() {
|
|
|
|
if [ "$2" = "on" ]
|
|
|
|
then
|
|
|
|
setvalue=1
|
|
|
|
else
|
|
|
|
setvalue=0
|
|
|
|
fi
|
|
|
|
case "$1" in
|
|
|
|
all) dolight "main" $2
|
|
|
|
dolight "status" $2
|
|
|
|
dolight "labsocket" $2
|
|
|
|
dolight "alarm" $2
|
|
|
|
;;
|
2015-07-27 22:02:17 +02:00
|
|
|
main) sudo /root/pidor/rcswitch-pi/send 2 1A 1 "$setvalue"
|
2015-07-19 22:30:46 +02:00
|
|
|
;;
|
2015-07-27 22:02:17 +02:00
|
|
|
chill) sudo /root/pidor/rcswitch-pi/send 2 1A 2 "$setvalue"
|
2015-07-19 22:30:46 +02:00
|
|
|
;;
|
2015-07-27 22:02:17 +02:00
|
|
|
status) sudo /root/pidor/rcswitch-pi/send 2 2A 1 "$setvalue"
|
2015-07-19 22:30:46 +02:00
|
|
|
;;
|
2015-07-27 22:02:17 +02:00
|
|
|
labsocket) sudo /root/pidor/rcswitch-pi/send 2 15A 6 "$setvalue"
|
2015-07-19 22:30:46 +02:00
|
|
|
;;
|
2015-07-27 22:02:17 +02:00
|
|
|
alarm) sudo /root/pidor/rcswitch-pi/send 2 15A 1 "$setvalue"
|
2015-07-19 22:30:46 +02:00
|
|
|
;;
|
2016-02-04 23:50:29 +01:00
|
|
|
screen) sudo /root/pidor/scripts/beamercontrol.sh screen "$2"
|
|
|
|
;;
|
|
|
|
projector) sudo /root/pidor/scripts/beamercontrol.sh beamer "$2"
|
|
|
|
;;
|
2016-04-18 22:06:28 +02:00
|
|
|
receiver) sudo /root/pidor/scripts/beamercontrol.sh receiver "$2"
|
|
|
|
;;
|
2016-05-07 09:05:12 +02:00
|
|
|
maindoor) sudo /root/pidor/scripts/opendoor.sh
|
|
|
|
;;
|
2015-07-19 22:30:46 +02:00
|
|
|
esac
|
|
|
|
# type (2=10bit)
|
|
|
|
# | house 1-16 (the dial thingie)
|
|
|
|
# | |group A-P (the dial thingie)
|
|
|
|
# | || unit (1-16) (the button, usually 1-4)
|
|
|
|
# | || | on/off
|
|
|
|
# | || | |
|
|
|
|
#/usr/local/bin/433send 2 1A 1 1 #on
|
|
|
|
#/usr/local/bin/433send 2 1A 1 0 #off
|
|
|
|
}
|
|
|
|
|
|
|
|
logger -t $(basename $0) "$$ $1 $2"
|
|
|
|
dolight "$1" "$2"
|