-
Notifications
You must be signed in to change notification settings - Fork 0
Motors
This motor controls LCD Display 2 lines, 20 characters each: LCD-AC-2002A-BIW negative blue. It collects information from various sensors, but all of them are optional. Used sensors are:
-
now- first line is current date and time. -
termination- if application is about to terminate, display presents reason, why it application has terminated: either "Closed by user." if termination is due to user interruption, or key of plugin that requested shut down procedure. - [optional]
alarm- if alarm is armed, then display's backlight is turned off. Once alarm is disarmed it goes on. - [optional]
thermometer- if this sensor is present then second line contains current temperature - [optional]
hygrometer- if this sensor is present then second line contains current humidity - [optional]
barometer- if this sensor is present then second line contains current atmospheric pressure
Code used to communicate with display, and helpful hints on how to wire it up might be found here
To run this motor you need to have Python3 RPi.GPIO package installed.
All you need to do is to properly set Raspberry Pi GPIO pins, starting from PIN_RS to PIN_BACKLIGHT.
This motor sends e-mails to all configured recipients every time any of these situations occurs:
- [optional]
alarmsensor is in alert state, or it quits this state - [optional]
alarmsensor is disarmed while system is in holiday mode or gets back armed - Application is in
terminationstate
Furthermore, if system is in holiday mode then additional recipients will be notified as well.
Plugin will attempt to launch /usr/bin/fswebcam to capture still image from attached webcam. Any errors will be ignored, so it not necessary to plug webcam nor to have this application installed. Presence of any of mentioned prerequisites is optional.
You should copy file from ./config/email.ini to /etc/command_center/email.ini and edit it according to following hints:
-
smtp- address of SMTP server to use -
username- user name used to log in SMTP server -
password- password used to log in SMTP server -
sender_email- e-mail address that will be used as sender address -
display_name- display name that will be used as sender name -
port- SMTP server listen port -
recipients- semicolon (;) separated list of e-mail addresses that will always be notified -
holiday_recipients- semicolon (;) separated list of e-mail addresses that will be additionally notified once system is in holiday mode
If you decide to keep configuration not in /etc/command_center please update path in EmailSender class __init__ method.
This is simple plugin that dumps entire system state to logging.debug every 20 loops.
Following motors contain logic that control different LEDs indicating important system states.
- OFF: System is running, and there is no alarm alert
- ON: System is not running (terminated either by some plugin or Ctrl+C)
- BLINK: Alarm is on alert
- OFF: There are no warnings, and system does not require manual intervention
- ON: Some plugins were disabled due to exceeded number of unhandled exceptions. One should manually verify what might have cause it (for example Forecast plugin might get disabled due to lack of internet connectivity), fix stuff and restart application.
- BLINK: there are two ways yellow LED blinks:
- Three rapid blinks, then longer pause - that indicates that temperature inside box (in which all components are stored) is too high and impose risk of corrupting device
- One blink one pause - indicates that temperature in room exceeds defined limits (i.e. less than 16 or more than 28 Celsius degrees).
- OFF: System is not running
- ON: System is running
- BLINK: In next 9 hours risk of rain is higher than defined threshold (i.e. 10%)
This motor sends SMS messages to all configured recipients every time any of these situations occurs:
-
alarmsensor is in alert state, or it quits this state -
alarmsensor is disarmed while system is in holiday mode or gets back armed
Furthermore, if system is in holiday mode then additional recipients will be notified as well.
Motor uses GMSService API to send messages so internet connection is required. If there is no alarm sensor, than no exception will be thrown, but no action will be taken ever.
You should copy file from ./config/sms.ini to /etc/command_center/sms.ini and edit it according to following hints:
-
api_urls- address of REST API service exposed by GSMService -
username- username configured to consume API -
password- password configured to consume API -
recipients- semicolon (;) separated list of phone numbers that will always be notified -
holiday_recipients- semicolon (;) separated list of phone numbers, that will be additionally notified once system is in holiday mode
- Home
- [Writing own plugins](Developing custom plugins)
- Built-in sensors
- Built-in motors