diff --git a/atom.xml b/atom.xml index 3bb9a7cc1f..faa45f46d3 100644 --- a/atom.xml +++ b/atom.xml @@ -4,7 +4,7 @@
localhost
10000
/dev/ttyUSB0
115200
115200
off
This is also fairly easy to achieve with Home Assistant automations, but we are just getting started.
Our next example is to turn on a light when motion is detected and it is dark, and turn it off after a period of time. This time, the initialize()
function registers a callback on a state change (of the motion sensor) rather than a specific time. We tell AppDaemon that we are only interested in state changes where the motion detector comes on by adding an additional parameter to the callback registration - new = "on"
. When the motion is detected, the callack function motion()
is called, and we check whether or not the sun has set using a built-in convenience function: sun_down()
. Next, we turn the light on with turn_on()
, then set a timer using run_in()
to turn the light off after 60 seconds, which is another call to the scheduler to execute in a set time from now, which results in AppDaemon
calling light_off()
60 seconds later using the turn_off()
call to actually turn the light off. This is still pretty simple in code terms:
Our next example is to turn on a light when motion is detected and it is dark, and turn it off after a period of time. This time, the initialize()
function registers a callback on a state change (of the motion sensor) rather than a specific time. We tell AppDaemon that we are only interested in state changes where the motion detector comes on by adding an additional parameter to the callback registration - new = "on"
. When the motion is detected, the callback function motion()
is called, and we check whether or not the sun has set using a built-in convenience function: sun_down()
. Next, we turn the light on with turn_on()
, then set a timer using run_in()
to turn the light off after 60 seconds, which is another call to the scheduler to execute in a set time from now, which results in AppDaemon
calling light_off()
60 seconds later using the turn_off()
call to actually turn the light off. This is still pretty simple in code terms:
import homeassistant.appapi as appapi
class FlashyMotionLights(appapi.AppDaemon):
diff --git a/sitemap.xml b/sitemap.xml
index 1aae7b6bbf..4df12c51be 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -3442,7 +3442,7 @@
https://home-assistant.io/components/switch.hook/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/cookbook/automation_for_rainy_days/
@@ -4078,99 +4078,99 @@
https://home-assistant.io/docs/autostart/init.d/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/api/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/configuration/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/example_apps/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/installation/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/operation/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/reboot/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/running/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/tutorial/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/updating/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/windows/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/ecosystem/certificates/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/ecosystem/hadashboard/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/ecosystem/hass-configurator/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/ecosystem/ios/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/ecosystem/nginx/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/ecosystem/notebooks/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/ecosystem/scenegen/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/ecosystem/synology/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/tools/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/tools/dev-tools/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/tools/hass/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/docs/tools/scripts/
-2017-10-13T09:28:03+00:00
+2017-10-13T10:14:58+00:00
https://home-assistant.io/faq/after-upgrading/
@@ -5226,62 +5226,62 @@
https://home-assistant.io/demo/frontend.html
-2017-10-13T09:27:05+00:00
+2017-10-13T10:14:11+00:00
https://home-assistant.io/demo/index.html
-2017-10-13T09:27:05+00:00
+2017-10-13T10:14:11+00:00
https://home-assistant.io/demo/panels/ha-panel-dev-event.html
-2017-10-13T09:27:05+00:00
+2017-10-13T10:14:11+00:00
https://home-assistant.io/demo/panels/ha-panel-dev-info.html
-2017-10-13T09:27:05+00:00
+2017-10-13T10:14:11+00:00
https://home-assistant.io/demo/panels/ha-panel-dev-service.html
-2017-10-13T09:27:05+00:00
+2017-10-13T10:14:11+00:00
https://home-assistant.io/demo/panels/ha-panel-dev-state.html
-2017-10-13T09:27:05+00:00
+2017-10-13T10:14:11+00:00
https://home-assistant.io/demo/panels/ha-panel-dev-template.html
-2017-10-13T09:27:05+00:00
+2017-10-13T10:14:11+00:00
https://home-assistant.io/demo/panels/ha-panel-history.html
-2017-10-13T09:27:05+00:00
+2017-10-13T10:14:11+00:00
https://home-assistant.io/demo/panels/ha-panel-iframe.html
-2017-10-13T09:27:05+00:00
+2017-10-13T10:14:11+00:00
https://home-assistant.io/demo/panels/ha-panel-logbook.html
-2017-10-13T09:27:05+00:00
+2017-10-13T10:14:11+00:00
https://home-assistant.io/demo/panels/ha-panel-map.html
-2017-10-13T09:27:05+00:00
+2017-10-13T10:14:11+00:00
https://home-assistant.io/googlef4f3693c209fe788.html
-2017-10-13T09:27:05+00:00
+2017-10-13T10:14:11+00:00
https://home-assistant.io/static/fonts/roboto/DESCRIPTION.en_us.html
-2017-10-13T09:27:05+00:00
+2017-10-13T10:14:12+00:00
https://home-assistant.io/static/fonts/robotomono/DESCRIPTION.en_us.html
-2017-10-13T09:27:05+00:00
+2017-10-13T10:14:12+00:00
https://home-assistant.io/static/mdi-demo.html
-2017-10-13T09:27:05+00:00
+2017-10-13T10:14:12+00:00