amaximus / met_alerts_hu Goto Github PK
View Code? Open in Web Editor NEWMeteo alerts for Hungary
License: MIT License
Meteo alerts for Hungary
License: MIT License
Logger: homeassistant.components.sensor
Source: custom_components/met_alerts_hu/sensor.py:84
Integration: Érzékelő (documentation, issues)
First occurred: 6:49:50 (1 occurrences)
Last logged: 6:49:50
met_alerts_hu: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 432, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 550, in async_device_update
await task
File "/config/custom_components/met_alerts_hu/sensor.py", line 145, in async_update
mdata = await async_get_mdata(self)
File "/config/custom_components/met_alerts_hu/sensor.py", line 84, in async_get_mdata
a_lvl = m.group(0).replace('w','').replace('.gif','')
AttributeError: 'NoneType' object has no attribute 'group'
Hello,
the "label" pattern you also provided does not work with the new button-card version for me. Can you help me, what should I change?
THX (Köszi!)
Hello,
After I installed the latest version of HomeAssistant (https://www.home-assistant.io/blog/2023/06/a/release-20236/), the plugin throws the following error. I assume it's because of Python 3.11.
I would greatly appreciate it if you could look into whether anything can be done about it!
Thanks in advance for your work.
Logger: homeassistant.loader
Source: custom_components/met_alerts_hu/sensor.py:69
Integration: met_alerts_hu (documentation, issues)
First occurred: 22:39:34 (1 occurrences)
Last logged: 22:39:34
Unexpected exception importing platform custom_components.met_alerts_hu.sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 833, in get_platform
cache[full_name] = self._import_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 850, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/config/custom_components/met_alerts_hu/sensor.py", line 69, in <module>
@asyncio.coroutine
^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'
I have the following error message:
Logger: homeassistant.components.sensor
Source: custom_components/met_alerts_hu/sensor.py:113
Integration: Sensor (documentation, issues)
First occurred: 11:39:26 (1 occurrences)
Last logged: 11:39:26
met_alerts_hu: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 537, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 784, in async_device_update
await self.async_update()
File "/config/custom_components/met_alerts_hu/sensor.py", line 182, in async_update
mdata = await async_get_mdata(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/met_alerts_hu/sensor.py", line 113, in async_get_mdata
ff_json += "{"level":"" + a_lvl +
^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: can only concatenate str (not "NoneType") to str
My config:
- platform: met_alerts_hu
name: 'Meteorológiai riasztás'
region_id: 101
Component state (fresh restart of HA, updated at 18:54):
alerts:
- level: '1'
type: Zivatar
icon: mdi:weather-lightning-rainy
- level: '2'
type: Hőség
icon: mdi:weather-sunny-alert
dominant_met_alert_value: 2
dominant_met_alert: Hőség
updated: '2021-06-21 18:54 '
nr_of_alerts: '2'
provider: Data provided by met.hu
friendly_name: Meteorológiai riasztás
icon: mdi:weather-sunny-alert
Actual (current) alerts state on met.hu page, in the same time show that there are no alerts for region 101, since 18:37:
Hi,
I can't get met_alerts_hu
working.
What I did:
met_alerts_hu
using HACSconfiguration.yaml
sensor:
- platform: met_alerts_hu
name: 'Időjárás figyelmeztetések'
region_id: 1307 # Gödöllői körzet
county_id: 13 # Pest county
lang: hu
sensor.met_alerts_hu
under "Entities" or "Developer Tools / States".met_alerts_hu
code is available under custom_components/met_alerts_hu
.What setup step do I miss?
Hi!
First of all I would like to thanks for your great work on this integration! Could be very useful to rely on the Hungarian local informations.
I have only one request/question.
As met.hu currently already has a languaga selector when the results in the corresponding Hun or Eng language also, would it be possible to define it in the config of the integration to avoid discrete attribute string convertion later?
Thanks for all your efforts!
2021-12-08 11:17:59 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.meteorologiai_riasztas (<class 'custom_components.met_alerts_hu.sensor.METAlertHUSensor'>) implements device_state_attributes. Please report it to the custom component author.
2021-12-08 11:17:59 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.meteorologiai_elorejelzes (<class 'custom_components.met_alerts_hu.sensor.METAlertHUSensor'>) implements device_state_attributes. Please report it to the custom component author.
Hi, great work there, really love this alerting integration!!
However I think i found some edge-case, my config is:
- platform: met_alerts_hu
name: "met_alert"
region_id: 1305
county_id: 13
And the result is:
alerts:
- level: '1'
type: Zivatar
icon: mdi:weather-lightning-rainy
- level: '1'
type: Felhőszakadás
icon: mdi:weather-pouring
- level: '1'
type: Hőség
icon: mdi:weather-sunny-alert
dominant_met_alert_value: 1
dominant_met_alert: Zivatar
updated: '2021-07-09 10:00 '
nr_of_alerts: '4'
provider: Data provided by met.hu
friendly_name: met_alert
icon: mdi:weather-lightning-rainy
Severities could change in the last hours, but in total there are still 4 alerts (1 regional and 3 county), that is total 4 but it seems because the same type, it overwrites the level - which is more valid in the regional level I think - but does not revert the valid total number.
On HA 2023.12.1 this integration not working. The error is:
2023-12-10 14:10:29.698 ERROR (MainThread) [homeassistant.components.sensor] met_alerts_hu: Error on device update!
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1085, in create_connection
raise exceptions[0]
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1069, in create_connection
sock = await self._connect_sock(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 973, in _connect_sock
await self.sock_connect(sock, address)
File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 628, in sock_connect
return await fut
^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 668, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
TimeoutError: [Errno 110] Connect call failed ('194.39.45.240', 443)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 575, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 959, in async_device_update
await self.async_update()
File "/config/custom_components/met_alerts_hu/sensor.py", line 186, in async_update
mdata = await async_get_mdata(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/met_alerts_hu/sensor.py", line 93, in async_get_mdata
async with self._session.get(url) as response:
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1187, in __aenter__
self._resp = await self._coro
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 574, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 544, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 911, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1235, in _create_direct_connection
raise last_exc
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1204, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1000, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host www.met.hu:443 ssl:default [Connect call failed ('194.39.45.240', 443)]
Is dominant_met_alert_value
attribute and the main state of the sensor the same?
Currently they reflect the same number, will it always be like this? It's important to know which is worth better to be used in automations.
Note: please enable Discussions for your repos so we can put questions like this without opening issues.
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.