rbrink / home-assistant-prijsplafond Goto Github PK
View Code? Open in Web Editor NEWProvides Home Assistant sensors to keep track of the Dutch prijsplafond regulation.
Provides Home Assistant sensors to keep track of the Dutch prijsplafond regulation.
Hi,
I have setup this inside hacs and insert the config to the sensor.yaml (changed the utility sensors to my own sensors)
I see now the sensor.prijsplafond_gas and stroom
But the other sensors are unavailable, is this an matter of time they are working?
I notice the following:
Same for gas. Currently this month about 114kWh has been used.
What happens at 3AM? A cronjob stops the HomeAssistant-container to backup the data-directory.
My workaround will be to skip this backup. I also make a backup with open files which I fortunately hadn't to restore (as well as the regular backup). Wondering what can cause this...
After updating HA to 2023.5.0 the prijsplafond sensor don't work anymore. I tested it on 2 systems, both the same errors.
This is the error I get from the logs:
Logger: homeassistant.helpers.entity
Source: components/recorder/table_managers/recorder_runs.py:85
First occurred: 08:40:06 (6 occurrences)
Last logged: 08:50:06
Update for sensor.prijsplafond_gas fails
Update for sensor.prijsplafond_power fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 554, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 784, in async_device_update
await coro
File "/config/custom_components/prijsplafond/sensor.py", line 172, in async_update
pos_usage += await self._get_value(entity_id)
File "/config/custom_components/prijsplafond/sensor.py", line 192, in _get_value
state_old = await self._get_first_recorded_state_in_month(entity_id)
File "/config/custom_components/prijsplafond/sensor.py", line 214, in _get_first_recorded_state_in_month
history_list = await get_instance(self.hass).async_add_executor_job(
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/recorder/history/__init__.py", line 174, in state_changes_during_period
return _target(
File "/usr/src/homeassistant/homeassistant/components/recorder/history/modern.py", line 404, in state_changes_during_period
run_start_ts := _get_run_start_ts_for_utc_point_in_time(hass, start_time)
File "/usr/src/homeassistant/homeassistant/components/recorder/history/modern.py", line 583, in _get_run_start_ts_for_utc_point_in_time
run = recorder.get_instance(hass).recorder_runs_manager.get(utc_point_in_time)
File "/usr/src/homeassistant/homeassistant/components/recorder/table_managers/recorder_runs.py", line 85, in get
if start >= self.recording_start:
TypeError: can't compare offset-naive and offset-aware datetimes
Is there a way to fix this?
Only the power fails over here. Gas is working.
Using dsmr.month.merged sensor or using dsmr.month.low and dsmr.month.high sensors.
All the 3 sensors are visible in HA. And outout is kWh.
I do get the next error:
Logger: homeassistant.helpers.entity
Source: custom_components/prijsplafond/sensor.py:194
Integration: Prijsplafond (documentation, issues)
First occurred: 16:37:32 (2 occurrences)
Last logged: 16:43:02
Update for sensor.prijsplafond_power fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 538, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 736, in async_device_update
raise exc
File "/config/custom_components/prijsplafond/sensor.py", line 172, in async_update
pos_usage += await self._get_value(entity_id)
File "/config/custom_components/prijsplafond/sensor.py", line 194, in _get_value
usage = float(state_old.state)
ValueError: could not convert string to float: 'unknown'
In my template.yaml I added
- sensor:
# Template sensor to display the current monthly cap.
- name: 'Prijsplafond monthly gas cap'
unit_of_measurement: "m.."
state: "{{ state_attr('sensor.prijsplafond_gas', 'this_month_cap') }}"
- name: 'Prijsplafond monthly power cap'
unit_of_measurement: "kWh"
state: "{{ state_attr('sensor.prijsplafond_power', 'this_month_cap') }}"
Had to replace value_template by state and remove the friendly-name as it isn't being used (anymore).
Based on these values and the current monthly usage it should be possible to make sensors for remaining gas and power for current month
Maybe someone knows how to get that correct in the code below:
- name: 'Prijsplafond remaining gas'
unit_of_measurement: "m.."
state: "{{ state_attr('sensor.prijsplafond_gas', 'this_month_cap') -
states('sensor.prijsplafond_gas') }} "
- name: 'Prijsplafond remaining power'
unit_of_measurement: "kWh"
state: "{{ state_attr('sensor.prijsplafond_power', 'this_month_cap') -
states('sensor.prijsplafond_power') }}"
Hello,
I'm using this intergration since like it started at begiining of January.
Today I got mention of an update being available so I read the readme and changelog. Then removed the platform from my configuration.yaml, restarted HA. Then did the update from HACS and restarted HA again.
After restart went to add the integration again. It showed the config flow however no text :
After selecting the correct sensors the intergration adding was succesful.
But looking at my entities I now we them as new entities instead of the already created ones :
HAOS on VM
Language set to English, location set to Netherlands.
How can I get them inline again ?
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.