Weather

From ago control wiki
(Difference between revisions)
Jump to: navigation, search
Line 15: Line 15:
 
* tempunits - show values in Fahrenheit (f) or Centigrade (c)
 
* tempunits - show values in Fahrenheit (f) or Centigrade (c)
 
* waititime - amount of time in seconds to wait between updates
 
* waititime - amount of time in seconds to wait between updates
 +
 +
 +
== Getting started ==
 +
Temporary instructions until I learn how to create a package so this is automated...
 +
 +
sudo wget http://git.agocontrol.com/agocontrol/agocontrol/raw/master/devices/weather/agoweather.py
 +
mv agoweather.py /opt/agocontrol/bin
 +
sudo apt-get install python-pywapi
 +
sudo nano /etc/opt/agocontrol/conf.d/weather.conf
 +
 +
Then edit the lines to match your location- e.g.:
 +
[weather]
 +
locations_ID=63005
 +
tempunits = f
 +
waittime = 300
 +
 +
Save and exit the file, then run
 +
sudo chmod a+rx /etc/opt/agocontrol/conf.d/weather.conf
 +
sudo chmod a+rx /opt/agocontrol/bin/agoweather.py
 +
 +
Then create and edit the service file:
 +
sudo nano /lib/systemd/system/agoweather.service
 +
 +
Putting the following in that service file:
 +
[Unit]
 +
Description=ago control Weather Device
 +
[Service]
 +
ExecStart=/opt/agocontrol/bin/agoweather.py
 +
WorkingDirectory=/opt/agocontrol/bin
 +
StandardOutput=syslog
 +
StandardError=syslog
 +
Restart=always
 +
RestartSec=2
 +
User=agocontrol
 +
[Install]
 +
WantedBy=multi-user.target
 +
 +
You should then just have to enable and start the service:
 +
systemctl enable agoweather.service
 +
systemctl start agoweather.service
 +
 +
And check it is running with:
 +
systemctl status agoweather.service
 +
 +
It maybe required to reload the system daemon:
 +
sudo systemctl --system daemon-reload

Revision as of 01:43, 6 March 2015

Weather

The weather devices gives the condition of rain, outdoor temperature and humidity. Rain is set as a binary sensor and will be marked true if any variety of rain is detected including drizzle. Temperature and humidity are shown as multi-level sensor. This allows for graphing the data over time to view trends.

This device requires the install of the Python Weather API.

Configuration options are set in /etc/opt/agocontrol/conf.d/weather.conf:

[weather]
locations_ID=ITLM2916
tempunits = f
waittime = 300
  • locations_ID - the city/location to be monitored. This value is either a five digit US zip code or an international location id. This value can be determined by reading the information at this link
  • tempunits - show values in Fahrenheit (f) or Centigrade (c)
  • waititime - amount of time in seconds to wait between updates


Getting started

Temporary instructions until I learn how to create a package so this is automated...

sudo wget http://git.agocontrol.com/agocontrol/agocontrol/raw/master/devices/weather/agoweather.py
mv agoweather.py /opt/agocontrol/bin
sudo apt-get install python-pywapi
sudo nano /etc/opt/agocontrol/conf.d/weather.conf

Then edit the lines to match your location- e.g.:

[weather]
locations_ID=63005
tempunits = f
waittime = 300

Save and exit the file, then run

sudo chmod a+rx /etc/opt/agocontrol/conf.d/weather.conf
sudo chmod a+rx /opt/agocontrol/bin/agoweather.py

Then create and edit the service file:

sudo nano /lib/systemd/system/agoweather.service

Putting the following in that service file:

[Unit]
Description=ago control Weather Device
[Service]
ExecStart=/opt/agocontrol/bin/agoweather.py
WorkingDirectory=/opt/agocontrol/bin
StandardOutput=syslog
StandardError=syslog
Restart=always
RestartSec=2
User=agocontrol
[Install]
WantedBy=multi-user.target

You should then just have to enable and start the service:

systemctl enable agoweather.service
systemctl start agoweather.service

And check it is running with:

systemctl status agoweather.service

It maybe required to reload the system daemon:

sudo systemctl --system daemon-reload
Personal tools