From e15a3de5188be6c5e7fb227049552faa0fb19177 Mon Sep 17 00:00:00 2001 From: StephenWetzel Date: Tue, 3 Sep 2019 05:36:52 -0400 Subject: [PATCH] Add documentation for two new service methods (#10235) * Add documentation for two new service methods * Change method name to match latest change in PR --- source/_components/openuv.markdown | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/source/_components/openuv.markdown b/source/_components/openuv.markdown index 8e6286b67a0..966bbc98a4d 100644 --- a/source/_components/openuv.markdown +++ b/source/_components/openuv.markdown @@ -153,6 +153,14 @@ trained medical professional. Perform an on-demand update of OpenUV data. +### `openuv.update_uv_index_data` + +Perform an on-demand update of OpenUV sensor data including current UV index, but not the `uv_protection_window`, saving an API call over `update_data`. + +### `openuv.update_protection_data` + +Perform an on-demand update of OpenUV `uv_protection_window` data, but not the sensors, saving an API call. + ## Examples of Updating Data One method to retrieve data every 30 minutes and still leave plenty of API key @@ -175,6 +183,34 @@ automation: service: openuv.update_data ``` +Update only the sensors every 20 minutes while the sun is at least 10 degrees above the horizon: + +```yaml +automation: + - alias: Update OpenUV every 20 minutes while the sun is at least 10 degrees above the horizon + trigger: + platform: time_pattern + minutes: '/20' + condition: + condition: numeric_state + entity_id: sun.sun + value_template: '{{ state.attributes.elevation }}' + above: 10 + action: + service: openuv.update_uv_index_data +``` + +Update the protection window once a day: +```yaml +automation: + - alias: Update OpenUV protection window once a day + trigger: + platform: time + at: "02:12:00" + action: + service: openuv.update_protection_data +``` + Another method (useful when monitoring locations other than the HASS latitude and longitude, in locations where there is a large amount of sunlight per day, etc.) might be to simply query the API less often: