alarm_system.script
# INSTEON modem
run_script("Scripts/Device/INSTEON/Modem2413", id:"modem", port_location:"/dev/ttyUSB0")
# INSTEON devices
# motion sensor
run_script("Scripts/Device/INSTEON/MotionSensor", address:"2D.41.55", id:"motion", port_location:nil)
# buttons
run_script("Scripts/Device/INSTEON/OpenCloseSensor", address:"27.AF.A6", id:"on_button", port_location:nil)
run_script("Scripts/Device/INSTEON/OpenCloseSensor", address:"2D.E4.45", id:"off_button", port_location:nil)
# email device
run_script("Scripts/Device/EMail/TextMessagingPOP", email_address:"9995551212@vzwpix.com", gmail_polling:true, host:"pop.gmail.com", id:"alarm_mailer", mail_subject:"Alarm Message", password:"alarm", poll_interval:300, smtp_host:"smtp.gmail.com", smtp_port:587, ssl_enable:true, user_name:"alarm_system@gmail.com")
# Alarm Device
run_script("Scripts/Device/Virtual/Alarm/Alarm", id:"alarm")
run_script("", text:"disable_alarm_messages()", on_device:"alarm")
# define inputs
run_script("Scripts/Device/Virtual/Alarm/InputTypes/Equal", alarm_id:"alarm", input_name:"motion", value:"on")
# Alarm interface state machine. Handles messages from alarm and on/off commands to the alarm
run_script("Scripts/Device/Virtual/StateMachine", file_name:"Scripts/user/alarm_interface.yaml", id:"alarm_sm", table_name:"")
# wires
# text messaging wires
wire("alarm_mailer:out", "alarm:command")
wire("alarm:messages", "alarm_mailer:in")
wire("alarm_sm:message", "alarm_mailer:in")
# alarm interface State Machine
# buttons
wire("on_button:1S", "alarm_sm:on_button")
wire("off_button:1S", "alarm_sm:off_button")
# commands to alarm Device
wire("alarm_sm:command", "alarm:command")
# status from alarm Device
wire("alarm:input_status", "alarm_sm:status")
# enabled
wire("alarm:enabled", "alarm_sm:enabled")
# motion sensor wire
wire("motion:1S", "alarm:motion")
|
|