liangleslie / nea_sg_weather Goto Github PK
View Code? Open in Web Editor NEWHome Assistant integration for NEA Weather forecasts
License: MIT License
Home Assistant integration for NEA Weather forecasts
License: MIT License
The above error is shown in the integration panel. Of course, none of the sensors show any data.
Been getting this error on Home Assistant 2023.4.2 (Frontend 20230406.1)
Is anyone facing the same issue?
==== logs ====
Logger: homeassistant.config_entries
Source: config_entries.py:942
First occurred: 10:56:17 AM (1 occurrences)
Last logged: 10:56:17 AM
Config entry 'Singapore Weather' for nea_sg_weather integration not ready yet: Update failed: division by zero; Retrying in background
The NEA Singapore Weather integration shows many entities, but 0 devices. On starting up Home Assistant, there is a large number of errors (1 for each entity) on the container logs like the following.
2023-08-19 14:42:54.675 ERROR (MainThread) [homeassistant.components.sensor] Ignoring invalid device info: Invalid device info {'default_name': 'Weather forecast coordinator', 'identifiers': {('nea_sg_weather',)}, 'manufacturer': 'NEA Weather', 'model': 'data.gov.sg API Polling'} for 'nea_sg_weather' config entry: device info needs to either describe a device, link to existing device or provide extra information.
Deployment environment:
Expected behaviour:
Installed the integration and while the main weather card + maps work fine, the regional city sensors fail to update after a while.
I get this error in the logs:
Logger: custom_components.nea_sg_weather
Source: helpers/update_coordinator.py:350
integration: NEA Singapore Weather
First occurred: 7:36:21 AM (1 occurrences)
Last logged: 7:36:21 AM
Error fetching nea_sg_weather data: Update failed: Expecting value: line 1 column 1 (char 0)
In the initial setup, I've set refresh frequency to be at 1 min - not sure if that's the problem.
Hi there,
The intergration is no longer pulling in data from NEA. Could you have a look please? Thank you kindly.
Nice custom component! I just got it running and wondering what would be the easiest way to add animation to the weather map to show the direction the weather is moving.
Hi, I see the default refresh rate is 15 mins, would it be possible to set the refresh rate to every 5 mins instead? Is there a way to configure it in the UI?
The forecast
state attribute is deprecated and will be removed in Home Assistant Core 2024.3, you should instead use the weather.get_forecast
service.
(https://www.home-assistant.io/blog/2023/09/06/release-20239/#weather-forecast-service)
not an urgent issue for now :)
Warning from HA:
2024-02-20 08:46:18.115 WARNING (MainThread) [homeassistant.const] TIME_MINUTES was used from lta, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTime.MINUTES instead, please report it to the author of the 'lta' custom integration
2024-02-20 08:46:23.268 WARNING (MainThread) [homeassistant.const] TEMP_CELSIUS was used from nea_sg_weather, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTemperature.CELSIUS instead, please report it to the author of the 'nea_sg_weather' custom integration
2024-02-20 08:46:23.275 WARNING (MainThread) [homeassistant.const] LENGTH_MILLIMETERS was used from nea_sg_weather, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfLength.MILLIMETERS instead, please report it to the author of the 'nea_sg_weather' custom integration
2024-02-20 08:46:23.282 WARNING (MainThread) [homeassistant.const] PRESSURE_HPA was used from nea_sg_weather, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfPressure.HPA instead, please report it to the author of the 'nea_sg_weather' custom integration
2024-02-20 08:46:23.290 WARNING (MainThread) [homeassistant.const] SPEED_KNOTS was used from nea_sg_weather, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfSpeed.KNOTS instead, please report it to the author of the 'nea_sg_weather' custom integration
Few features that would be usfefull.
Hi,
I think these 2 APIs are down, not sure whether NEA deprecated them.
https://api.data.gov.sg/v1/environment/wind-direction
https://api.data.gov.sg/v1/environment/wind-speed
These “internal server error” causes the entire integration to fail, is it possible to ignore these responses?
Thanks
Hi, 1st of all, thanks for making this SG Weather integration. I am running on 1.1.3-fix and encountering this error:
2022-01-23 13:27:28 WARNING (MainThread) [custom_components.nea_sg_weather] Unable to parse region data from coordinator, this could be temporary
2022-01-23 13:28:54 ERROR (MainThread) [custom_components.nea_sg_weather] Timeout making GET request from https://www.nea.gov.sg/api/Weather4DayOutlook/GetData/1642886929
If you can, could you take a look at this? Thanks!
As per title, this is the error I get after activating the integration. Runs the config fine, but then this error shows.
As per title of issue - this prevents us from using distance() or closest() functions in HA to compute distance from the forecasting station. By adding a float() to lines 157 and 158 of nea.py I was able to convert them into numerical values, which seems to be more useful for templating. However, not sure if this is the most efficient way to do this =)
the rainfall sensor does not have this issue - the latitude and longitude seems to be reflected correctly as floats.
for consideration
Just saw this in the log. Thought i would report it.
2023-02-04 11:53:55.738 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that called async_setup_platforms instead of awaiting async_forward_entry_setups; this will fail in version 2023.3. Please report issue to the custom integration author for nea_sg_weather using this method at custom_components/nea_sg_weather/init.py, line 75: hass.config_entries.async_setup_platforms(config_entry, _platforms)
errors on the last vest version…l
2023-12-12 08:34:49.863 ERROR (MainThread) [homeassistant.components.weather] Error while setting up nea_sg_weather platform for weather
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 369, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 509, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 754, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1025, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 745, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 845, in _async_write_ha_state
state, attr = self._async_generate_attributes()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 788, in _async_generate_attributes
attr.update(self.state_attributes or {})
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/weather/__init__.py", line 658, in state_attributes
if (temperature := self.native_temperature) is not None:
^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/nea_sg_weather/weather.py", line 108, in native_temperature
return round(self.coordinator.data.temperature.temp_avg, 2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: type str doesn't define __round__ method
I am wondering if there is an issue with the API at the moment?
The two data has remained constant since midnight (14 Aug).
The rest seems to be working normally.
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.