bremor / bureau_of_meteorology Goto Github PK
View Code? Open in Web Editor NEWCustom component for retrieving weather information from the Bureau of Meteorology.
License: MIT License
Custom component for retrieving weather information from the Bureau of Meteorology.
License: MIT License
How do you set the location for the sensors? The Weathercard implies its automatically picked up by HA, but the sensor are not showing up after install and reboot. Sorry guys, im normally about to work this out.
The latest version (0.9) asks to configure a custom basename when setting up for both sensors and forecasts, but this doesn't seem to affect entity IDs or sensor names for the forecasts only, with them all created using the format 'sensor.suburb_min_temp_0' etc. I tried to have them created using the prefix BOM Suburb.
I removed the previous integration, updated, restarted, then set up again. But maybe something got left behind?
Setting a basename for sensors at a BOM station work perfectly.
Is there anyway we can see the date the forecast refers to rather than 0 - 7
Eg 29 Nov 2020 as a field.
I used old BOM to monitor wind records at North Head, Airport etc. Is it possible to get these back.
Hi there,
The text for the UV rating appears all in lower case with individual words concatenated. e.g 'Very High' appears as 'veryhigh'.
A small cosmetic problem but just seems out of place next to the Fire Danger rating which shows properly as Low-Moderate, for example.
Thanks.
I'm getting the following errors when Home Assistant starts up - I dont appear to get it at any other time
2021-01-02 09:22:37 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform bureau_of_meteorology
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 316, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 530, in add_to_platform_finish
await self.async_added_to_hass()
File "/config/custom_components/bureau_of_meteorology/sensor.py", line 101, in async_added_to_hass
self._update_callback()
File "/config/custom_components/bureau_of_meteorology/sensor.py", line 105, in _update_callback
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 296, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 323, in _async_write_ha_state
attr.update(self.device_state_attributes or {})
File "/config/custom_components/bureau_of_meteorology/sensor.py", line 180, in device_state_attributes
attr[ATTR_DATE] = self.collector.daily_forecasts_data["data"][self.day]["date"]
IndexError: list index out of range
2021-01-02 09:22:37 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up bureau_of_meteorology platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 207, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 316, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 530, in add_to_platform_finish
await self.async_added_to_hass()
File "/config/custom_components/bureau_of_meteorology/sensor.py", line 101, in async_added_to_hass
self._update_callback()
File "/config/custom_components/bureau_of_meteorology/sensor.py", line 105, in _update_callback
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 296, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 323, in _async_write_ha_state
attr.update(self.device_state_attributes or {})
File "/config/custom_components/bureau_of_meteorology/sensor.py", line 180, in device_state_attributes
attr[ATTR_DATE] = self.collector.daily_forecasts_data["data"][self.day]["date"]
IndexError: list index out of range
Hi,
Sorry if this doesn't belong here but I would like to understand how the fire danger sensors work as there is multiple sensors for the one area reading different fire danger rating.
pressure and delta_t are not available from the new API - they can only be retrieved from FTP.
Did you rename a bunch of sensors?
Noticed some errors in the log for sensor XXX_extended_text_4, see below. This causes the sensor not to update . See example of extended_text_3 and _4 showing different update times.
extended_text_3:
response_timestamp: 2020-12-03T04:47:18Z
issue_time: 2020-12-03T04:17:01Z
forecast_region: North East
forecast_type: public-district
attribution: Data provided by the Australian Bureau of Meteorology
friendly_name: Rutherglen Extended Text 3
extended_text_4:
response_timestamp: 2020-12-02T12:55:43Z
issue_time: 2020-12-02T10:33:48Z
forecast_region: North East
forecast_type: public-district
attribution: Data provided by the Australian Bureau of Meteorology
friendly_name: Rutherglen Extended Text 4
Log error:
Logger: homeassistant
Source: core.py:871
First occurred: 0:06:13 (1879 occurrences)
Last logged: 15:45:17
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _update_entity_states
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 283, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 408, in _async_write_ha_state
self.hass.states.async_set(
File "/usr/src/homeassistant/homeassistant/core.py", line 1185, in async_set
state = State(
File "/usr/src/homeassistant/homeassistant/core.py", line 871, in init
raise InvalidStateError(
homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity id: sensor.rutherglen_extended_text_4. State max length is 255 characters.
With the old BOM integration, I was using the current cloud cover (bom_weather Cloud).
I could not find cloud cover in this integration.
Is it possible to add?
Not sure if this is because I'm not searching the right thing or whatever but I can't seem to find this integration in HACS. Have searched BOM, bureau, meteorology, bremor etc but I can't find the integration anywhere.
It would be helpful to set an override basename for the sensors generated by the integration like some other integrations do (eg. when first configuring the integration - but also to allow renaming).
I share automations across multiple sites and it is helpful to use the same name at all sites (eg. "home", instead of suburb name). I think this would be useful for many others using automations.
(BTW - thanks for the integration - it took me a while to find it after I lost the bom integration in 0.117 - but this is looking like a really excellent replacement.)
Would it be possible to set the forecast suburb_rain_amount_max_0, etc, values to be 0 when they're absent (and hence no rain forecast)?
This seems to work for the min values, but the max ones go to 'unkown' which is misleading (and breaks some automations I'm trying to do on numeric_state).
Hey @bremor thanks for your work on this, it's great you've filled the void since hass removed the core component.
I have set it up and it appears to work, however it's telling me the last update was 16 hours ago? the weather/temp etc changes considerably over this period. Your readme says should update 10 minutely. There's not much configuration to this, am i missing something?
With the existing native integration removed in 0.117, it would be nice to merge this integration into Hass core so new users who are unfamiliar with HACS and custom components can use this component. In general, it would be nice to have a native Bureau of Meteorology integration in HASS. I am happy to assist with this process.
Thoughts?
Previously we had the actual rainfall data since 9am as 'rain today'. Can this be added as an entity with this new component?
How do you get the BOM Radar Camera?
Hi guys..
although everything seem to be working.. looking at the log files I can see this error popping up..
`Logger: homeassistant
Source: custom_components/bureau_of_meteorology/sensor.py:180
First occurred: January 4, 2021, 4:04:37 PM (146 occurrences)
Last logged: 11:14:44 AM
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 119, in _handle_refresh_interval
await self.async_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 193, in async_refresh
update_callback()
File "/config/custom_components/bureau_of_meteorology/sensor.py", line 105, in _update_callback
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 296, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 323, in _async_write_ha_state
attr.update(self.device_state_attributes or {})
File "/config/custom_components/bureau_of_meteorology/sensor.py", line 180, in device_state_attributes
attr[ATTR_DATE] = self.collector.daily_forecasts_data["data"][self.day]["date"]
IndexError: list index out of range`
It was working fine before.. .. I'm running
version: 2020.12.2
installation_type: Home Assistant OS
dev: false
hassio: true
docker: true
virtualenv: false
python_version: 3.8.6
os_name: Linux
os_version: 5.4.79-v7l
arch: armv7l
timezone: Australia/Sydney
host_os: Home Assistant OS 5.9
update_channel: stable
supervisor_version: 2020.12.7
docker_version: 19.03.13
Hi @Brenor,
It would great to have some sort of binary sensor for current weather warnings for example in Brisbane the bom product ID is IDQ21035 and the images on the ftp site are
IDQ21047.png
IDQ21041.png
Do you think that there is a way to be able to get this info into the custom component?
I have a simple script that looks for the file on the ftp server and use that to check for warnings but it may be more efficient to pull it all into one component. And it may be helpful to other users too, eg roll up the blinds before a storm.
I created Observation and Forecast sensors with a custom base name. However, I noticed that the weather
entity got created with the original location for forecast and not the custom base name.
Loving the new weather platform. I think the condition
mapping needs to be fixed up to allow the existing Lovelace weather cards to find the correct icon. Rather than, for example, Mostly sunny.
, I think the condition
should be sunny
.
From what I can tell, the mapping can be found in src/data/weather.ts
in the home assistant frontend.
export const weatherSVGs = new Set<string>([
"clear-night",
"cloudy",
"fog",
"lightning",
"lightning-rainy",
"partlycloudy",
"pouring",
"rainy",
"hail",
"snowy",
"snowy-rainy",
"sunny",
"windy",
"windy-variant",
]);
I think the same may also be true for the state
of the weather
entity.
Using the built in weather-forecast
card, I get:
You can see that the main icon is incorrect, and none of the forecast icons are showing.
forecast is missing day 6
Hi, I have just upgraded to your new integration and everything is working great. The issue I am haveing is that the closest observation station selected does not provide all necessary sensor information. Humidity
and Feels like Temperature
to name a couple. My next nearest station has all this information available. Is it possible to select another/multiple observation stations while keping my local location for forecast info ?
My current station is hillarys_point_boat_harbour
I would prefer to select Swanbourne
Thanks !
did this today and its now updating every 10 minutes fine.
However the state seems to be two states, not sure how this can be addressed, but I want to trigger automations to move shades when it sunny, and the states seem to be things like
Mostly sunny.
sunny
exceptional
Showers. Windy.
Partly cloudy.
Early shower. Sunny afternoon.
I would prefer it to be the default weather states if possible
‘clear-night’
‘cloudy’
‘fog’
‘hail’
‘lightning’
‘lightning-rainy’
‘partlycloudy’
‘pouring’
‘rainy’
‘snowy’
‘snowy-rainy’
‘sunny’
‘windy’
‘windy-variant’
‘exceptional’
and the BOM attributes are in a BOM specificat variable
Originally posted by @dave-schwarz in #52 (comment)
The sensor Gust Speed Knot shows as Gust Speed Know when completing the initial configuration setup
If this integration is installed when day 7 data is unavailable, it will never create sensors for the day 7 forecast.
Hi there
I installed this but have never been asked for lat and long. Should this happen before or after restart?
I've reinstalled a few times manually and via hacs. Logs are below
Is there a way I can manually trigger the request for lat and long and the creation of sensors?
Cheers
Duncan
2020-12-19 17:58:27 DEBUG (MainThread) [custom_components.hacs] <Integration bremor/bureau_of_meteorology> Getting repository information
2020-12-19 17:58:27 DEBUG (MainThread) [custom_components.hacs] <Integration bremor/bureau_of_meteorology> Running checks against 0.10
2020-12-19 17:58:28 DEBUG (MainThread) [custom_components.hacs] <Integration hacs/integration> Running checks against 1.9.0
2020-12-19 17:58:28 ERROR (MainThread) [custom_components.hacs] MatthewFlamm/nwsradar - Repository is archived.
2020-12-19 17:58:34 DEBUG (MainThread) [queueman.manager] Queue execution finished for 3 tasks finished in 7.34 seconds
2020-12-19 17:58:34 DEBUG (MainThread) [custom_components.hacs] Saving data
2020-12-19 17:58:34 DEBUG (MainThread) [queueman.manager] Checking out tasks to execute
2020-12-19 17:58:34 DEBUG (MainThread) [queueman.manager] Starting queue execution for 682 tasks
2020-12-19 17:58:34 DEBUG (MainThread) [queueman.manager] Queue execution finished for 682 tasks finished in 0.07 seconds
2020-12-19 17:58:34 DEBUG (MainThread) [custom_components.hacs] Recurring background task for installed repositories done
2020-12-19 17:58:34 DEBUG (MainThread) [custom_components.hacs] Nothing in the queue
2020-12-19 17:58:34 INFO (MainThread) [custom_components.hacs] Stage changed: HacsStage.RUNNING
I found that my local forecast would have 'null' for the short_text. This resulted in hass showing 'Unknown' in the weather forecast card.
#54 This is a short hack to generate the condition/state from the first part of the extended_text.
Example forecast: https://api.weather.bom.gov.au/v1/locations/qd6dv8/forecasts/daily
Hi,
First, thanks a lot for your work on this and for sharing it, this is awesome!
I like to use the custom lovelace card: custom:weather-card-chart which I ffind it much easier to read in terms of temperature and rain forecast. That card takes a weather type entity
So I was wondering if there is any technical reason why you did not go the weather platform way? Or would it be hard to implement as well? (I have never looked inside the weather platform before...)
With the old BOM integration, I was using the current cloud cover (bom_weather Cloud).
I could not find cloud cover in this integration.
Is it possible to add?
Hi, I'm having trouble setting up the integration.
At the Configuration -> Integration page, after I click on Bureau of Meteorology and it asks me to confirm my lat and long co-ordinates, I click submit and get an 'unknown error'. Log below.
Logger: custom_components.bureau_of_meteorology.config_flow
Source: custom_components/bureau_of_meteorology/PyBoM/collector.py:32
Integration: Bureau of Meteorology (documentation, issues)
First occurred: 10:41:54 PM (4 occurrences)
Last logged: 10:43:19 PM
Unexpected exception
Traceback (most recent call last):
File "/opt/Home-Assistant/lib/python3.8/site-packages/aiohttp/connector.py", line 936, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore # noqa
File "/opt/Home-Assistant/lib/python3.8/asyncio/base_events.py", line 1021, in create_connection
raise exceptions[0]
File "/opt/Home-Assistant/lib/python3.8/asyncio/base_events.py", line 1006, in create_connection
sock = await self._connect_sock(
File "/opt/Home-Assistant/lib/python3.8/asyncio/base_events.py", line 920, in _connect_sock
await self.sock_connect(sock, address)
File "/opt/Home-Assistant/lib/python3.8/asyncio/selector_events.py", line 494, in sock_connect
return await fut
File "/opt/Home-Assistant/lib/python3.8/asyncio/selector_events.py", line 499, in _sock_connect
sock.connect(address)
OSError: [Errno 99] Cannot assign requested address
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/bureau_of_meteorology/config_flow.py", line 35, in async_step_user
await collector.get_location_name()
File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/bureau_of_meteorology/PyBoM/collector.py", line 32, in get_location_name
response = await session.get(url)
File "/opt/Home-Assistant/lib/python3.8/site-packages/aiohttp/client.py", line 480, in _request
conn = await self._connector.connect(
File "/opt/Home-Assistant/lib/python3.8/site-packages/aiohttp/connector.py", line 523, in connect
proto = await self._create_connection(req, traces, timeout)
File "/opt/Home-Assistant/lib/python3.8/site-packages/aiohttp/connector.py", line 858, in _create_connection
_, proto = await self._create_direct_connection(
File "/opt/Home-Assistant/lib/python3.8/site-packages/aiohttp/connector.py", line 1004, in _create_direct_connection
raise last_exc
File "/opt/Home-Assistant/lib/python3.8/site-packages/aiohttp/connector.py", line 980, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File "/opt/Home-Assistant/lib/python3.8/site-packages/aiohttp/connector.py", line 943, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host api.weather.bom.gov.au:443 ssl:default [Cannot assign requested address]
The previous integration included a radar camera
component, that you could add to Lovelace. Any chance of including that in this platform (or creating a separate one)?
I am getting message in notifications:
Invalid config
The following integrations and platforms could not be set up:
bureau_of_meteorology.sensor
bureau_of_meteorology.weather
Please check your config.
removed the component already few time and restarted HA but no change.
Hassio - 0.117.6 running on Rasberry Pi 3B+
Bureau of Meteorology custom component 0.8.1 installed via HACS
Getting the following error:
2020-11-14 16:37:54 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 616, in _update_entity_states
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 283, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 320, in _async_write_ha_state
sstate = self.state
File "/config/custom_components/bureau_of_meteorology/sensor.py", line 155, in state
state = self.collector.daily_forecasts_data["data"][self.day][self.sensor_name]
IndexError: list index out of range
Previously we had the actual rainfall data since 9am as 'rain today'. Can this be added as an entity with this new component?
Is barometric pressure available in the data you're getting at all. I know some locations don't have it under the old integration, but I'm in Mount Gambier and it shows under the old integration, but not on this one.
I looked at the page you directed someone else to (for the cloud cover query) and don't see pressure there, for Mount Gambier or any of the major cities, so I'm guessing it's not going to be there. Seems like an odd thing for them to omit from a weather page.
Hi, can you please include a sensor for atmospheric pressure. Thanks!
Hi bremor - I'm totally wrapt that you put this together so quickly. It works very nicely. Just one request for me: the original core bom integration included weather icon sensors that mapped to MDI icons. This made it very easy to display the correct icon for the day. But your integration uses something else. Is it possible to use the MDI icon format in the icon sensors?
HA 2020.12.2 - BOM integration installed via HACS.
Weather Forecast card configured in Lovelace frontend. Weather stats update after HA restart and then no updates, unless integration is reloaded.
Ok I installed via HACS as per the instructions, now what? Where do I enter the required information (latitude/longitude)? Where in lovelace does this integration show?
Hi. Title pretty well says all. I have a fresh install supervised Home Assistant 0.118.3 on Ubuntu 20.04 server. Unable to find your integration. About 6 months ago I had it and was impressed.
Also a suggestion that all would benefit from is the animation of the last 24 hours of the half hourly satellite image. No need for localisation information as it is Australia wide.
Hey!
Updated the integration this evening and since the update I have stopped seeing info come through, I did attempt to re-install and the same error occurs, no updates were flowing through for any of the existing sensors, I have provided the error from the log hopefully that can be of some help! I guess to note also that it does list Ingleburn below but it was providing data for both the suburb and the closest weather station (Holsworthy) and they have both flicked to "unavailable"
`Logger: homeassistant.config_entries
Source: custom_components/bureau_of_meteorology/PyBoM/collector.py:115
First occurred: 1:57:30 AM (1 occurrences)
Last logged: 1:57:30 AM
Error setting up entry Ingleburn for bureau_of_meteorology
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 234, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/bureau_of_meteorology/init.py", line 28, in async_setup_entry
await collector.get_daily_forecasts_data()
File "/config/custom_components/bureau_of_meteorology/PyBoM/collector.py", line 107, in get_daily_forecasts_data
await self.flatten_forecast_data()
File "/config/custom_components/bureau_of_meteorology/PyBoM/collector.py", line 115, in flatten_forecast_data
flattened["mdi_icon"] = MDI_ICON_MAP[icon]
KeyError: None`
My BOM stopped working after the last update, how do I reverse this last update?
I have two observation stations at a similar distance, but the one slightly further away generally matches the conditions at my house more closely. When I add the integration to get the forecast for my location it also adds that observations for the station that I don't want. Then when I add the integration with coordinates to get the observations I want I also get the forecast for that location (which I definitely don't want). This means I end up with 130 sensors which are of no use to me.
It would be good if when configuring the integration that you could select if you want observations, forecast or both (default both would be sensible) to avoid having lots of sensors being created.
this value have not been set .. (null)
come thru as NaN in the bom-weather-card
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.