From 8fd8b9cb35f0a2e868047795212470b5afa646d6 Mon Sep 17 00:00:00 2001 From: Kevin Eifinger Date: Sat, 23 Nov 2019 10:05:08 +0100 Subject: [PATCH 1/4] Add integration here_weather --- source/_integrations/here_weather.markdown | 179 +++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 source/_integrations/here_weather.markdown diff --git a/source/_integrations/here_weather.markdown b/source/_integrations/here_weather.markdown new file mode 100644 index 000000000000..c683a9ddb608 --- /dev/null +++ b/source/_integrations/here_weather.markdown @@ -0,0 +1,179 @@ +--- +title: "HERE Destination Weather" +description: "Instructions on how to add HERE Destination Weather to Home Assistant." +logo: HERE_logo.svg +ha_category: + - Weather + - Sensor +ha_iot_class: Cloud Polling +ha_release: "0.103" +--- + +The `here_weather` integration provides weather information from the [HERE Destination Weather API](https://developer.here.com/documentation/weather/dev_guide/topics/overview.html). + +This integration consists of the following platforms: + +- [Sensor](#sensor) +- [Weather](#weather) + +## Setup + +You need to register for an API key (REST & XYZ HUB API/CLI) by following the instructions [here](https://developer.here.com/documentation/weather/dev_guide/common/credentials.html). + +HERE offers a Freemium Plan which includes 250,000 free Transactions per month. For the Destination Weather API, one transaction equals one request. More information can be found [here](https://developer.here.com/faqs#payment-subscription) + +By default HERE will deactivate your account if you exceed the free Transaction limit for the month. You can add payment details to reenable your account as described [here](https://developer.here.com/faqs) + +## Sensor + +To enable the sensor, add the following lines to your `configuration.yaml` file: + +```yaml +# Example entry for configuration.yaml +sensor: + - platform: here_weather + app_id: "YOUR_APP_ID" + app_code: "YOUR_APP_CODE" +``` + +The location to get the weather information for can be provided via `location_name`, `latitude/longitude` or `zip_code`(US Only). +If none of these is provided the `latitude` and `longitude` of the Homeassistance instance is used. + +{% configuration %} +app_id: + description: "Your application's API id (get one by following the instructions above)." + required: true + type: string +app_code: + description: "Your application's API code (get one by following the instructions above)." + required: true + type: string +location_name: + description: "The name of the location to get the weather information for. Cannot be used in combination with `latitude/longitude` or `zip_code`." + required: false + type: string +zip_code: + description: "The ZIP code (US Only) of the location to get the weather information for. Cannot be used in combination with `latitude/longitude` or `location_name`." + required: false + type: string +latitude: + description: "The latitude of the location to get the weather information for. Must be used in combination with `longitude`. Cannot be used in combination with `location_name` or `zip_code`." + required: false + type: string +longitude: + description: "The latitude of the location to get the weather information for. Must be used in combination with `latitude`. Cannot be used in combination with `location_name` or `zip_code`." + required: false + type: string +name: + description: A name to display on the sensor. The default is "here_weather". + required: false + type: string + default: "here_weather" +mode: + description: "You can choose between: `forecast_astronomy`, `forecast_hourly`, `forecast_7days`, `forecast_7days_simple`, `observation` or `truck`. The default is `forecast_7days_simple`. You can find more information on the modes [here](https://developer.here.com/api-explorer/rest/auto_weather). The sensors which get created differ between the modes. + required: false + type: string + default: "forecast_7days_simple" +offset: + description: "Which entry of the returned data to choose. This could be used to get the data of 5 days in the future from the point of request." + required: false + type: integer + default: 0 +unit_system: + description: "You can choose between `metric` or `imperial`." + required: false + default: Defaults to `metric` or `imperial` based on the Home Assistant configuration. + type: string +scan_interval: + description: "Defines the update interval of the sensor in seconds. Defaults to 120 (2 minutes)." + required: false + type: integer + default: 120 +{% endconfiguration %} + +### Advanced Example + +```yaml +sensor: + - platform: here_weather + name: Mainz in 5 Hours + app_id: "YOUR_APP_ID" + app_code: "YOUR_APP_CODE" + location_name: Mainz + mode: forecast_hourly + offset: 5 +``` + +## Weather + +To enable the weather integration, add the following lines to your `configuration.yaml` file: + +```yaml +# Example entry for configuration.yaml +weather: + - platform: here_weather + app_id: "YOUR_APP_ID" + app_code: "YOUR_APP_CODE" +``` + +The location to get the weather information for can be provided via `location_name`, `latitude/longitude` or `zip_code`(US Only). +If none of these is provided the `latitude` and `longitude` of the Homeassistance instance is used. + +{% configuration %} +app_id: + description: "Your application's API id (get one by following the instructions above)." + required: true + type: string +app_code: + description: "Your application's API code (get one by following the instructions above)." + required: true + type: string +location_name: + description: "The name of the location to get the weather information for. Cannot be used in combination with `latitude/longitude` or `zip_code`." + required: false + type: string +zip_code: + description: "The ZIP code (US Only) of the location to get the weather information for. Cannot be used in combination with `latitude/longitude` or `location_name`." + required: false + type: string +latitude: + description: "The latitude of the location to get the weather information for. Must be used in combination with `longitude`. Cannot be used in combination with `location_name` or `zip_code`." + required: false + type: string +longitude: + description: "The latitude of the location to get the weather information for. Must be used in combination with `latitude`. Cannot be used in combination with `location_name` or `zip_code`." + required: false + type: string +name: + description: A name to display on the sensor. The default is "HERE". + required: false + type: string + default: "HERE" +mode: + description: "You can choose between: `forecast_hourly`, `forecast_7days`, `forecast_7days_simple`, `observation` or `truck`. The default is `forecast_7days_simple`. You can find more information on the modes [here](https://developer.here.com/api-explorer/rest/auto_weather). The sensors which get created differ between the modes. + required: false + type: string + default: "forecast_7days_simple" +unit_system: + description: "You can choose between `metric` or `imperial`." + required: false + default: Defaults to `metric` or `imperial` based on the Home Assistant configuration. + type: string +scan_interval: + description: "Defines the update interval of the sensor in seconds. Defaults to 120 (2 minutes)." + required: false + type: integer + default: 120 +{% endconfiguration %} + +### Advanced Example + +```yaml +weather: + - platform: here_weather + name: Mainz Hourly + app_id: "YOUR_APP_ID" + app_code: "YOUR_APP_CODE" + location_name: Mainz + mode: forecast_hourly +``` \ No newline at end of file From 4c13c68a11586adc79f172bd8e2de3aa0c167668 Mon Sep 17 00:00:00 2001 From: Kevin Eifinger Date: Sat, 23 Nov 2019 11:19:05 +0100 Subject: [PATCH 2/4] add missing " --- source/_integrations/here_weather.markdown | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/source/_integrations/here_weather.markdown b/source/_integrations/here_weather.markdown index c683a9ddb608..2d5811a30a11 100644 --- a/source/_integrations/here_weather.markdown +++ b/source/_integrations/here_weather.markdown @@ -20,16 +20,15 @@ This integration consists of the following platforms: You need to register for an API key (REST & XYZ HUB API/CLI) by following the instructions [here](https://developer.here.com/documentation/weather/dev_guide/common/credentials.html). -HERE offers a Freemium Plan which includes 250,000 free Transactions per month. For the Destination Weather API, one transaction equals one request. More information can be found [here](https://developer.here.com/faqs#payment-subscription) +HERE offers a Freemium Plan which includes 250,000 free Transactions per month. For the Destination Weather API, one transaction equals one request. More information can be found [here](https://developer.here.com/faqs#payment-subscription). -By default HERE will deactivate your account if you exceed the free Transaction limit for the month. You can add payment details to reenable your account as described [here](https://developer.here.com/faqs) +By default HERE will deactivate your account if you exceed the free Transaction limit for the month. You can add payment details to reenable your account as described [here](https://developer.here.com/faqs). ## Sensor To enable the sensor, add the following lines to your `configuration.yaml` file: ```yaml -# Example entry for configuration.yaml sensor: - platform: here_weather app_id: "YOUR_APP_ID" @@ -70,7 +69,7 @@ name: type: string default: "here_weather" mode: - description: "You can choose between: `forecast_astronomy`, `forecast_hourly`, `forecast_7days`, `forecast_7days_simple`, `observation` or `truck`. The default is `forecast_7days_simple`. You can find more information on the modes [here](https://developer.here.com/api-explorer/rest/auto_weather). The sensors which get created differ between the modes. + description: "You can choose between: `forecast_astronomy`, `forecast_hourly`, `forecast_7days`, `forecast_7days_simple`, `observation` or `truck`. The default is `forecast_7days_simple`. You can find more information on the modes [here](https://developer.here.com/api-explorer/rest/auto_weather). The sensors which get created differ between the modes." required: false type: string default: "forecast_7days_simple" @@ -109,7 +108,6 @@ sensor: To enable the weather integration, add the following lines to your `configuration.yaml` file: ```yaml -# Example entry for configuration.yaml weather: - platform: here_weather app_id: "YOUR_APP_ID" @@ -150,7 +148,7 @@ name: type: string default: "HERE" mode: - description: "You can choose between: `forecast_hourly`, `forecast_7days`, `forecast_7days_simple`, `observation` or `truck`. The default is `forecast_7days_simple`. You can find more information on the modes [here](https://developer.here.com/api-explorer/rest/auto_weather). The sensors which get created differ between the modes. + description: "You can choose between: `forecast_hourly`, `forecast_7days`, `forecast_7days_simple`, `observation` or `truck`. The default is `forecast_7days_simple`. You can find more information on the modes [here](https://developer.here.com/api-explorer/rest/auto_weather). The sensors which get created differ between the modes." required: false type: string default: "forecast_7days_simple" From c50d4b6830218c37e04db5ba7096da15e79eaea6 Mon Sep 17 00:00:00 2001 From: Kevin Eifinger Date: Mon, 16 Dec 2019 09:42:50 +0100 Subject: [PATCH 3/4] Migrate to api_key --- source/_integrations/here_weather.markdown | 28 +++++++--------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/source/_integrations/here_weather.markdown b/source/_integrations/here_weather.markdown index 2d5811a30a11..d462e98f46fd 100644 --- a/source/_integrations/here_weather.markdown +++ b/source/_integrations/here_weather.markdown @@ -31,20 +31,15 @@ To enable the sensor, add the following lines to your `configuration.yaml` file: ```yaml sensor: - platform: here_weather - app_id: "YOUR_APP_ID" - app_code: "YOUR_APP_CODE" + api_key: "YOUR_API_KEY" ``` The location to get the weather information for can be provided via `location_name`, `latitude/longitude` or `zip_code`(US Only). If none of these is provided the `latitude` and `longitude` of the Homeassistance instance is used. {% configuration %} -app_id: - description: "Your application's API id (get one by following the instructions above)." - required: true - type: string -app_code: - description: "Your application's API code (get one by following the instructions above)." +api_key: + description: "Your application's API key (get one by following the instructions above)." required: true type: string location_name: @@ -96,8 +91,7 @@ scan_interval: sensor: - platform: here_weather name: Mainz in 5 Hours - app_id: "YOUR_APP_ID" - app_code: "YOUR_APP_CODE" + api_key: "YOUR_API_KEY" location_name: Mainz mode: forecast_hourly offset: 5 @@ -110,20 +104,15 @@ To enable the weather integration, add the following lines to your `configuratio ```yaml weather: - platform: here_weather - app_id: "YOUR_APP_ID" - app_code: "YOUR_APP_CODE" + api_key: "YOUR_API_KEY" ``` The location to get the weather information for can be provided via `location_name`, `latitude/longitude` or `zip_code`(US Only). If none of these is provided the `latitude` and `longitude` of the Homeassistance instance is used. {% configuration %} -app_id: - description: "Your application's API id (get one by following the instructions above)." - required: true - type: string -app_code: - description: "Your application's API code (get one by following the instructions above)." +api_key: + description: "Your application's API key (get one by following the instructions above)." required: true type: string location_name: @@ -170,8 +159,7 @@ scan_interval: weather: - platform: here_weather name: Mainz Hourly - app_id: "YOUR_APP_ID" - app_code: "YOUR_APP_CODE" + api_key: "YOUR_API_KEY" location_name: Mainz mode: forecast_hourly ``` \ No newline at end of file From 357af0805444b51a074b055da9d1cbcb4b16a267 Mon Sep 17 00:00:00 2001 From: Kevin Eifinger Date: Fri, 23 Jul 2021 16:45:48 +0200 Subject: [PATCH 4/4] Update here_weather documentation --- source/_integrations/here_weather.markdown | 167 +++------------------ 1 file changed, 21 insertions(+), 146 deletions(-) diff --git a/source/_integrations/here_weather.markdown b/source/_integrations/here_weather.markdown index d462e98f46fd..8bf6d47d8b45 100644 --- a/source/_integrations/here_weather.markdown +++ b/source/_integrations/here_weather.markdown @@ -1,165 +1,40 @@ --- title: "HERE Destination Weather" description: "Instructions on how to add HERE Destination Weather to Home Assistant." -logo: HERE_logo.svg ha_category: - Weather - Sensor ha_iot_class: Cloud Polling -ha_release: "0.103" +ha_release: '0.103' +ha_config_flow: true +ha_quality_scale: gold +ha_codeowners: + - '@eifinger' +ha_platforms: + - sensor + - weather --- -The `here_weather` integration provides weather information from the [HERE Destination Weather API](https://developer.here.com/documentation/weather/dev_guide/topics/overview.html). - -This integration consists of the following platforms: - -- [Sensor](#sensor) -- [Weather](#weather) +The `here_weather` integration provides weather information from the [HERE Destination Weather API](https://developer.here.com/documentation/destination-weather/dev_guide/topics/overview.html). ## Setup -You need to register for an API key (REST & XYZ HUB API/CLI) by following the instructions [here](https://developer.here.com/documentation/weather/dev_guide/common/credentials.html). - -HERE offers a Freemium Plan which includes 250,000 free Transactions per month. For the Destination Weather API, one transaction equals one request. More information can be found [here](https://developer.here.com/faqs#payment-subscription). - -By default HERE will deactivate your account if you exceed the free Transaction limit for the month. You can add payment details to reenable your account as described [here](https://developer.here.com/faqs). - -## Sensor - -To enable the sensor, add the following lines to your `configuration.yaml` file: - -```yaml -sensor: - - platform: here_weather - api_key: "YOUR_API_KEY" -``` - -The location to get the weather information for can be provided via `location_name`, `latitude/longitude` or `zip_code`(US Only). -If none of these is provided the `latitude` and `longitude` of the Homeassistance instance is used. - -{% configuration %} -api_key: - description: "Your application's API key (get one by following the instructions above)." - required: true - type: string -location_name: - description: "The name of the location to get the weather information for. Cannot be used in combination with `latitude/longitude` or `zip_code`." - required: false - type: string -zip_code: - description: "The ZIP code (US Only) of the location to get the weather information for. Cannot be used in combination with `latitude/longitude` or `location_name`." - required: false - type: string -latitude: - description: "The latitude of the location to get the weather information for. Must be used in combination with `longitude`. Cannot be used in combination with `location_name` or `zip_code`." - required: false - type: string -longitude: - description: "The latitude of the location to get the weather information for. Must be used in combination with `latitude`. Cannot be used in combination with `location_name` or `zip_code`." - required: false - type: string -name: - description: A name to display on the sensor. The default is "here_weather". - required: false - type: string - default: "here_weather" -mode: - description: "You can choose between: `forecast_astronomy`, `forecast_hourly`, `forecast_7days`, `forecast_7days_simple`, `observation` or `truck`. The default is `forecast_7days_simple`. You can find more information on the modes [here](https://developer.here.com/api-explorer/rest/auto_weather). The sensors which get created differ between the modes." - required: false - type: string - default: "forecast_7days_simple" -offset: - description: "Which entry of the returned data to choose. This could be used to get the data of 5 days in the future from the point of request." - required: false - type: integer - default: 0 -unit_system: - description: "You can choose between `metric` or `imperial`." - required: false - default: Defaults to `metric` or `imperial` based on the Home Assistant configuration. - type: string -scan_interval: - description: "Defines the update interval of the sensor in seconds. Defaults to 120 (2 minutes)." - required: false - type: integer - default: 120 -{% endconfiguration %} - -### Advanced Example - -```yaml -sensor: - - platform: here_weather - name: Mainz in 5 Hours - api_key: "YOUR_API_KEY" - location_name: Mainz - mode: forecast_hourly - offset: 5 -``` +You need to register for an API key (REST & XYZ HUB API/CLI) by following the instructions [here](https://developer.here.com/tutorials/getting-here-credentials/). -## Weather +HERE offers a Freemium Plan which includes 250,000 free Transactions per month. For the Destination Weather API, one transaction equals one request. -To enable the weather integration, add the following lines to your `configuration.yaml` file: +By default HERE will deactivate your account if you exceed the free Transaction limit for the month. You can add payment details to reenable your account as described [here](https://knowledge.here.com/csm_kb?id=public_kb_csm_details&number=KB0016434). -```yaml -weather: - - platform: here_weather - api_key: "YOUR_API_KEY" -``` +{% include integrations/config_flow.md %} -The location to get the weather information for can be provided via `location_name`, `latitude/longitude` or `zip_code`(US Only). -If none of these is provided the `latitude` and `longitude` of the Homeassistance instance is used. +## Additional entities -{% configuration %} -api_key: - description: "Your application's API key (get one by following the instructions above)." - required: true - type: string -location_name: - description: "The name of the location to get the weather information for. Cannot be used in combination with `latitude/longitude` or `zip_code`." - required: false - type: string -zip_code: - description: "The ZIP code (US Only) of the location to get the weather information for. Cannot be used in combination with `latitude/longitude` or `location_name`." - required: false - type: string -latitude: - description: "The latitude of the location to get the weather information for. Must be used in combination with `longitude`. Cannot be used in combination with `location_name` or `zip_code`." - required: false - type: string -longitude: - description: "The latitude of the location to get the weather information for. Must be used in combination with `latitude`. Cannot be used in combination with `location_name` or `zip_code`." - required: false - type: string -name: - description: A name to display on the sensor. The default is "HERE". - required: false - type: string - default: "HERE" -mode: - description: "You can choose between: `forecast_hourly`, `forecast_7days`, `forecast_7days_simple`, `observation` or `truck`. The default is `forecast_7days_simple`. You can find more information on the modes [here](https://developer.here.com/api-explorer/rest/auto_weather). The sensors which get created differ between the modes." - required: false - type: string - default: "forecast_7days_simple" -unit_system: - description: "You can choose between `metric` or `imperial`." - required: false - default: Defaults to `metric` or `imperial` based on the Home Assistant configuration. - type: string -scan_interval: - description: "Defines the update interval of the sensor in seconds. Defaults to 120 (2 minutes)." - required: false - type: integer - default: 120 -{% endconfiguration %} +The integration provides the following four modes: -### Advanced Example +* **Astronomy**: Sunrise, Sunset and Moonphase +* **Hourly**: Weather forecast in an hourly format +* **Daily**: Weather forecast in a dailyformat +* **Daily Simple**: Like Daily but with high/low temp, UV-index and pressure +* **Observation**: Detailed precipitation for the next 24h -```yaml -weather: - - platform: here_weather - name: Mainz Hourly - api_key: "YOUR_API_KEY" - location_name: Mainz - mode: forecast_hourly -``` \ No newline at end of file +All sensors and all weather entities but the Daily Simple are disabled by default. You can enable them manually if needed. \ No newline at end of file