diff options
author | makefu <github@syntax-fehler.de> | 2018-10-21 23:17:37 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2018-10-21 23:17:37 +0200 |
commit | 851c0e47d1ac7073ea5a38a656f93054b20d4b44 (patch) | |
tree | b24ba6aea1aabb9d9934150f3c3be86b1a9cce20 /makefu | |
parent | d8e481ac79f7d65fdede7cb553da8f27d7ccbfb8 (diff) |
ma bureautomation: add tasks for shutting down monitor
Diffstat (limited to 'makefu')
-rw-r--r-- | makefu/2configs/deployment/bureautomation/hass.nix | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/makefu/2configs/deployment/bureautomation/hass.nix b/makefu/2configs/deployment/bureautomation/hass.nix index 4605e8933..b1eba22b4 100644 --- a/makefu/2configs/deployment/bureautomation/hass.nix +++ b/makefu/2configs/deployment/bureautomation/hass.nix @@ -11,6 +11,11 @@ let payload_available= "Online"; payload_not_available= "Offline"; }; + tasmota_stecki = name: topic: + ( tasmota_plug name topic) // + { state_topic = "/bam/${topic}/stat/POWER"; + command_topic = "/bam/${topic}/cmnd/POWER"; + }; espeasy_dht22 = name: [ { platform = "mqtt"; name = "${name} DHT22 Temperature"; @@ -72,7 +77,7 @@ in { switch = [ (tasmota_plug "Bauarbeiterlampe" "plug") (tasmota_plug "Blitzdings" "plug2") - (tasmota_plug "Fernseher" "plug3") + (tasmota_stecki "Fernseher" "fernseher") (tasmota_plug "Pluggy" "plug4") ]; binary_sensor = [ @@ -116,6 +121,31 @@ in { frontend = { }; http = { }; feedreader.urls = [ "http://www.heise.de/security/rss/news-atom.xml" ]; + automation = [ + { alias = "Turn on Fernseher on movement"; + trigger = { + platform = "state"; + entity_id = "binary_sensor.motion"; + to = "on"; + }; + action = { + service= "homeassistant.turn_on"; + entity_id= "switch.fernseher"; + }; + } + { alias = "Turn off Fernseher 10 minutes after last movement"; + trigger = { + platform = "state"; + entity_id = "binary_sensor.motion"; + to = "off"; + for.minutes = 10; + }; + action = { + service= "homeassistant.turn_off"; + entity_id= "switch.fernseher"; + }; + } + ]; }; }; } |