mawinkler / astroweather Goto Github PK
View Code? Open in Web Editor NEWAsynchronous Astro Weather Forecast for Home Assistant
License: GNU General Public License v3.0
Asynchronous Astro Weather Forecast for Home Assistant
License: GNU General Public License v3.0
This custom integration uses deprecated DEVICE_CLASS_*
constants in its codebase.
The DEVICE_CLASS_*
constants have been deprecated and replaced in Home Assistant Core 2021.12 (over a year ago). I would highly suggest updating/migrating this integration to the new enums.
For example, for the device classes supported by the sensor
platform, there is now a SensorDeviceClass
enum. So if a sensor previously used the DEVICE_CLASS_ENERGY
constant, it should now use SensorDeviceClass.ENERGY
. Other platforms (like binary_sensor
, and number
) provide similar enumerations for their supported device classes.
The migration thus only consists of replacing constants with an enumeration member and is, therefore, very low impact and should be fairly straightforward.
If I can help resolve any questions regarding this change or migration, feel free to ask or respond to this issue. I'm happy to help!
Kindest regards,
../Frenck
in HA 2024.2 I got this error message:
Error requesting data: 403, message='Forbidden', url=URL('https://api.met.no/weatherapi/locationforecast/2.0/complete?lon=19.3&lat=47.6&altitude=104')
the url is invalid, contains "amp;" two times.
I have never seen binary_sensor.astroweather_deep_sky_view
turn on despite some very good seeing conditions. What are the requirements for this binary sensor to turn on?
Integracja przestała działać.
I've been noticing that on my dashboard that the Moonrise and Moonset projection shows as in the past and doesn't update unless I reboot Home Assistant.
The current values from HA in the developer tools:
sensor.astroweather_moon_next_risingAstroweather Moon Next Rising | 2023-12-11T11:05:00+00:00
sensor.astroweather_moon_next_settingAstroweather Moon Next Setting | 2023-12-10T19:47:53+00:00
The date of this post is 12/13/2023 @ 1515 EST.
Running v0.20.9. sensor.astroweather_sun_next_rising_astronomical and sensor.astroweather_sun_next_setting_astronomical hangs when loading integration.
Logger: homeassistant.components.sensor
Source: custom_components/astroweather/sensor.py:322
Integration: Sensor ([documentation](https://www.home-assistant.io/integrations/sensor), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sensor%22))
First occurred: 01:12:27 (2 occurrences)
Last logged: 01:12:27
Error adding entities for domain sensor with platform astroweather
Error while setting up astroweather platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 614, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 799, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 532, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 570, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 538, in _stringify_state
if (state := self.state) is None:
File "/config/custom_components/astroweather/sensor.py", line 322, in state
return getattr(self.coordinator.data[SENSOR_NAME], self._sensor, None)
File "/usr/local/lib/python3.9/site-packages/pyastroweatherio/dataclasses.py", line 244, in sun_next_setting_astro
return self._sun_next_setting_astro.replace(microsecond=0).isoformat()
TypeError: str.replace() takes no keyword arguments
I think this is related to my location as i live in Finland and sun elevation is getting smaller towards summer.
All other sensor are working fine.
state sun.sun=below_horizon;
next_dawn=2022-05-04T01:11:36.498974+00:00,
next_dusk=2022-05-04T19:25:15.377582+00:00,
next_midnight=2022-05-04T22:17:06+00:00,
next_noon=2022-05-04T10:17:13+00:00,
next_rising=2022-05-04T02:08:10.195656+00:00,
next_setting=2022-05-04T18:27:55.950615+00:00,
elevation=-13.62, azimuth=7.91, rising=True,
friendly_name=Sun @ 2022-05-04T01:12:25.001091+03:00
Hej,
I wanted to set-up an alarm if the moon rises, to be prepared that the werewolfs are out, but noticed that:
The time in the sensor.astroweather_moon_next_rising gets its next day update 2h before the todays time of moon rising is reached. So today in the moring it was saying moonrise is 2022-02-11 11:52 and this switched to 2022-02-12 12:38 at about 10:00.
The timezone is correct, the moon really rises at 11:52 today.
Is there a way for the sensor to wait until the time of the next rising is really reached, before updating it to the next days rising time?
kind regards
Beorn
After updating to core-2022.7.0b0 the following warning is present:
Logger: homeassistant.components.weather
Source: components/weather/__init__.py:308
Integration: Weather (documentation, issues)
First occurred: 19:16:37 (2 occurrences)
Last logged: 19:16:40
custom_components.astroweather.weather::AstroWeatherWeather is overriding deprecated methods on an instance of WeatherEntity, this is not valid and will be unsupported from Home Assistant 2023.1. Please report it to the custom component author.
Possibly related to this developer blog entry:
https://developers.home-assistant.io/blog/2022/06/27/weather_entity_refactoring/
Logger: homeassistant.const
Source: helpers/deprecation.py:204
First occurred: 13:51:47 (12 occurrences)
Last logged: 13:51:50
TEMP_CELSIUS was used from astroweather, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTemperature.CELSIUS instead, please create a bug report at https://github.com/mawinkler/astroweather/issues
https://developers.home-assistant.io/blog/2023/12/19/constant-deprecation/
Same problem than in March #28, deleted both integration and card and reinstalled both, but the weather entity is not provided by the integration. Worked fine before. 46 entities are being provided, one binary sensor and 45 sensors, but no weather entity.
While all weather forcast data seem to be correct for my geolocation, the times for sunrise and sunset aren't.
The astroweather intergration says for today for sunrise 04:26 and sunset 20:18, but it should be (around Berlin for sunrise 06:19 and 18:11for sunset )
Would it be possible to add a sensor for the Next Full Moon please?
Looks like this might be a typo: "tsday" should be "today"? Error resolves by going back a few versions.
Logger: homeassistant.components.weather
Source: custom_components/astroweather/weather.py:225
Integration: Weather (documentation, issues)
First occurred: 6:55:09 PM (2 occurrences)
Last logged: 6:55:10 PM
Error adding entities for domain weather with platform astroweather
Error while setting up astroweather platform for weather
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 810, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 533, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 574, in _async_write_ha_state
attr.update(self.extra_state_attributes or {})
File "/config/custom_components/astroweather/weather.py", line 355, in extra_state_attributes
ATTR_WEATHER_DEEPSKY_TODAY_DESC: self.deepsky_forecast_today_desc,
File "/config/custom_components/astroweather/weather.py", line 225, in deepsky_forecast_today_desc
return self._current.deepsky_forecast_today_desc
File "/usr/local/lib/python3.9/site-packages/pyastroweatherio/dataclasses.py", line 333, in deepsky_forecast_today_desc
return MAP_WEATHER_TYPE[nightly_conditions.weather]
KeyError: 'tsday'
I installed through HACS and the readme says the following:
_To add AstroWeather to your installation, go to the Integration page inside the configuration panel and AstroWeather.
During installation you will have the option to:
This does not happen so now I'm wondering where the integration page is. I'm running HAOS 2024.1.0
I've tried to add AstroWeather to my new HomeAssistant.
In readme:
HACS installation
This Integration is part of the default HACS store, so go to the HACS page and search for AstroWeather within the integrations.
Neither within the integrations nor plug-ins, AstroWeather appears.
HomeAssistant OS 9.3
Hello!
Great work on the HA integration! I'm excited to roll it into my own setup. One thing I'm noticing, though, is it looks like time for sun/moon rise/set and 3-hourly forecast don't adjust for the time zone of the HA installation. I'm in Pacific time (UTC-7 in the summer, UTC-8 in the winter).
Here's what my current card looks like at 12:21 AM local time, 6/9:
As you can see, something wonky is going on with the rise/set times.
Please let me know if there's anything else I can provide, or do to help with troubleshooting!
EDIT: Nevermind, immediately after posting this, an update showed up in HACS that fixed everything. Thanks!
The integration has been working great for a long time. However, recently the weather.astroweather_xxxx has become unavailable. I have tried reloading the integration, deleting it and reinstalling it. However, HA states that the entity is no longer provided by the integration.
I enabled debug logging, and see the following in the logs:
Error adding entities for domain weather with platform astroweather
Error while setting up astroweather platform for weather
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 717, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 807, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 559, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 602, in _async_write_ha_state
attr.update(self.state_attributes or {})
File "/usr/src/homeassistant/homeassistant/components/weather/__init__.py", line 673, in state_attributes
if (wind_speed := self.native_wind_speed) is not None:
File "/config/custom_components/astroweather/weather.py", line 268, in native_wind_speed
return self._current.wind10m_speed
File "/usr/local/lib/python3.10/site-packages/pyastroweatherio/dataclasses.py", line 106, in wind10m_speed
return float(WIND10M_SPEED[self._wind10m.get("speed", 0)])
IndexError: list index out of range
I have observed that even if the sensors are updated from MET Norway, the attribution still says Powered by 7Timer.
As per the release notes, it says "If enabled in the configuration the Met.no cloud forecast overrides the 7Timer cloud forecast."
It will be good to have the attribution reflect the correct source for the entity.
After having installed the repo via HACS, when I go to Settings > Devices & Services and I try to Astroweather as new integration, it simply freezes on the loading of the integration:
I could not find any related logs under System to see what may be happening.
On DevTools, I see a "flow" fetch request that is not being resolved, initiated on fetch-with-auth.ts:20
.
Do please let me know if I can provide any further context or if this is not a bug, as I am soooo eager to get this working on my setup!
Thanks!
Hi,
was looking forward to the HACS on my HA on Docker. However after installing it on HACS ( and restarting) i cannot see the configuration panel in the integration list.
Any ideas of where it may have gone?
thx
Thank you for amazing component and card!
After last update the weather sensor state is "▄" and same markings can be found on attributes deepsky_forecast_today_plain and tommorow.
Also deepsky_forecast_tomorrow_dayname is same as today.
- datetime: '2023-10-12T00:00:00+00:00' precipitation: null precipitation_probability: null cloudcover_percentage: 37 cloudless_percentage: 62 cloud_area_fraction: 48.9 cloud_area_fraction_high: 0 cloud_area_fraction_medium: 0 cloud_area_fraction_low: 48.9 fog_area_fraction: 0 seeing_percentage: 28 transparency_percentage: 71 lifted_index: 2 condition: 52 precipitation_amount: 0 wind_speed: 1.44 wind_bearing: SW temperature: 9.1 humidity: 77 attribution: Powered by 7Timer and Met.no timestamp: '2023-10-10T00:00:00+00:00' cloudcover_percentage: 0 cloudless_percentage: 100 cloud_area_fraction: 0.8 cloud_area_fraction_high: 0 cloud_area_fraction_medium: 0 cloud_area_fraction_low: 0.7 fog_area_fraction: 0 seeing_percentage: 14 transparency_percentage: 71 lifted_index: 6 condition_percentage: 75 condition_plain: Good precipitation_amount: 0 deepsky_forecast_today_dayname: Tuesday deepsky_forecast_today_plain: ▆▆▄ deepsky_forecast_today_desc: Partlycloudy night deepsky_forecast_tomorrow_dayname: Tuesday deepsky_forecast_tomorrow_plain: ▂▂▂▂▁▁▁▁▁▁ deepsky_forecast_tomorrow_desc: Cloudy sun_next_rising: '2023-10-10T07:04:47.742935+03:00' sun_next_setting: '2023-10-10T19:08:48.190722+03:00' sun_next_rising_nautical: '2023-10-10T06:16:18.112708+03:00' sun_next_setting_nautical: '2023-10-10T19:57:06.229637+03:00' sun_next_rising_astro: '2023-10-10T05:26:28.296063+03:00' sun_next_setting_astro: '2023-10-10T20:46:38.625751+03:00' moon_next_rising: '2023-10-11T03:13:13.346802+03:00' moon_next_setting: '2023-10-10T18:07:14.456405+03:00' moon_phase: 19.7 moon_next_new_moon: '2023-10-14T20:55:06.524308+03:00' icon: mdi:weather-night friendly_name: Astroweather supported_features: 2
Same behavior for individual sensors:
sensor.astroweather_deepsky_forecast_today_plain
sensor.astroweather_deepsky_forecast_tomorrow_plain
sensor.astroweather_deepsky_forecast_tomorrow gives little too optimistic values as I'v got high as 212% :).
sensor.astroweather_deepsky_forecast_today seems to be correct.
Errors from Home assistant log:
2023-10-08 04:28:51.574 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 882, in _update_entity_states await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 750, in async_update_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 879, in _async_write_ha_state state, attr = self._async_generate_attributes() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 820, in _async_generate_attributes state = self._stringify_state(available) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 785, in _stringify_state if (state := self.state) is None: ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 475, in state value = self.native_value ^^^^^^^^^^^^^^^^^ File "/config/custom_components/astroweather/sensor.py", line 423, in native_value return getattr(self.coordinator.data[SENSOR_NAME], self._sensor, None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyastroweatherio/dataclasses.py", line 408, in deepsky_forecast_tomorrow for nightly_condition in self._deepsky_forecast[1].nightly_conditions: ~~~~~~~~~~~~~~~~~~~~~~^^^ IndexError: list index out of range 2023-10-08 04:28:51.607 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 874, in _update_entity_states await entity.async_update_ha_state(True) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 750, in async_update_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 879, in _async_write_ha_state state, attr = self._async_generate_attributes() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 823, in _async_generate_attributes attr.update(self.extra_state_attributes or {}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/astroweather/weather.py", line 423, in extra_state_attributes ATTR_WEATHER_DEEPSKY_TOMORROW_PLAIN: self.deepsky_forecast_tomorrow_plain, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/astroweather/weather.py", line 287, in deepsky_forecast_tomorrow_plain return self._current.deepsky_forecast_tomorrow_plain ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyastroweatherio/dataclasses.py", line 429, in deepsky_forecast_tomorrow_plain for nightly_condition in self._deepsky_forecast[1].nightly_conditions: ~~~~~~~~~~~~~~~~~~~~~~^^^ IndexError: list index out of range
The next moon rise/set calculations don't seem to be correct--at least not for Anchorage, Alaska. I've confirmed the long/lat and have uninistalled and reinstalled the integration, but the calculations don't jive with those shown at online resources.
There seems to be a problem on the 7timer side accessing the API endpoints of NOAA. It is currently under investigation.
I do not have any information on when this will be fixed, but hopefully soon.
Logger: homeassistant.components.sensor
Source: components/sensor/init.py:608
Integration: Sensor (documentation, issues)
First occurred: 23:07:31 (1 occurrences)
Last logged: 23:07:31
Sensor sensor.astroweather_transparency_plain has device class None, state class None and unit mag thus indicating it has a numeric value; however, it has the non-numeric value: 0.5-0.6 (<class 'str'>); Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.
The value of wind speed does not change. It looks like the value isn't changing no matter if I choose km/h, mp/h or m/s. I compared with the met.no integration and it looks like astroweather only shows the unit in km/h.
Sensor value is e.g. Good-Excellent-Good.What does first, second and third value mean? Is this for different times during the night? Does this mean seeing, athmospheric transparency and clouds? Would be nice to have it in the documentation and if the sensor would have a more meaningful name / description.
Hello.
Running Home Assistant in a VM on unraid - through a lot of trial and error I figured out how to run uptonight put the files in the /root/homeassistant/www folder in my VM.
during the config, I mapped the uptonight path to that folder. I verified that the .json and plot files are there wit the terminal.
here is the debug log but it does not have much:
2023-11-21 00:29:57.746 DEBUG (MainThread) [custom_components.astroweather] Starting up
2023-11-21 00:29:57.746 DEBUG (MainThread) [custom_components.astroweather] Options latitude 41.5824944
2023-11-21 00:29:57.746 DEBUG (MainThread) [custom_components.astroweather] Options longitude -81.2034066
2023-11-21 00:29:57.746 DEBUG (MainThread) [custom_components.astroweather] Options elevation 300
2023-11-21 00:29:57.746 DEBUG (MainThread) [custom_components.astroweather] Options timezone America/New_York
2023-11-21 00:29:57.746 DEBUG (MainThread) [custom_components.astroweather] Update interval 5
2023-11-21 00:29:57.746 DEBUG (MainThread) [custom_components.astroweather] Options cloudcover_weight 3
2023-11-21 00:29:57.746 DEBUG (MainThread) [custom_components.astroweather] Options seeing_weight 2
2023-11-21 00:29:57.746 DEBUG (MainThread) [custom_components.astroweather] Options transparency_weight 1
2023-11-21 00:29:57.746 DEBUG (MainThread) [custom_components.astroweather] Uptonight path /root/homeassistant/www/
2023-11-21 00:29:57.746 DEBUG (MainThread) [custom_components.astroweather] Connected to AstroWeather platform
2023-11-21 00:29:58.459 DEBUG (MainThread) [custom_components.astroweather] Finished fetching astroweather data in 0.713 seconds (success: True)
2023-11-21 00:29:58.459 DEBUG (MainThread) [custom_components.astroweather] Data update coordinator created (update interval: 5)
2023-11-21 00:29:58.460 DEBUG (MainThread) [custom_components.astroweather] Finished fetching astroweather data in 0.001 seconds (success: True)
2023-11-21 00:29:58.460 DEBUG (MainThread) [custom_components.astroweather] Forecast update coordinator created (update interval: 5)
2023-11-21 00:29:58.460 DEBUG (MainThread) [custom_components.astroweather] Forecast updated
2023-11-21 00:29:58.464 INFO (MainThread) [custom_components.astroweather.binary_sensor] Set up AstroWeather binary sensor platform
2023-11-21 00:29:58.464 INFO (MainThread) [custom_components.astroweather.sensor] Set up AstroWeather sensor platform
2023-11-21 00:29:58.464 INFO (MainThread) [custom_components.astroweather.weather] Set up AstroWeather weather platform
Here is the path in my VM to the files
Here is what the uptonight sensor states - unknown
When i try to use th emarkdown card, it is empty, i would assume b/c the sensor is empty.
if it matters, I am running UpTonight in a docker container, I have the /www folder mapped using SMB and my docker is pushing the files to that folder. I'm sure it is irrelevant since the files are clearly in the folder,
Installed via HACS, all entities OK except weather.astro...
Log shows:
`Logger: homeassistant.components.weather
Source: components/weather/init.py:131
Integration: Weather (documentation, issues)
First occurred: 19:36:30 (4 occurrences)
Last logged: 19:36:51
Error adding entities for domain weather with platform astroweather
Error while setting up astroweather platform for weather
Traceback (most recent call last):
File "/home/pi/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/home/pi/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity_platform.py", line 613, in _async_add_entity
await entity.add_to_platform_finish()
File "/home/pi/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 748, in add_to_platform_finish
self.async_write_ha_state()
File "/home/pi/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 505, in async_write_ha_state
self._async_write_ha_state()
File "/home/pi/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 540, in _async_write_ha_state
attr.update(self.state_attributes or {})
File "/home/pi/homeassistant/lib/python3.8/site-packages/homeassistant/components/weather/init.py", line 209, in state_attributes
if self.temperature is not None:
File "/home/pi/homeassistant/lib/python3.8/site-packages/homeassistant/components/weather/init.py", line 131, in temperature
return self._attr_temperature
AttributeError: 'AstroWeatherWeather' object has no attribute '_attr_temperature'`
Maybe it is needed to wait 3 hrs and try to reload integration?
Best, JR
Hi guys.
I would like to ask you how to change the date display from US to EU standard?
Thanks.
Hello,
My image was not always updating, I did a little googling, and other template examples I saw had quotes around the time frame like shown below - I am not sure either way as I am not a HA expert, but, when i did this, my image started reliably updating, rather than only when i reloaded HA.
template:
- trigger:
- platform: time_pattern
# This will update every ten minutes
minutes: "/10"
- image:
- name: UpTonight
url: http://192.168.1.16:8123/local/uptonight-plot.png
After upgrading to v0.42.0, the following entities are not getting set up -
sensor.astroweather_deepsky_forecast_tomorrow
sensor.astroweather_deepsky_forecast_tomorrow_plain
weather.astroweather_home
This is what I can see in the logs.
Error adding entities for domain weather with platform astroweather
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 743, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 843, in _async_write_ha_state
state, attr = self._async_generate_attributes()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 787, in _async_generate_attributes
attr.update(self.extra_state_attributes or {})
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/astroweather/weather.py", line 446, in extra_state_attributes
ATTR_WEATHER_DEEPSKY_TOMORROW_PLAIN: self.deepsky_forecast_tomorrow_plain,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/astroweather/weather.py", line 295, in deepsky_forecast_tomorrow_plain
return self._current.deepsky_forecast_tomorrow_plain
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyastroweatherio/dataclasses.py", line 463, in deepsky_forecast_tomorrow_plain
for nightly_condition in self._deepsky_forecast[1].nightly_conditions:
~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
Error adding entities for domain sensor with platform astroweather
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 743, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 843, in _async_write_ha_state
state, attr = self._async_generate_attributes()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 784, in _async_generate_attributes
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 749, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 501, in state
value = self.native_value
^^^^^^^^^^^^^^^^^
File "/config/custom_components/astroweather/sensor.py", line 449, in native_value
return getattr(self.coordinator.data[SENSOR_NAME], self._sensor, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyastroweatherio/dataclasses.py", line 447, in deepsky_forecast_tomorrow
for nightly_condition in self._deepsky_forecast[1].nightly_conditions:
~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
My logs complain:
2024-01-05 18:19:08.240 WARNING (MainThread) [homeassistant.const] TEMP_CELSIUS was used from astroweather, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTemperature.CELSIUS instead, please create a bug report at https://github.com/mawinkler/astroweather/issues
maybe more info here: https://developers.home-assistant.io/blog/2023/12/19/constant-deprecation
2022-01-08 09:13:24 ERROR (MainThread) [homeassistant.components.binary_sensor] Error adding entities for domain binary_sensor with platform astroweather IndexError: list index out of range 2022-01-08 09:13:24 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform astroweather IndexError: list index out of range 2022-01-08 09:13:24 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up astroweather platform for binary_sensor IndexError: list index out of range 2022-01-08 09:13:24 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up astroweather platform for sensor IndexError: list index out of range 2022-01-08 09:13:44 ERROR (MainThread) [homeassistant.components.binary_sensor] Error adding entities for domain binary_sensor with platform astroweather IndexError: list index out of range 2022-01-08 09:13:44 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform astroweather IndexError: list index out of range 2022-01-08 09:13:44 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up astroweather platform for binary_sensor IndexError: list index out of range 2022-01-08 09:13:44 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up astroweather platform for sensor IndexError: list index out of range
Restart HA does not fix the Issue
Running v0.20.7 in Home AssistantOS I am now getting this error and no forecasts (was working):
Logger: homeassistant.components.weather
Source: custom_components/astroweather/weather.py:200
Integration: Weather (documentation, issues)
First occurred: 23:26:57 (2 occurrences)
Last logged: 23:26:57
Error adding entities for domain weather with platform astroweather
Error while setting up astroweather platform for weather
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 614, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 801, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 553, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 593, in _async_write_ha_state
extra_state_attributes = self.extra_state_attributes
File "/config/custom_components/astroweather/weather.py", line 327, in extra_state_attributes
ATTR_WEATHER_DEEPSKY_TODAY_PLAIN: self.deepsky_forecast_today_plain,
File "/config/custom_components/astroweather/weather.py", line 200, in deepsky_forecast_today_plain
return self._current.deepsky_forecast_today_plain
File "/usr/local/lib/python3.9/site-packages/pyastroweatherio/dataclasses.py", line 285, in deepsky_forecast_today_plain
nightly_conditions = self._deepsky_forecast[0]
IndexError: list index out of range
Do these entities not have device_class: temperature
?
Hi,
please add the possibility to give different locations a name, e.g. city name.
And make that names part of the entity to make it possible to search / filter for it.
Like:
sensor.astroweather_MyLocationName_SensorName
Thanks a lot!
Hi Markus,
just another idea.
Please have look at:
https://fhem.de/commandref_DE.html#Twilight
https://fhem.de/commandref.html#Twilight
There is in addition to the common values of astronomical and nautical as well:
Regards,
Markus
Sorry, mistake, please delete this.
I was so impressed with your Astrolabe that I built an HA installation to use them but I can't find it in the Add-on store. Can you point me in th right direction?
Kurt
Recently in one or two days I started getting this error for the following entities:
sensor.astroweather_10m_wind_speed
sensor.astroweather_10m_wind_speed_plain
weather.astroweather_38_731_9_1373
Because of this my custom:astroweather-card stopeed working and it only show this:
this is the code I'm using on the card itself:
type: custom:vertical-stack-in-card
title: Weather
cards:
- type: custom:astroweather-card
entity: weather.forecast_home
number_of_forecasts: '5'
details: false
deepskydetails: false
forecast: false
graph: false
Tried installing the update today and it blew up during startup:
2022-07-10 08:38:32 ERROR (SyncWorker_4) [homeassistant.util.package] Unable to install package pyastroweatherio==0.22.0: error: subprocess-exited-with-error
× Building wheel for h3 (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [9 lines of output]
File "/tmp/pip-build-env-5al1vlj1/overlay/lib/python3.10/site-packages/skbuild/setuptools_wrap.py", line 613, in setup
cmkr = cmaker.CMaker(cmake_executable)
File "/tmp/pip-build-env-5al1vlj1/overlay/lib/python3.10/site-packages/skbuild/cmaker.py", line 141, in __init__
self.cmake_version = get_cmake_version(self.cmake_executable)
File "/tmp/pip-build-env-5al1vlj1/overlay/lib/python3.10/site-packages/skbuild/cmaker.py", line 95, in get_cmake_version
raise SKBuildError(
Traceback (most recent call last):
Problem with the CMake installation, aborting build. CMake executable is cmake
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for h3
ERROR: Could not build wheels for h3, which is required to install pyproject.toml-based projects
2022-07-10 08:39:47 ERROR (SyncWorker_4) [homeassistant.util.package] Unable to install package pyastroweatherio==0.22.0: error: subprocess-exited-with-error
× Building wheel for h3 (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [9 lines of output]
File "/tmp/pip-build-env-o039bfh3/overlay/lib/python3.10/site-packages/skbuild/setuptools_wrap.py", line 613, in setup
cmkr = cmaker.CMaker(cmake_executable)
File "/tmp/pip-build-env-o039bfh3/overlay/lib/python3.10/site-packages/skbuild/cmaker.py", line 141, in __init__
self.cmake_version = get_cmake_version(self.cmake_executable)
File "/tmp/pip-build-env-o039bfh3/overlay/lib/python3.10/site-packages/skbuild/cmaker.py", line 95, in get_cmake_version
raise SKBuildError(
Traceback (most recent call last):
Problem with the CMake installation, aborting build. CMake executable is cmake
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for h3
ERROR: Could not build wheels for h3, which is required to install pyproject.toml-based projects
2022-07-10 08:40:59 ERROR (SyncWorker_4) [homeassistant.util.package] Unable to install package pyastroweatherio==0.22.0: error: subprocess-exited-with-error
× Building wheel for h3 (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [9 lines of output]
File "/tmp/pip-build-env-9cepydg_/overlay/lib/python3.10/site-packages/skbuild/setuptools_wrap.py", line 613, in setup
cmkr = cmaker.CMaker(cmake_executable)
File "/tmp/pip-build-env-9cepydg_/overlay/lib/python3.10/site-packages/skbuild/cmaker.py", line 141, in __init__
self.cmake_version = get_cmake_version(self.cmake_executable)
File "/tmp/pip-build-env-9cepydg_/overlay/lib/python3.10/site-packages/skbuild/cmaker.py", line 95, in get_cmake_version
raise SKBuildError(
Traceback (most recent call last):
Problem with the CMake installation, aborting build. CMake executable is cmake
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for h3
ERROR: Could not build wheels for h3, which is required to install pyproject.toml-based projects
2022-07-10 08:40:59 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration astroweather: Requirements for astroweather not found: ['pyastroweatherio==0.22.0'].
Rolled back to 0.21.0 and everything worked fine.
Hi,
After installing and rebooting I can't find it in the integrations
After upgrading of HA to
Home Assistant 2023.9.0
Supervisor 2023.08.3
Operating System 10.5
Frontend 20230906.1 - latest
the following waring pop's up:
The integration astroweather is using the deprecated forecast attribute.
Please check:
https://www.home-assistant.io/blog/2023/09/06/release-20239/#weather-forecast-service
⚠ This stops working in version 2024.3.0. Please address before upgrading.
The custom integration astroweather implements the forecast property or sets self._attr_forecast in a subclass of WeatherEntity.
Please create a bug report at https://github.com/mawinkler/astroweather/issues.
Once an updated version of astroweather is available, install it and restart Home Assistant to fix this issue.
As per: home-assistant/core#80257
Logger: homeassistant.helpers.frame
Source: helpers/frame.py:77
First occurred: 12:52:33 (2 occurrences)
Last logged: 12:52:36
Detected integration that accesses the is_metric
property of the unit system. This is deprecated and will stop working in Home Assistant 2023.1. Please adjust to use instance check instead.. Please report issue to the custom integration author for astroweather using this method at custom_components/astroweather/weather.py, line 77: unit_system = "metric" if hass.config.units.is_metric else "imperial"
Is it possible to set the device_class
for some sensors? I know this can be done in the customize section but I think it is better if they are set during creation.
entity | device_class |
---|---|
sensor.astroweather_2m_relative_humidity |
humidity |
sensor.astroweather_2m_temperature |
temperature |
sensor.astroweather_moon_next_rising |
timestamp |
sensor.astroweather_moon_next_setting |
timestamp |
sensor.astroweather_sun_next_rising |
timestamp |
sensor.astroweather_sun_next_setting |
timestamp |
sensor.astroweather_sun_next_rising_astronomical |
timestamp |
sensor.astroweather_sun_next_setting_astronomical |
timestamp |
sensor.astroweather_timestamp |
timestamp |
I guess the one issue I can see is that the timestamp entities may not be in the correct ISO8601 format.
Hey! Just wonder if we could have a sensor or attribute that tells if the moon is getting larger/smaller? Not sure what the English name is for it but it would be neat to tell if the moon is heading for a new moon or full moon next.
I guess this could be made with a trend
sensor but would love to have it integrated.
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.