gieljnssns / buienalarm-sensor-homeassistant Goto Github PK
View Code? Open in Web Editor NEWBuienalarm custom_component for Home-Assistant
License: MIT License
Buienalarm custom_component for Home-Assistant
License: MIT License
The sensors are missing the Attribution attribute.
I have several Bonsai trees outside, which are very sensitive to frost, so is it possible to have a 24hrs temp forecast?
At the moment i can only read a temp forecast for max 120min:
'You can provide a timeframe: Minutes to look ahead for precipitation forecast (min: 5 / max: 120) - Default value: 60'
Thanks
Describe the bug
Great integration!
Recently the temperature reading started showing 0 degrees all the time.
Any errors
No errors
Config yaml
Additional context
Looks like the Android app is also not giving the right info
Describe the bug
The sensor is no longer working, it is no longer to be found in HA
Any errors
Setup of sensor platform buienalarm is taking over 10 seconds.
Config yaml
In a seperate buienalarm.yaml which is included by sensor.yaml
platform: buienalarm
timeframe: 15
name: buienalarm
monitored_conditions:
- temperature
- precipitation
- precipitation_forecast_average
- precipitation_forecast_total
- next_rain_forecast
Describe the bug
Since a couple of days a gateway error is shown
Error in log:
'Error fetching data safely: HTTPSConnectionPool(host='cdn-secure.buienalarm.nl', port=443): Read timed out. (read timeout=10.0)'
After loading the integration via HACS and copying:
- platform: buienalarm
timeframe: 45
name: buienalarm
monitored_conditions:
- temperature
- precipitation
- precipitation_forecast_average
- precipitation_forecast_total
- next_rain_forecast
in the configuration.yaml I get the following ERROR:
'Module buienalarm not found.
I can't find the module 'buienalarm' and so can't Hassio. Do I have to place something in /config/ui-lovelace.yaml or /config/appdaemon/apps/apps.yaml. Normally this isn't the cae or it is stated.
Hi Giel,
I'm receiving the following errors every day, starting same time.
Is it something in my config or is it perhaps something in the Buienalarm code causing it?
Logger: buienalarm.pybuienalarm
Source: custom_components/buienalarm/sensor.py:171
First occurred: 12:25:19 AM (53 occurrences)
Last logged: 9:19:47 AM
SQLSTATE[HY000] [1040] Too many connections
HTTPSConnectionPool(host='cdn-secure.buienalarm.nl', port=443): Max retries exceeded with url: /api/3.4/forecast.php?lat=51.xxx&lon=4.xxx®ion=nl&unit=mm%2Fu (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x6d771b50>: Failed to establish a new connection: [Errno -3] Try again'))
HTTPSConnectionPool(host='cdn-secure.buienalarm.nl', port=443): Max retries exceeded with url: /api/3.4/forecast.php?lat=51.xxx&lon=4.xxx®ion=nl&unit=mm%2Fu (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x679604b0>: Failed to establish a new connection: [Errno -3] Try again'))
HTTPSConnectionPool(host='cdn-secure.buienalarm.nl', port=443): Max retries exceeded with url: /api/3.4/forecast.php?lat=51.xxx&lon=4.xxx®ion=nl&unit=mm%2Fu (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x6d771c70>: Failed to establish a new connection: [Errno -3] Try again'))
Logger: homeassistant.helpers.entity
Source: custom_components/buienalarm/sensor.py:173
First occurred: 12:25:19 AM (53 occurrences)
Last logged: 9:19:47 AM
Update for sensor.ba_temperature fails
Update for sensor.ba_precipitation fails
Update for sensor.ba_precipitation_forecast_average fails
Update for sensor.ba_precipitation_forecast_total fails
Update for sensor.ba_next_rain_forecast fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 272, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 466, in async_device_update
self.update # type: ignore
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/buienalarm/sensor.py", line 126, in update
self.ba_data.update()
File "/usr/src/homeassistant/homeassistant/util/init.py", line 239, in wrapper
result = method(*args, **kwargs)
File "/config/custom_components/buienalarm/sensor.py", line 173, in update
self.temperature = self.buienalarm.get_temperature()
File "/usr/local/lib/python3.7/site-packages/buienalarm/pybuienalarm.py", line 56, in get_temperature
if self.renew < time.time():
TypeError: '<' not supported between instances of 'NoneType' and 'float'
Describe the bug
Perhaps not a bug but just installed this via HACS, it shows as installed and in dashboards I have a (nonworking) neerslagcard. In settings I have no devices or entities for buienalarm. Are manual additional steps needed after installing via HACS?
Any errors
Neerslagcard not working
The domoticz plugin provides alert levels
https://github.com/Xorfor/Domoticz-Buienalarm-Plugin
Add support for sensors for level and text to prevent users having to create template sensors themselves.
Describe the bug
Any errors
Logger: homeassistant
Source: components/sensor/__init__.py:585
First occurred: 17:21:09 (1 occurrences)
Last logged: 17:21:09
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 581, in state
numerical_value = int(value)
^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'unknown'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template_entity.py", line 380, in _async_template_startup
result_info.async_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 974, in async_refresh
self._refresh(None)
File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1154, in _refresh
self.hass.async_run_hass_job(self._job, event, updates)
File "/usr/src/homeassistant/homeassistant/core.py", line 618, in async_run_hass_job
hassjob.target(*args)
File "/usr/src/homeassistant/homeassistant/helpers/template_entity.py", line 349, in _handle_results
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 590, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 654, in _async_write_ha_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 596, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 585, in state
raise ValueError(
ValueError: Sensor sensor.buienalarm_next_rain_forecast_min has device class 'None', state class 'None' unit 'min' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: 'unknown' (<class 'str'>)
Config yaml
yaml here
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Describe the bug
I had no luck with v1.7 so I was happy to see there was a v1.8. I updated but it still seems not to work. See the errors below for the log information.
I really hope you get it to work properly. Anyway thanks a lot for your effort
Any errors
Logger: custom_components.buienalarm
Source: helpers/update_coordinator.py:200
Integration: buienalarm (documentation)
First occurred: 18:38:05 (9 occurrences)
Last logged: 21:18:05
Error requesting buienalarm data: 502 Server Error: Bad Gateway for url: https://cdn-secure.buienalarm.nl/api/3.4/forecast.php?
Config yaml
Installed with HACS
Screenshot
Logger: homeassistant.const
Source: helpers/deprecation.py:205
First occurred: 18:36:58 (6 occurrences)
Last logged: 18:37:13
TEMP_CELSIUS was used from buienalarm, 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 'buienalarm' custom integration
Describe the bug
The integration stopped giving new forecasts.
Only sensor "sensor.buienalarm_temperature" gives a value of 8, other are set to 0.
Any errors
No not that i can see.
error here
**Config yaml**
sensor:
- platform: buienalarm
timeframe: 15
name: buienalarm
monitored_conditions:
- temperature
- precipitation
- precipitation_forecast_average
- precipitation_forecast_total
- next_rain_forecast
===
configuration.yaml
logger:
default: critical
logs:
# log level for HA core
homeassistant.core: fatal
# log level for MQTT integration
homeassistant.components.mqtt: warning
# log level for all python scripts
homeassistant.components.python_script: warning
# individual log level for this python script
homeassistant.components.python_script.my_new_script.py: debug
# log level for SmartThings lights
homeassistant.components.smartthings.light: info
# log level for a custom component
custom_components.my_integration: debug
# log level for the `aiohttp` Python package
aiohttp: error
# log level for both 'glances_api' and 'glances' integration
homeassistant.components.glances: fatal
glances_api: fatal
Additional context
After a crash of my HA (Core/Container) I needed multiple reboots to get everything going again. I got everything up and running again. The only thing which is not working is the buienalarm-integrations which i'm using in all kinds of automations and alerts.
Any clue how i can debug this?
I've already removed the integration from HA and disk and reinstalled it through HACS.
Configuring it with a different name for the sensors also did not work.
Is it possible my IP is blocked by BA? Anywhere i can see the log-files for an integration?
Thanks in advance and for this great integration!!
The next rain forecast sensor shows a date/time.
To be able to show this as a relative date in the UI, 2 things need to be done:
A current workaround is to create a template sensor and show that in the UI:
template:
sensor:
- name: "Buienalarm Next Rain Forecast Timestamp"
unique_id: sensor.buienalarm_next_rain_forecast_timestamp
device_class: timestamp
icon: mdi:clock
availability: "{{ states('sensor.buienalarm_next_rain_forecast') is not none }}"
state: >
{% set datetime = states('sensor.buienalarm_next_rain_forecast') %}
{{ (as_datetime(datetime) | as_local) }}
Home Assistant 2021.12.9 is logging following error :
Logger: homeassistant.helpers.entity
Source: helpers/entity.py:549
First occurred: 8:47:37 PM (5 occurrences)
Last logged: 8:47:38 PM
Entity sensor.ba_precipitation (<class 'custom_components.buienalarm.sensor.BuienalarmSensor'>) implements device_state_attributes. Please report it to the custom component author.
Entity sensor.ba_precipitation_forecast_average (<class 'custom_components.buienalarm.sensor.BuienalarmSensor'>) implements device_state_attributes. Please report it to the custom component author.
Entity sensor.ba_precipitation_forecast_total (<class 'custom_components.buienalarm.sensor.BuienalarmSensor'>) implements device_state_attributes. Please report it to the custom component author.
Entity sensor.ba_next_rain_forecast (<class 'custom_components.buienalarm.sensor.BuienalarmSensor'>) implements device_state_attributes. Please report it to the custom component author.
Entity sensor.ba_temperature (<class 'custom_components.buienalarm.sensor.BuienalarmSensor'>) implements device_state_attributes. Please report it to the custom component author.
De nieuw toegevoegde sensor die het aantal minuten tot neerslag aan zou moeten geven blijft hangen op 5 minuten, en springt wanneer het weer droog is op -1 of een nieuwe tijd, wat ook te zien is in de screenshot.
Deze sensor is superchill voor automations, dus zou leuk zijn als ie het nog beter doet.
Iโm started getting errors (my log is basically spammed with it) with this sensor as of HA 2021.04, add-on version 1.5:
2021-04-14 17:54:40 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.buienalarm_temperature fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 292, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 490, in async_device_update
raise exc
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/buienalarm/sensor.py", line 136, in update
self.ba_data.update()
File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 278, in wrapper
result = method(*args, **kwargs)
File "/config/custom_components/buienalarm/sensor.py", line 183, in update
self.buienalarm = Buienalarm(
File "/usr/local/lib/python3.8/site-packages/buienalarm/pybuienalarm.py", line 40, in __init__
self.update()
File "/usr/local/lib/python3.8/site-packages/buienalarm/pybuienalarm.py", line 83, in update
data = resp.json()
File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 900, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/lib/python3.8/site-packages/simplejson/__init__.py", line 525, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2021-04-14 17:54:41 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.buienalarm_precipitation fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 292, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 490, in async_device_update
raise exc
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/buienalarm/sensor.py", line 136, in update
self.ba_data.update()
File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 278, in wrapper
result = method(*args, **kwargs)
File "/config/custom_components/buienalarm/sensor.py", line 183, in update
self.buienalarm = Buienalarm(
File "/usr/local/lib/python3.8/site-packages/buienalarm/pybuienalarm.py", line 40, in __init__
self.update()
File "/usr/local/lib/python3.8/site-packages/buienalarm/pybuienalarm.py", line 83, in update
data = resp.json()
File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 900, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/lib/python3.8/site-packages/simplejson/__init__.py", line 525, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2021-04-14 17:54:41 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.buienalarm_precipitation_forecast_average fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 292, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 490, in async_device_update
raise exc
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/buienalarm/sensor.py", line 136, in update
self.ba_data.update()
File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 278, in wrapper
result = method(*args, **kwargs)
File "/config/custom_components/buienalarm/sensor.py", line 183, in update
self.buienalarm = Buienalarm(
File "/usr/local/lib/python3.8/site-packages/buienalarm/pybuienalarm.py", line 40, in __init__
self.update()
File "/usr/local/lib/python3.8/site-packages/buienalarm/pybuienalarm.py", line 83, in update
data = resp.json()
File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 900, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/lib/python3.8/site-packages/simplejson/__init__.py", line 525, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2021-04-14 17:54:41 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.buienalarm_precipitation_forecast_total fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 292, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 490, in async_device_update
raise exc
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/buienalarm/sensor.py", line 136, in update
self.ba_data.update()
File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 278, in wrapper
result = method(*args, **kwargs)
File "/config/custom_components/buienalarm/sensor.py", line 183, in update
self.buienalarm = Buienalarm(
File "/usr/local/lib/python3.8/site-packages/buienalarm/pybuienalarm.py", line 40, in __init__
self.update()
File "/usr/local/lib/python3.8/site-packages/buienalarm/pybuienalarm.py", line 83, in update
data = resp.json()
File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 900, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/lib/python3.8/site-packages/simplejson/__init__.py", line 525, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Add the timeframe as an attribute to the forecast sensors.
Hi Devs,
Since the latest update to HA 9.7 the buienalarm sensor is giving the following error below and is not receiving any data anymore. Can you please investigate what's happening?
Logger: buienalarm.pybuienalarm
Source: /usr/local/lib/python3.9/site-packages/buienalarm/pybuienalarm.py:158
First occurred: 11:32:12 (90 occurrences)
Last logged: 19:12:02
Error fetching data safely: HTTPSConnectionPool(host='cdn-secure.buienalarm.nl', port=443): Read timed out. (read timeout=10.0)
Thanks in advance!
Patick
Describe the bug
Sometimes I do get this error message in the log. What is it and what can we do to avoid that?
Any errors
Logger: buienalarm.pybuienalarm
Source: /usr/local/lib/python3.9/site-packages/buienalarm/pybuienalarm.py:158
Error fetching data safely: HTTPSConnectionPool(host='cdn-secure.buienalarm.nl', port=443): Max retries exceeded with url: /api/3.4/forecast.php?lat=52.590189613575276&lon=6.106075644493103®ion=nl&unit=mm%2Fu (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fbbb625cbe0>: Failed to establish a new connection: [Errno -3] Try again'))
Error fetching data safely: HTTPSConnectionPool(host='cdn-secure.buienalarm.nl', port=443): Max retries exceeded with url: /api/3.4/forecast.php?lat=52.590189613575276&lon=6.106075644493103®ion=nl&unit=mm%2Fu (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fbbb635d1c0>: Failed to establish a new connection: [Errno -3] Try again'))
Error fetching data safely: HTTPSConnectionPool(host='cdn-secure.buienalarm.nl', port=443): Max retries exceeded with url: /api/3.4/forecast.php?lat=52.590189613575276&lon=6.106075644493103®ion=nl&unit=mm%2Fu (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fbba6665d00>: Failed to establish a new connection: [Errno -3] Try again'))
Error fetching data safely: HTTPSConnectionPool(host='cdn-secure.buienalarm.nl', port=443): Max retries exceeded with url: /api/3.4/forecast.php?lat=52.590189613575276&lon=6.106075644493103®ion=nl&unit=mm%2Fu (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fbba44661f0>: Failed to establish a new connection: [Errno -3] Try again'))
Error fetching data safely: HTTPSConnectionPool(host='cdn-secure.buienalarm.nl', port=443): Max retries exceeded with url: /api/3.4/forecast.php?lat=52.590189613575276&lon=6.106075644493103®ion=nl&unit=mm%2Fu (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fbbab7fd670>: Failed to establish a new connection: [Errno -3] Try again'))
Config yaml
- platform: buienalarm
timeframe: 5
name: buienalarm
monitored_conditions:
- temperature
- precipitation
- precipitation_forecast_average
- precipitation_forecast_total
- next_rain_forecast
Your program is using the home location of HA.
Is it possible to use the location of a device tracker?
Then I know if it is going to rain where I am, not if it is going to rain at my home only,
After update october/november i have logbook error.
Error
Template warning: 'as_timestamp' got invalid input 'unknown' when rendering template '{% if as_timestamp(states('sensor.buienalarm_next_rain_forecast')) %} {{ ( ( as_timestamp(states('sensor.buienalarm_next_rain_forecast')) - as_timestamp(now()) ) / 60 ) | round }} {% else %} {{ states('nonexistent') }} {% endif %}' but no default was specified. Currently 'as_timestamp' will return 'None', however this template will fail to render in Home Assistant core 2022.1
Thanks for checking ๐
I was wondering how people are showing this component's data in Lovelace.
Currently I have just put the temperature sensor in a history graph, but I'd love to also have a precipitation overview.
ideas?
Currently next rail forecast is shown as "-1 minutes". This doesn't look good in the UI. Why not set the sensor value to None
if it is computed as -1
?
If you like I can submit a PR.
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.