From 87b0fa3adf5e16b4eade0e7e31e445e7a7f973a4 Mon Sep 17 00:00:00 2001 From: ccostan Date: Thu, 14 Jun 2018 15:33:39 -0400 Subject: [PATCH] Updates to random delays. Making them even more random of course! :) --- .../Timed_Triggers/sunrise_turn_off.yaml | 2 +- config/packages/holiday.yaml | 2 +- config/packages/juicenet.yaml | 2 +- config/packages/pihole.yaml | 4 ++-- config/packages/space.yaml | 3 ++- config/packages/twitter.yaml | 17 +++++------------ config/script/front_house_motion.yaml | 2 +- config/script/tweet.yaml | 5 +++-- 8 files changed, 16 insertions(+), 21 deletions(-) diff --git a/config/automation/Timed_Triggers/sunrise_turn_off.yaml b/config/automation/Timed_Triggers/sunrise_turn_off.yaml index 7014dfa6..2ee9f26e 100755 --- a/config/automation/Timed_Triggers/sunrise_turn_off.yaml +++ b/config/automation/Timed_Triggers/sunrise_turn_off.yaml @@ -31,7 +31,7 @@ "/config/www/custom_ui/floorplan/images/branding/Bear_Stone_Coffee.png" ] | random }} - - delay: '00:{{ (range(1, 55)|random|int) }}:00' + - delay: '00:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:00' - service: homeassistant.turn_off entity_id: - group.exterior_lights diff --git a/config/packages/holiday.yaml b/config/packages/holiday.yaml index dfb2faed..ad6556f5 100755 --- a/config/packages/holiday.yaml +++ b/config/packages/holiday.yaml @@ -74,7 +74,7 @@ automation: message: 'Today is {{ states.sensor.holiday.state }}.' title: '{{ states.sensor.holiday.state }}' - - delay: '{{ (range(4, 8)|random|int) }}:{{ (range(1, 50)|random|int) }}:00' + - delay: '0{{ (range(4, 8)|random|int) }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}' - service: script.tweet_engine_image data_template: tweet: > diff --git a/config/packages/juicenet.yaml b/config/packages/juicenet.yaml index abf242cb..d608a81d 100755 --- a/config/packages/juicenet.yaml +++ b/config/packages/juicenet.yaml @@ -114,7 +114,7 @@ automation: entity_id: sensor.carlojuice_charging_status from: 'charging' action: - - delay: '0{{ range(0,4) | random | int }}:00:00' + - delay: '0{{ range(0,3) | random | int }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:00' - service: script.tweet_engine_image data_template: tweet: > diff --git a/config/packages/pihole.yaml b/config/packages/pihole.yaml index 36aab19e..085e86b4 100755 --- a/config/packages/pihole.yaml +++ b/config/packages/pihole.yaml @@ -100,7 +100,7 @@ automation: platform: time at: '23:50:00' action: - - delay: '00:{{ (range(1, 9)|random|int) }}:00' + - delay: '00:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:00' - service: script.tweet_engine_image data_template: tweet: > @@ -121,7 +121,7 @@ automation: platform: time at: '04:30:00' action: - - delay: '{{ (range(1, 6)|random|int) }}:{{ (range(1, 50)|random|int) }}:00' + - delay: '0{{ (range(1, 5)|random|int) }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:00' - service: script.tweet_engine_image data_template: tweet: > diff --git a/config/packages/space.yaml b/config/packages/space.yaml index 382ea933..ebd09189 100755 --- a/config/packages/space.yaml +++ b/config/packages/space.yaml @@ -107,13 +107,14 @@ automation: "/config/www/custom_ui/floorplan/images/branding/space2.png", "/config/www/custom_ui/floorplan/images/branding/starman.png" ] | random }} + - alias: 'Full Moon -Tweet' trigger: - platform: state entity_id: sensor.moon to: 'Full Moon' action: - - delay: '{{ (range(1, 6)|random|int) }}:{{ (range(1, 50)|random|int) }}:00' + - delay: '0{{ (range(1, 5)|random|int) }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:00' - service: script.tweet_engine_image data_template: tweet: >- diff --git a/config/packages/twitter.yaml b/config/packages/twitter.yaml index f7060514..cdcecc8f 100755 --- a/config/packages/twitter.yaml +++ b/config/packages/twitter.yaml @@ -258,18 +258,10 @@ automation: - alias: 'ThrowBack message' trigger: - platform: time - hours: '/11' + hours: '/14' minutes: 13 seconds: 00 - # condition: - # - condition: template - # value_template: > - # {%- if states.automation.random_house_stats.attributes.last_triggered -%} - # {{ (as_timestamp(now()) - as_timestamp(states.automation.random_house_stats.attributes.last_triggered)) > 2000 }} - # { - # %- else -%} - # true - # {%- endif -%} + action: - service: notify.ccostan data_template: @@ -283,6 +275,7 @@ automation: "Build your own DIY Outdoor Smart Home LED strips - (https://www.vcloudinfo.com/2017/08/diy-outdoor-smart-home-led-strips.html)", "Breakdown of the entire smart home - (https://www.vcloudinfo.com/2017/07/my-smart-home-look-at-parts-that-make.html)", "Build your own Home Alarm System - (https://www.vcloudinfo.com/2017/06/building-my-home-alarm-system-hardware.html)", + "Some of my favorite #Docker Containers that I am using - (https://www.vcloudinfo.com/2018/06/rolling-out-some-new-docker-containers.html)", "Be Sure to follow all of my Twitter Accounts! @CCostan and my HOUSE bot @BearStoneHA!", "Be sure to like me on Facebook and join our HA group! (https://www.facebook.com/groups/HomeAssistant/) (https://www.facebook.com/VMwareInfo/) (https://www.facebook.com/BearStoneHA/)", "You can see how ALL of this is done by browsing my GitHub Repository (https://github.com/CCOSTAN/Home-AssistantConfig#logo)", @@ -315,14 +308,14 @@ automation: true {%- endif -%} action: - - delay: '0{{ range(0,2) | random | int }}:{{ range(10,59) | random | int }}:00' + - delay: '0{{ range(0,2) | random | int }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}' - service: script.tweet_engine_setup data_template: pick: >- {% set pick = [ "minecraft", "solar", "solar", "solar", - "robot", "robot", "robot", "robot", "robot", "robot", "robot", "robot", "robot","robot","robot","robot", + "robot", "robot", "robot", "robot", "robot", "robot", "robot", "robot", "robot","robot","robot","robot","robot", "door", "door", "door", "weather", "weather", "weather", "weather", "weather", "cloud", diff --git a/config/script/front_house_motion.yaml b/config/script/front_house_motion.yaml index 3357a887..72d1a4d0 100755 --- a/config/script/front_house_motion.yaml +++ b/config/script/front_house_motion.yaml @@ -35,7 +35,7 @@ front_house_motion: - group.outdoor_pool_lights brightness: 255 - service: script.dog_bark - - delay: '00:{{ (range(5, 20)|random|int) }}:00' + - delay: '00:{{ range(0,1) | random | int }}{{ range(0,9) | random | int }}:00' - service: light.turn_off entity_id: - group.outdoor_front_lights diff --git a/config/script/tweet.yaml b/config/script/tweet.yaml index 897c03cd..253370b2 100755 --- a/config/script/tweet.yaml +++ b/config/script/tweet.yaml @@ -36,7 +36,7 @@ tweet_engine_setup: "Build your own DIY Outdoor Smart Home LED strips - (https://www.vcloudinfo.com/2017/08/diy-outdoor-smart-home-led-strips.html)", "Breakdown of the entire smart home - (https://www.vcloudinfo.com/2017/07/my-smart-home-look-at-parts-that-make.html)", "Build your own Home Alarm System - (https://www.vcloudinfo.com/2017/06/building-my-home-alarm-system-hardware.html)", - "Some of my favorite Docker Containersthat I am using - (https://www.vcloudinfo.com/2018/06/rolling-out-some-new-docker-containers.html)", + "Some of my favorite #Docker Containers that I am using - (https://www.vcloudinfo.com/2018/06/rolling-out-some-new-docker-containers.html)", "10 year safety check. If you haven't done it yet, you need to! (https://www.vcloudinfo.com/2017/06/psa-check-out-your-smoke-detectors-once.html)" ], "robot": [ @@ -52,7 +52,8 @@ tweet_engine_setup: "{{((states.sensor.sensor_count.state | int) + (states.sensor.binary_sensor_count.state | int))}} sensors feed my Smart Home #data. (https://github.com/CCOSTAN/Home-AssistantConfig#logo)", "{{states.sensor.automation_count.state}} automations and {{states.sensor.script_count.state}} scripts make my home smart (https://github.com/CCOSTAN/Home-AssistantConfig#logo)", "Nevermind me. I am just keeping track of {{states.sensor.lights_count.state}} lights and {{states.sensor.tracker_count.state}} devices in the house. (https://github.com/CCOSTAN/Home-AssistantConfig#logo)", - "There are {{states.sensor.protect_count.state}} Nest Protect smoke Detectors ONLINE and protecting the house! (https://github.com/CCOSTAN/Home-AssistantConfig#nest) " + "There are {{states.sensor.protect_count.state}} Nest Protect smoke Detectors ONLINE and protecting the house! (https://github.com/CCOSTAN/Home-AssistantConfig#nest) ", + "We have {{states.sensor.camera_count.state}} cameras ONLINE and recording the house 24/7! (https://github.com/CCOSTAN/Home-AssistantConfig#cameras)" ], "door": [