jonasped / homeassistant-eloverblik Goto Github PK
View Code? Open in Web Editor NEWHome Assistant Custom Component showing data from eloverblik.dk
License: Apache License 2.0
Home Assistant Custom Component showing data from eloverblik.dk
License: Apache License 2.0
The price of electricity consists of the generation cost, the transport costs, and fees. The generation costs are not available from eloverblik, but can be pulled from Nordpool. However, the transport costs and fees are available from eloverblik, at least on their website, through the "prisdata" export.
Given that this data is also available in their API, it would be very neat to expose it as sensors in this plugin. That way, it can be combined with data from the "Nordpool" plugin to give a pretty accurate hourly price forecast per kWh. The transport costs have to be updated daily, as "peak hour" pricing is different in the summer and winter periods.
@JonasPed unless you have a burning desire to look at this, would you mind if I gave it a shot? I'd also need to add it to your pyeloverblik package. At least I didn't find any code relating to this price data there.
Edit: I've made a PR to pyeloverblik that fetches monthly consumption data, which can be used to implement this one pretty easily.
Hi Jonas,
Thanks for sharing your work.
I installed this yesterday, and got following issues :
After installation, entities are visible, but without data. Data is visible via eloverblik.dk.
This error is found in the log file :
Logger: custom_components.eloverblik
Source: custom_components/eloverblik/init.py:103
Integration: Eloverblik (documentation)
First occurred: October 16, 2020, 10:41:28 AM (22 occurrences)
Last logged: 7:43:29 AM
Exception: <class 'TypeError'>
Best regards,
Mike
I don't see any errors in HA, and the data is 2 days old now..
Hi Jonas,
Very nice work with homeassistant-eloverblik 👍
I have installed your repository in home assistant and it works awesome. However I also have a summerhouse, would it be possible to somehow enter multiple tokens for more metering points?
br
Jesper
Hi,
Just realized data was only updated when I restarted Home Assistant. Before I did the restart of HA I checked eloverblik.dk (my last data in HA was from the 28th Mar.) and there was data on the eloverblik.dk from the 29 and 30th March but not from yesterday the 31th. I did a restart and the the integration updated to the 30th with correct attribute "Metering date: '2020-03-30'"(this is a huge improvement).
Before I did a restart I tried to update the entity via the service homeassistant.update_entity, but nothing happened. But seem like the restart triggered an update process.
Keep op the great work! Thanks.
Hi
I got these error on each sensor.eloverblik_energy
2020-03-31 15:06:57 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.eloverblik_energy_23_24 fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 476, in async_device_update
await self.hass.async_add_executor_job(self.update)
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/eloverblik/sensor.py", line 81, in update
self._state = self._data.get_usage_hour(self._hour)
File "/config/custom_components/eloverblik/init.py", line 77, in get_usage_hour
return round(self._data.get_metering_data(hour), 3)
File "/usr/local/lib/python3.7/site-packages/pyeloverblik/models.py", line 53, in get_metering_data
return self._metering_data[hour-1]
IndexError: list index out of range
Version key is required in the manifest file for future support in Home Assistant otherwise it will be blocked from running.
More information: https://developers.home-assistant.io/docs/creating_integration_manifest/#version
It would be great to have support for HA’s new energy management feature. See https://developers.home-assistant.io/docs/core/entity/sensor#long-term-statistics
Hi Jonas
I just wanted to tell you that I reused your code to create two more HA plugins: Novafos (via KMD data warehouse) and one for regional heating (aka fjernvarme) for use with the eforsyning data warehouse.
Like the electricity data, everything is non-real-time and 24 hours delayed. Real-time monitoring requires hardware in your own house it seems.
Status for these is "works for me", and I also haven't figured out how to publish them on HACS. I am kind of hoping you can help me out here as the plugins are basically the same as this one, just accessing a different REST API.
Check it out here:
Would be awsome if this integration could expose long-term statistics: https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics, then the "new" energy features should work out of the box: https://www.home-assistant.io/blog/2021/09/01/release-20219/#home-energy-management-updates
It would be awesome to have a sensor for pricing for use in "Grid consumption" as a "Use an entity tracking the total costs". I believe it should be possible to pair the hourly sensors, or a total, with the response from https://api.eloverblik.dk/CustomerApi/api/meteringpoints/meteringpoint/getcharges
Hi @JonasPed
Thanks for your great work. I have a problem with the Eloverblik Energy Total-sensor. This morning it has registered a spike of almost 17.000 kWh - see attached screenshot. I downloaded the data from eloverblik.dk, and there is no abnormalities there - what could have triggered this?
For unknown reasons, the measurements from the Eloverblik integration is not showing up in HA's new "Energy"/"Grid Consumption" settings.
I'm unsure if this is really an issue with Eloverblik, or if I need to set up some derived entities that converts the measurements into "statistics" or not -- but it would be awesome if it would be added as part of the integration - esp if could retain that "metering date" to ensure that the consumption was shown with the actual date, and not offset.
(and by the way, thanks for implementing this integration in the first place, it's much appreciated!)
Feature request
I have heatpump as central heating system, and thus low tax on kWh above 4000 kWh.
Due to that fact - I have two measurepoints in Eloverblik.dk. One that represents my main measurepoint and one (with an id 10 points lower than my main measurepount. It represents the daily added 4000/365 kWh of which I have to pay full taxation. The sensor "tariff_sum" from my main measurepoint only have the low taxation (0,008 kr excluding wat). It would be nice having the other as well.
It is possible to invoke two integrations - but the naming - including the friendly names are the same - which result in an annoying "_2" at the end of all the names.
So - I know its possible - but not easy to recognize at all.
Hej,
I got this error after installing the component and setting a meterpoint and token:
2020-10-14 09:42:43 DEBUG (SyncWorker_7) [pyeloverblik.eloverblik] Got short lived token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlblR5cGUiOiJDdXN0b21lckFQSV9EYXRhQWNjZXNzIiwidG9rZW5pZCI6IjY
xODNjOWYzLWVkMWUtNDE4ZS04NzEyLTU4ZmQzMTg5MzgxYSIsImp0aSI6IjYxODNjOWYzLWVkMWUtNDE4ZS04NzEyLTU4ZmQzMTg5MzgxYSIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL25hbWVpZGVud
GlmaWVyIjoiUElEOjkyMDgtMjAwMi0yLTIzODg4NzI0MDEyMSIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL2dpdmVubmFtZSI6IkRhdmlkIFN0ZYBoYW4gUnVkb2xmIEtlc3NlbGhlaW0iLCJsb2dpblR
5cGUiOiJLZXlDYXJkIiwicGlkIjoiOTIwOC0yMDAyLTItMjM4ODg3MjQwMTIxIiwidHlwIjoiUE9DRVMiLCJleHAiOjE2MDI3NDc3NjMsImlzcyI6IkVuZXJnaW5ldCIsInRva2VuTmFtZSI6ImhhIiwiYXVkIjoiRW5lcmdpbmV0In0.lJkz4s1JPt5TWJY6I
r3-FiQa0DI3pxb3rCo5aU_SOJo
2020-10-14 09:42:48 WARNING (SyncWorker_7) [custom_components.eloverblik] Exception: <class 'requests.exceptions.ReadTimeout'>
I changed the short lived token slightly, don't know if that was necessary.
Any way I can debug this further?
Hi, great work.
I would like to suggest that all sensors be combined into the sensor.eloverblik_energy_total
with each sensor.eloverblik_energy_0_1
, sensor.eloverblik_energy_1_2
, etc. as attributes in that sensor, kind of like the Nordpool integration for electricity prices (see screenshot).
Mostly just to avoid so many entities in HA. If you need any of those values directly, it's fairly easy to pull them out from attributes. You actually have examples for something like that already.
You closted the other case before I could answer.
I have two HA installations running, and the one that is not updated to the new version. Is working fine.
So i dont believe that it’s only the API
Unsure if it's a beta https://rc.home-assistant.io/blog/2021/12/03/release-202112/ related issue 🙏
2021-12-05 07:43:21 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.eloverblik_energy_21_22 (<class 'custom_components.eloverblik.sensor.EloverblikEnergy'>) implements device_state_attributes. Please report it to the custom component author.
I've installed using HACS and restarted but can't find eloverblik in Configuration >> Integrations.
I've checked the custom components folder and eloverblik is present in there. I'm using Home Assistant 2021.2.3
Looks like the integration is broken after the newest HA update.
None of the entities are showing anything
br
Bjarke
ps
Dansk er helt fint
seems to be broken in 2022.8.5
i tried installing in both ways. but it wont show up in integrations?
yes i restarted several times :-)
SOLVED: I forgot to clear the browser cache. Ctrl + F5 solved the problem.
I've installed the Eloverblik integration in Home Assistant using HACS. After an restart, I'm not able to create the configuration using Configuration, Integrations and then clicking the + icon. Eloverblik is not listed as one of the available integrations.
I've tried to uninstall and reinstall the integration without luck.
eloverblik: the '.translations' directory has been moved, the new name is 'translations', starting with Home Assistant 0.111 your translations will no longer load if you do not move/rename this
Reported in HASS 0.109
There are sensors right now for the last days usage, and the last 24 hours (individual sensors). Maybe add one that shows for the current hour (~24 hours ago, whatever delay Eloverblik has), which is updated hourly?
Would love a sensor that shows the total usage for the current year. It's very useful for people who have heating pumps in their home. After reaching 4000 kWh for a year, the fee on electricity is greatly reduced. Having a sensor to keep track of the total usage for current year, will help keep an eye on when the fees will lower - as well as help in automatically calculating electricity cost at any given moment.
Hi,
ive added the following code, but it sends back incorrect data to the Energy intergration..
template:
sensor:
name: "Eloverblik Long Term Statistics"
unit_of_measurement: kWh
state: "{{ states('sensor.eloverblik_energy_total') }}"
attributes:
device_class: energy
state_class: measurement
last_reset: "{{ state_attr('sensor.eloverblik_energy_total', 'metering_date') }}"
My sensor says 15kwh but Energy plugin says only 3 khw ??
Is it possible to make it easy to update metering point or token?
I needed to uninstall Eloverblik, install Eloverblik in another browser (Maybe I could just delete cache) before I was prompte for Metering point and token.
Efter seneste opdatering får jeg fejlen "Entitet er ikke-numerisk: sensor.eloverblik_energy_total".
Jeg bruger eksemplet under https://github.com/JonasPed/homeassistant-eloverblik
Hi
Thanks for the nice integration. Coulkd you please consider integrating it with the new HomeAssistant statistics feature? See here: https://developers.home-assistant.io/docs/core/entity/sensor#long-term-statistics.
Goes through great with config_flow but i get an error for all sensors XX_YY:
2020-02-03 18:32:19 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.eloverblik_energy_14_15 fails Traceback (most recent call last): [...] File "/usr/local/lib/python3.7/site-packages/pyeloverblik/models.py", line 53, in get_metering_data return self._metering_data[hour-1] TypeError: 'NoneType' object is not subscriptable
Efter HA update stoppede Eloverblik med at virke, med 'eloverblik' does not have a valid version key. Generelt problem, eller blot min installation?
EDIT: tilføj: "version": "1.0", til Manifest.json-filen og ting virker igen.
I hope it is ok I share this here, if not please just delete it.
For everybody else who uses timescaledb as a backend for grafana I thought I'd like to share the query I come up with to show total energy usage by actual metering date.
select avg(state),
time
from(
select cast(state as decimal)
,to_date(replace(cast(json_extract_path(attributes::json,'metering_date') as text),'"',''),'YYYY-MM-DD') as time
from public.ltss
where entity_id = 'sensor.eloverblik_energy_total'
and $__timeFilter("time")
) as a
group by time
The problem with just using time
was twofold: The data shown was actually for another date and if you just used aggregate you'd aggregate over date boundaries.
This shows the data by metering date and correctly averages without crossing date boundaries.
Hi Jonas,
First of all, thanks for providing us with this plugin. Got it well installed and see sensors in HASS - wondering if there is some suggested, cool way of presenting them in HASS and get history, barcharts, or similar. What have you done yourself?
Thanks!
how do i update token ?
reinstall?
Installed via HACS, after restart, the integration cannot be found to follow these steps:
Head to configuration --> integration
Add new and search for eloverblik
enter refresh token and metering point.
Hi Jonas,
Thanks for making this. I just installed it, and notice that data is from April 18th, so 2 days old. Is this supposed to be like that? I can download data from the website for today.
Hi.
First of all very nice idea integrating with eloverblik!!
Have you experienced that sensors stay in unknown ?
After upgrading to 2022.2 my e-forsyning stopped working. I get the following in the log:
Logger: homeassistant.setup
Source: setup.py:162
First occurred: 10:01:48 (1 occurrences)
Last logged: 10:01:48
Setup failed for custom integration eforsyning: Requirements for eforsyning not found: ['requests==2.22.0'].
The new Energy Dashboard can't find the total
value. I think this is because the sensor is missing a last_reset
property.
https://www.home-assistant.io/more-info/statistics/
https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics
Not sure how it works, but it seems that last_reset
could just be the meeting date.
Can you add sensors showing outgoing power for people with solar panels?
This way you can calculate the net power use/supply per day.
Hey Jonas
First off thanks for integration. There is no doubt this will become a hit in the danish hass community..
I recived a timeout today from the service after doing 2 restarts within 10 minutes..
Exception: <class 'requests.exceptions.ReadTimeout'>
Maybe a workaround is possible, as this makes it impossible to pull data after the timeout?
The template sensor example in the README, is not consistent.
In the attibutes tax is added on tariff, but tax is missing in the state part.
im trying to add:
template:
To my config file, but it just giving me duplicate error with notify:
Can i add it in a different way ?
Hi
I am trying to use Eloverblik, however, I cannot update meteringpoint or Token, if needed.
I am also not getting any data in Eloverblik
I have tried unistalling, reinstalling etc. but no luck
Is it possible for you to help?
Regards
I have removed eloverblik integration from HA but I still have 3 sensors that will not disappear and everything regarding Eloverblik has been removed from my yaml files and the integration has been removed from HACS.
Is there a solution on how to get rid of the old sensor before I install "electricity overview" again ?
First of all great addon to Home Assistant.
In my data from eloverblik.dk i can see data from my solar cells.
I have attached raw data and a screenshot where you can see what the different "målepunkt id" are.
If possible if would like sensors for all id's:
"Leveret til net"
"Forbrugt fra net"
"Nettoforbrug"
I have a the following added to my configuration:
`- platform: statistics
entity_id: sensor.eloverblik_energy_total
name: Eloverblik Monthly Statistics
sampling_size: 50
max_age:
days: 30
But the Min age in the stats overview only shows a dates up till 10 days ago.
`Sampling size
50
Count
18
Mean
29.22
Median
27.45
Standard deviation
8.09
Variance
65.49
Total
525.88
Min value
16.37
Max value
41.95
Min age
2021-03-17T02:13:21.070741+00:00
Max age
2021-03-27T02:18:34.059234+00:00
Change
-11.74
Average change
-0.69
Change rate
0
Is there a fix for that?
Please make your repository conform to the HACS guidelines:
https://hacs.xyz/docs/publish/start
That would mean users can easily add your plugin to HACS as a Custom repository and test it.
Right now when I try I get this:
2020-01-30 22:35:32 ERROR (MainThread) [hacs.repository.plugin.JonasPed.homeassistant-eloverblik] Repostitory structure not compliant
2020-01-30 22:35:32 ERROR (MainThread) [hacs] Validation for JonasPed/homeassistant-eloverblik failed.
please add sensors, that pull monthly stats.
e.g
It would be cool if the right attributes could be added so it works with Home Energy Management in the newest version of Home Assistant:
https://www.home-assistant.io/blog/2021/08/04/home-energy-management/
Here is the docs about energy sensors:
https://developers.home-assistant.io/docs/core/entity/sensor
Here is a discussion on what attributes needs to be added:
https://community.home-assistant.io/t/home-energy-management-in-2021-8/325539
Unfortunately, this will also need to address another problem - the fact that the data we receive is from a previous day. I have not yet found a solution for this, it's also being discussed here:
https://community.home-assistant.io/t/energy-counter-delayed-data/332108
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.