WTIOAddons / date-time-adapter

Group Collaboration on date-time-adapter by all contributors with a special thanks to tomasy for original project
Mozilla Public License 2.0
0 stars 1 forks source link

DateTime adapter

DateTime adapter for WebThings Gateway.

Purpose: Create rules where date and time is needed as input

Upgrade

After upgrade the addon the pages must be reloaded before the new attributes are visible.
After upgrade to version 1.0.2 check existing rules because some properties are changed.

Release notes

1.2.3

1.1.4

1.1.3

1.1.0

1.0.8

1.0.2

1.0.1

1.0.0

0.9.5

DateTime have the following properties and events

Configuration

Configure the position latitude and longitude where you live and horizon. Normally the sunset/sunrise is set to some value when the sun is below horizon.

Example

Turn the lamp in bedroom only on weekdays `if the time of day is 06:13 and DateTime is not weekend, turn BedroomLamp on

To start the fan evey hour and switch it of after 5 minutes
if DateTime minute is 20, turn Fan on
if DateTime minute is 25, turn Fan off

To start the fan evey second hour when it is dark and switch it of after 5 minutes
if DateTime is dark and DateTime minute is 20 and DateTime is even_hour, turn Fan on
if DateTime minute is 25, turn Fan off

If its only for 5 minutes while DateTime minutes5 is 5, turn Fan on

A motion sensor is only active between 10:00--10:59 if DateTime Hour is greater than 9 and DateTime Hour is less than 11 and Motion sensor is motion, turn Light on

Open blinds 15 minutes before sunrise (configure -15 for offset mins) if DateTime event "Sunrise offset -15 mins" occurs, do Scene Controller action "AllOpen"

Close blinds because the sun hits your eye like a big pizza pie (look at controller for az/el parameters when blinded) if DateTime Azimuth is greater than -112, DateTime Azimuth is less than -95, DateTime Elevation is less than 7, DateTime Elevation is greater than 2, set Blind-1 Level to 50

sudo apt install python3-dev
sudo pip3 install pytz pyephem # 3.7.6.0 sunset/sunrise
sudo pip3 install git+https://github.com/WebThingsIO/gateway-addon-python.git