matthewh
Posts: 15
Joined: Tue Dec 30, 2014 5:04 pm

Alarm Panel

Wed Dec 31, 2014 7:36 pm

I am looking for a simple example of sending an email based on a contact closure. Basically when a door opens I want to be sent an email that the door opened. When it closes I want an email that it closed. Is there a simple example of this somewhere?

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Alarm Panel

Wed Dec 31, 2014 10:03 pm

Take a look at http://www.themagpi.com/issue/issue-27/ the Mattboard project (page 16) includes some code to send email based on external events.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
iinnovations
Posts: 621
Joined: Thu Jun 06, 2013 5:17 pm

Re: Alarm Panel

Wed Dec 31, 2014 10:36 pm

This may be more than you are looking for, but here is a class-based actions handler that includes class-based gmail email sending:

https://github.com/iinnovations/iicontr ... actions.py

The send on reset is called 'activereset' in this code.

C
CuPID Controls :: Open Source browser-based sensor and device control
interfaceinnovations.org/cupidcontrols.html
cupidcontrols.com

User avatar
iinnovations
Posts: 621
Joined: Thu Jun 06, 2013 5:17 pm

Re: Alarm Panel

Wed Dec 31, 2014 10:39 pm

Sorry the action and gmail classes are defined here at lines 220 and 270, respectively:

https://github.com/iinnovations/iicontr ... d/pilib.py

C
CuPID Controls :: Open Source browser-based sensor and device control
interfaceinnovations.org/cupidcontrols.html
cupidcontrols.com

Return to “Automation, sensing and robotics”