From b0ca7bcd09c3807fb49c0cfc1a653bf20255c9ad Mon Sep 17 00:00:00 2001 From: Alok Saboo Date: Thu, 24 Jan 2019 19:01:49 -0500 Subject: [PATCH] Update time_pattern docs (#8263) * Cleanup time_pattern * Update sensor.tibber.markdown --- source/_components/calendar.caldav.markdown | 2 +- source/_components/frontend.markdown | 6 ++--- source/_components/light.flux_led.markdown | 4 ++-- source/_components/openuv.markdown | 6 ++--- .../sensor.google_travel_time.markdown | 3 +-- source/_components/sensor.template.markdown | 3 +-- source/_components/sensor.tibber.markdown | 3 +-- .../_cookbook/automation_first_light.markdown | 22 +++++++++---------- ...n_using_timeinterval_inputboolean.markdown | 3 +-- source/_cookbook/send_a_reminder.markdown | 2 -- .../2017-03-28-http-to-mqtt-bridge.markdown | 3 +-- 11 files changed, 24 insertions(+), 33 deletions(-) diff --git a/source/_components/calendar.caldav.markdown b/source/_components/calendar.caldav.markdown index 8f27342be6c..01fe75d358d 100644 --- a/source/_components/calendar.caldav.markdown +++ b/source/_components/calendar.caldav.markdown @@ -180,7 +180,7 @@ calendar: alias: worktime wakeup trigger: platform: time - at: 06:40:00 + at: '06:40:00' action: - service: media_player.media_play entity_id: media_player.bedroom diff --git a/source/_components/frontend.markdown b/source/_components/frontend.markdown index 5edb773e4b7..5c8944c7a74 100644 --- a/source/_components/frontend.markdown +++ b/source/_components/frontend.markdown @@ -77,7 +77,7 @@ Check our [community forums](https://community.home-assistant.io/c/projects/them There are 2 themes-related services: - `frontend.reload_themes`: reloads theme configuration from your `configuration.yaml` file. - - `frontend.set_theme(name)`: sets backend-preferred theme name. + - `frontend.set_theme(name)`: sets backend-preferred theme name. Example in automation: @@ -96,7 +96,7 @@ automation: name: happy ``` -To enable "night mode": +To enable "night mode": ```yaml automation: @@ -104,7 +104,7 @@ automation: initial_state: true trigger: - platform: time - at: '21:00' + at: '21:00:00' action: - service: frontend.set_theme data: diff --git a/source/_components/light.flux_led.markdown b/source/_components/light.flux_led.markdown index 33efa06d021..72c02ef8c43 100644 --- a/source/_components/light.flux_led.markdown +++ b/source/_components/light.flux_led.markdown @@ -67,7 +67,7 @@ devices: {% endconfiguration %}

-Depending on your controller or bulb type, there are two ways to configure brightness. +Depending on your controller or bulb type, there are two ways to configure brightness. The component defaults to rgbw. If your device has a separate white channel, you do not need to specify anything else; changing the white value will adjust the brightness of white channel keeping rgb color constant. However, if your device does not have a separate white channel, you will need to set the mode to rgb. In this mode, the device will keep the same color, and adjust the rgb values to dim or brighten the color.

@@ -98,7 +98,7 @@ light: automation: alias: random_flux_living_room_lamp trigger: - platform: time + platform: time_pattern seconds: '/45' action: service: light.turn_on diff --git a/source/_components/openuv.markdown b/source/_components/openuv.markdown index fe70de77001..ede5c5838db 100644 --- a/source/_components/openuv.markdown +++ b/source/_components/openuv.markdown @@ -142,8 +142,7 @@ automation: - alias: Update OpenUV every 30 minutes during the daytime trigger: platform: time_pattern - minutes: "/30" - seconds: 00 + minutes: '/30' condition: condition: and conditions: @@ -164,8 +163,7 @@ automation: - alias: Update OpenUV every hour (24 of 50 calls per day) trigger: platform: time_pattern - minutes: "/60" - seconds: 00 + minutes: '/60' action: service: openuv.update_data ``` diff --git a/source/_components/sensor.google_travel_time.markdown b/source/_components/sensor.google_travel_time.markdown index 0ccd46ee2fa..8159addfd4c 100644 --- a/source/_components/sensor.google_travel_time.markdown +++ b/source/_components/sensor.google_travel_time.markdown @@ -146,9 +146,8 @@ You can also use the `sensor.google_travel_sensor_update` service to update the alias: "Commute - Update morning commute sensor" initial_state: 'on' trigger: - - platform: time + - platform: time_pattern minutes: '/2' - seconds: 00 condition: - condition: time after: '08:00:00' diff --git a/source/_components/sensor.template.markdown b/source/_components/sensor.template.markdown index ab4eb3002e3..238407e63f1 100644 --- a/source/_components/sensor.template.markdown +++ b/source/_components/sensor.template.markdown @@ -286,9 +286,8 @@ sensor: automation: - alias: 'nonsmoker_update' trigger: - - platform: time + - platform: time_pattern minutes: '/5' - seconds: 0 action: - service: homeassistant.update_entity entity_id: sensor.nonsmoker diff --git a/source/_components/sensor.tibber.markdown b/source/_components/sensor.tibber.markdown index 2daf9e4a8b1..8e7e0e946ea 100644 --- a/source/_components/sensor.tibber.markdown +++ b/source/_components/sensor.tibber.markdown @@ -31,10 +31,9 @@ The electricity price can be used to make automations. The sensor has a `max_pri ```yaml - alias: "Electricity price" trigger: - platform: time + platform: time_pattern # Matches every hour at 1 minutes past whole minutes: 1 - seconds: 00 condition: condition: template value_template: '{{ float(states.sensor.electricity_price_hamretunet_10.state) > 0.9 * float(states.sensor.electricity_price_hamretunet_10.attributes.max_price) }}' diff --git a/source/_cookbook/automation_first_light.markdown b/source/_cookbook/automation_first_light.markdown index 098036db77f..be4770c4f7e 100644 --- a/source/_cookbook/automation_first_light.markdown +++ b/source/_cookbook/automation_first_light.markdown @@ -30,8 +30,8 @@ automation: - alias: Enable First Morning Trigger trigger: - platform: time - at: '5:00' - action: + at: '05:00:00' + action: service: homeassistant.turn_on entity_id: input_boolean.trigger_first_morning @@ -41,12 +41,12 @@ automation: - platform: sun event: sunrise offset: "01:00:00" - action: + action: service: homeassistant.turn_off entity_id: input_boolean.trigger_first_morning - + # This is the main automation. It triggers when my motion sensor is triggered # (in this case, a motion sensor from a security system attached to my Vera) - alias: First Morning Motion @@ -59,17 +59,17 @@ automation: condition: state entity_id: input_boolean.trigger_first_morning state: 'on' - + action: # turn off the "waiting" boolean regardless of whether lights will turn on # so that this happens only once - service: homeassistant.turn_off entity_id: input_boolean.trigger_first_morning - + # But only turn on lights if the living room and kitchen lights are off or dimmed - # If a condition tests false, the automation will end + # If a condition tests false, the automation will end - condition: and - conditions: + conditions: - condition: numeric_state entity_id: light.livingroom_ec # if light is off, force a 0, otherwise use the brightness value @@ -84,13 +84,13 @@ automation: entity_id: light.kitchen_ceiling value_template: {% raw %}'{% if states.light.kitchen_ceiling.state == "on" %}{{ states.light.kitchen_ceiling.attributes.brightness }}{% else %}0{% endif %}'{% endraw %} below: 128 - + # Trigger a scene # You could add as many services or scenes as you'd like - service: scene.turn_on entity_id: scene.morning_first_motion - + ``` #### {% linkable_title The Scene %} @@ -98,7 +98,7 @@ automation: Here is the Scene that is called via the Automations above. ```yaml -# here's the scene that gets called. Lights in +# here's the scene that gets called. Lights in # my living room and kitchen turn on. scene: - name: Morning First Motion diff --git a/source/_cookbook/automation_using_timeinterval_inputboolean.markdown b/source/_cookbook/automation_using_timeinterval_inputboolean.markdown index d5edc5e9613..af46927fe5f 100644 --- a/source/_cookbook/automation_using_timeinterval_inputboolean.markdown +++ b/source/_cookbook/automation_using_timeinterval_inputboolean.markdown @@ -25,9 +25,8 @@ automation: # Changes Hue light every two minutes to random color if input boolean is set to on - alias: 'Set LivingColors to random color' trigger: - platform: time + platform: time_pattern minutes: '/2' - seconds: 0 condition: condition: state entity_id: input_boolean.loop_livingcolors diff --git a/source/_cookbook/send_a_reminder.markdown b/source/_cookbook/send_a_reminder.markdown index 05e1047a303..9b965a77bc5 100644 --- a/source/_cookbook/send_a_reminder.markdown +++ b/source/_cookbook/send_a_reminder.markdown @@ -36,5 +36,3 @@ automation: data: message: 'Time for lunch' ``` - - diff --git a/source/_posts/2017-03-28-http-to-mqtt-bridge.markdown b/source/_posts/2017-03-28-http-to-mqtt-bridge.markdown index 07cc25a196c..7a6a19be5e1 100644 --- a/source/_posts/2017-03-28-http-to-mqtt-bridge.markdown +++ b/source/_posts/2017-03-28-http-to-mqtt-bridge.markdown @@ -54,9 +54,8 @@ rest_command: automation: alias: HTTP to MQTT keep alive trigger: - platform: time + platform: time_pattern minutes: '/10' - seconds: 00 condition: condition: time after: '7:30:00'