; home_automation.conf:
; Interface asterisk with home automation system (currently heyu)

;[globals]  Change in extensions.conf
;HEYU_USER
;HEYU_SERVER 

[macro-light-on]
exten = s,1,System(/usr/bin/ssh -xn ${HEYU_USER}@${HEYU_SERVER} heyu-on_off on ${ARG1} ${ARG2}&)

[macro-light-off]
exten = s,1,System(/usr/bin/ssh -xn ${HEYU_USER}@${HEYU_SERVER} heyu-on_off off ${ARG1} ${ARG2}&)

[macro-light-dim]
exten = s,1,System(/usr/bin/ssh -xn ${HEYU_USER}@${HEYU_SERVER} heyu-dim_to ${ARG1} ${ARG2} ${ARG3}&)

[home_automation]
exten = _2XX,1,Macro(light-on,${EXTEN:1:1},${EXTEN:2:1})
exten = _2XX,2,Playback(beep)
exten = _2XX,3,Macro(return_to_top)

exten = _3XX,1,Macro(light-off,${EXTEN:1:1},${EXTEN:2:1})
exten = _3XX,2,Playback(beep)
exten = _3XX,3,Macro(return_to_top)

exten = _4XXX,1,Macro(light-dim,${EXTEN:1:1},${EXTEN:2:1},${EXTEN:3:1})
exten = _4XXX,2,Playback(beep)
exten = _4XXX,3,Macro(return_to_top)

; _5SA (S=stereo system number, A=album number)
;exten = _5XX,1,System(/usr/bin/ssh -xn webb@chard play-album ${EXTEN:1:1} ${EXTEN:2:1} &)
;exten = _5XX,1,System(/usr/bin/ssh -xn webb@igor play-album ${EXTEN:1:1} ${EXTEN:2:1} &)
;exten = _5XX,2,Playback(beep)
;exten = _5XX,3,Macro(return_to_top)

