This is the MeteoSwiss integration for Home Assistant.
See below for common issues.
You only need to do this if you had either Websylv's integration or an older version of this integration installed and setup.
custom_components/meteo-swiss
is nonexistent
under the Home Assistant configuration directory. Note the dash!Add this integration as a custom repository to HACS. If you use HACS you already know the generic instructions on how to do this. Here is how it looks like on the add custom repo screen:
Once added as a custom repository, add the integration to your HACS setup:
Once done you should see a pending restart box:
Restart your Home Assistant:
Now you are ready to add one or more instances of the integration.
First make sure that your Home Assistant's basic setup (latitude, longitude) is correct. This information is used to help you set up the weather station. If, however, it is not correct, you can still override it later.
Get to the Home Asssistant settings screen:
If you are not happy with the settings, in a future release you will be able to update them.
Here is a sample of a YAML-based trigger-powered template sensor that creates
three different sensors from a service call every fifteen minutes. From the
sample code below, you are to modify the entity_id
to match your own weather
entity ID, then place the adjusted code within your Home Assistant's
configuration.yaml
file (under template:
as exemplified below), then
restart Home Assistant.
# ...
template:
# ...
- trigger:
- platform: time_pattern
minutes: /15
action:
- service: weather.get_forecasts
data:
type: daily
target:
entity_id: weather.meteoswiss
response_variable: response_forecast_daily
sensor:
- name: Tomorrow Max Temp
unique_id: d1b441ec-e9c6-43f8-a50a-c7c5c42c0ef5
state: "{{ response_forecast_daily['weather.meteoswiss'].forecast[1].temperature }}"
- name: Tomorrow Min Temp
unique_id: b88a351c-8eb7-40ae-8a9e-dcfeaa224551
state: "{{ response_forecast_daily['weather.meteoswiss'].forecast[1].templow }}"
- name: Tomorrow Mean Temp
unique_id: 6344f875-4569-4c3f-ad8d-ad6bccc5bc61
state: "{{ ((response_forecast_daily['weather.meteoswiss'].forecast[1].temperature) + (response_forecast_daily['weather.meteoswiss'].forecast[1].templow)) /2}}"
You can also create a sensor that will have the list of hourly forecasts as an attribute you can consult:
# ...
template:
# ...
- trigger:
- platform: state
entity_id: weather.biasca_circolo_della_riviera_distretto_di_riviera_2
- platform: homeassistant
event: start
- platform: event
event_type: event_template_reloaded
action:
- service: weather.get_forecasts
data:
type: hourly
target:
entity_id: weather.biasca_circolo_della_riviera_distretto_di_riviera_2
response_variable: hourly
sensor:
- name: Wettervorhersage Biasca Stuendlich
unique_id: weather_forecast_biasca_hourly
state: "{{ now().isoformat() }}"
attributes:
forecast: "{{ hourly['weather.biasca_circolo_della_riviera_distretto_di_riviera_2'].forecast }}"
That one is very useful to retract awnings and other smart home activities.
In case of problem with the integration, please open an issue on this repository explaining the issue and attaching the logs in debug mode.
To obtain logs, activate the component debug log in your
configuration.yaml
, and restarting Home Assistant:
logger:
default: warning
logs:
# maybe more stuff here[...]
hamsclient.client: debug
hamsclientfork.client: debug
custom_components.meteoswiss: debug
configuration.yaml
setup. I have not tested it, but you should know
that this is deprecated and it will raise a repairs issue to remind you
to delete the old YAML configuration.Data comes from the MeteoSwiss official data sources. Forecasts are extracted from the MeteoSwiss API. Current conditions are from official data files.
A primer on Swiss weather stations can be found at https://rudd-o.com/meteostations . Information on the provided values is available at https://data.geo.admin.ch/ch.meteoschweiz.messwerte-aktuell/info/VQHA80_en.txt.
This integration uses:
This was forked from https://github.com/websylv/homeassistant-meteoswiss because the original author is unresponsive and the original integration was broken beyond fixing. Use this in your Home Assistant by deleting the original integration, then adding this as a custom HACS repo, and then reinstalling the integration through this repository.