mawinkler / astroweather

Asynchronous Astro Weather Forecast for Home Assistant
GNU General Public License v3.0
67 stars 8 forks source link

suddenly failing with the following error #56

Closed fuzzysb closed 3 months ago

fuzzysb commented 3 months ago

I hope you can assist in the error that i am now receiving in home assistant: 7timer as far as i can see does not use a certificate

image

Elderwolf1700 commented 3 months ago

Came to say I am receiving the same error. Error log:

This error originated from a custom integration.

Logger: custom_components.astroweather Source: helpers/update_coordinator.py:315 integration: AstroWeather (documentation, issues) First occurred: 3:38:38 AM (43 occurrences) Last logged: 4:26:06 AM

Unexpected error fetching astroweather data: Error requesting data: Cannot connect to host www.7timer.info:443 ssl:True [SSLCertVerificationError: (1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'www.7timer.info'. (_ssl.c:1000)")] Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 315, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 271, in _async_update_data return await self.update_method() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyastroweatherio/client.py", line 102, in get_location_data return await self._get_location_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyastroweatherio/client.py", line 128, in _get_location_data await self.retrieve_data_seventimer() File "/usr/local/lib/python3.12/site-packages/pyastroweatherio/client.py", line 597, in retrieve_data_seventimer json_data_astro = await self.async_request_seventimer("astro", "get") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyastroweatherio/client.py", line 646, in async_request_seventimer raise RequestError(f"Error requesting data: {err}") from None pyastroweatherio.errors.RequestError: Error requesting data: Cannot connect to host www.7timer.info:443 ssl:True [SSLCertVerificationError: (1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'www.7timer.info'. (_ssl.c:1000)")]

Restarted HA and also tried reinstalling the integration.

mawinkler commented 3 months ago

Confirmed. 7Timers availability is currently unreliable. It is used for the source for seeing, transparency, and lifted index. For this reason some more error handling is now implemented in pyastroweatherio to allow AstroWeather to function even if there is no data available from 7Timer. Condition forecast is then based on clouds and calmness (with an upcoming version of AsterWeather) only.

If anyone knows a free API source a seeing forecast, please report back.

For now, please change the manifest.json in the custom_components/astroweather folder to the following:

    "requirements": [
        "pyastroweatherio==0.43.1.dev8"
    ],

Example of bad weather:

image
Elderwolf1700 commented 3 months ago

I know Accuweather has a "free" API. You can do only so many requests per day before it cuts you off but all you need is an API key from their website.

fuzzysb commented 3 months ago

worth noting here that this is a bigger issue than reliability

the certificate used now is a squarespace wildcard cert

image

we don’t need to use SSL though. there is no redirect from http → https, and it seems that the SSL part of this site goes to a squarespace under construction holding page

image

and the non SSL rewrites to http://167.99.8.254/

https://community-assets.home-assistant.io/original/4X/e/a/8/ea890ef6925abe316c13b2fc32f0ed2fb9527fde.png

shenanigans for sure, the IP 167.99.8.254 is a digital ocean site. I think what they should be doing is getting the likes of cloudflare infront of this and transferring the DNS away from squarespace.

however moving to a non SSL source for now would fix this issue, except for reliability

I made the change for "pyastroweatherio==0.43.1.dev8" in the manifest.json, and this does not work, still the same error on setup

danielbrunt57 commented 3 months ago

change the manifest.json in the custom_components/astroweather

I made the change, restarted HA, and the integration is now running.

image

fuzzysb commented 3 months ago

change the manifest.json in the custom_components/astroweather

I made the change, restarted HA, and the integration is now running.

image

very strange as mine does not after the change and restart of home assistant

Maddin1684 commented 3 months ago

change the manifest.json in the custom_components/astroweather

I made the change, restarted HA, and the integration is now running.

image

Same for me. after the change, integration works. Will we get an update?

mawinkler commented 3 months ago

So, the 7timer service is still down and is currently being discussed in the issue tracker of 7timer. I'm thinking of replacing 7timer with some seeing estimations based on math :-) let's see how good this will match the "official" services like meteoblue for which no free API is available. So yes, I will work on an update/alternative for sure, but time is limited at the moment.

Maddin1684 commented 3 months ago

Thanks for your work!

But moon data is not affected? (Moonrise and Moonset) should now work with the new string in manifest.json?

danielbrunt57 commented 3 months ago

@Maddin1684

very strange as mine does not after the change and restart of home assistant

I don't know what to say...

mawinkler commented 3 months ago

Thanks for your work!

But moon data is not affected? (Moonrise and Moonset) should now work with the new string in manifest.json?

Everything besides transparency, seeing, and lifted index should work normally. Things like rising/setting etc. are calculated in AstroWeather.

danielbrunt57 commented 3 months ago

Things like rising/setting etc. are calculated in AstroWeather

Or via Node-RED! See https://community.home-assistant.io/t/my-new-moon-device-from-node-red-node-red-contrib-sun-position/683868

tomlut commented 3 months ago

I made the manifest change and restarted, which results in:

Logger: pyastroweatherio.client
Source: helpers/update_coordinator.py:271
First occurred: 07:39:14 (1 occurrences)
Last logged: 07:39:14

Error requesting data: Cannot connect to host www.7timer.info2:443 ssl:default [Name does not resolve]

mnanifest.json

{
    "domain": "astroweather",
    "name": "AstroWeather",
    "codeowners": [
        "@mawinkler"
    ],
    "config_flow": true,
    "dependencies": [],
    "documentation": "https://github.com/mawinkler/astroweather",
    "iot_class": "cloud_polling",
    "issue_tracker": "https://github.com/mawinkler/astroweather/issues",
    "requirements": [
        "pyastroweatherio==0.43.1.dev8"
    ],
    "version": "0.42.3"
}

card Screenshot 2024-04-24 at 07-40-15 Overview – Home Assistant

dev tools states Screenshot 2024-04-24 at 08-13-52 Developer Tools – Home Assistant

tomlut commented 3 months ago

And now it is working. Weird. Could have been a cache thing.

Screenshot 2024-04-24 at 08-27-17 Overview – Home Assistant

danielbrunt57 commented 3 months ago

7timer.info2 [Name does not resolve]

I was thinking along the lines of caching somehow, somewhere as 7timer.info2 doesn't resolve for me either and was going to suggest checking... image but I'm glad it's working for you now!

fuzzysb commented 3 months ago

mine is working too now also

mawinkler commented 3 months ago

Update: 7timer is still down but I'm in contact with the maintainer. The underlying data is functional, but not the API endpoint. In parallel, I played a little with calculating the seeing myself based on temperature, humidity, wind speed, and altitude which gives some results, but verifying them around the globe with the current unstable weather conditions is hard.

So please be patient, I hope to get AstroWeather up again with not only cloud and wind conditions.

freeDom- commented 3 months ago

Thanks for your temporary fix. I can confirm that it is also working for me adter restarting HA.

I really love your intefrarion and want you let to know that I appreciate your woek on this :)

mdisabato commented 3 months ago

I did nothing and it came back this afternoon (April 26 CDT).

Michael

mawinkler commented 3 months ago

7timer is up again and AstroWeather should return automatically with the known functionality. I continue to work on the redesign to make AstroWeather more resilient and provide new functionality. In case anyone is curious, there is a redesign branch in all three repos. Thank you for your patience.