Giter Club home page Giter Club logo

nea_sg_weather's People

Contributors

acidpizza avatar kianhean avatar liangleslie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nea_sg_weather's Issues

Division by zero

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

Errors registering device

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:

  • home assistant running as a container in k3s
  • home assistant version: 2023.8.1
  • installation method: copied custom component to the config/ folder directly.

Expected behaviour:

  • There should be no errors on start up
  • There should be a registered device for the integration

Issue with city weather sensors not updating

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)
sensor

In the initial setup, I've set refresh frequency to be at 1 min - not sure if that's the problem.

Animated weather

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.

How to change refresh rate?

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?

Depreacted Constants

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

Also Deprecating all magic numbers for supported features

Timestamp error

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!

Latitude and Longitude for 2hr area forecasts stored as strings rather than floats

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

Detected integration that called async_setup_platforms instead of awaiting async_forward_entry_setups

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)

weather updates errors

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

Temperature & Humidity

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.