Comments (8)
I got this which is working except that the real datetime is hidden in an attribute and I've not found any graph that can display the data based of the attributes
sensor:
- platform: template
sensors:
preceding_day_energy_usage:
unit_of_measurement: "kWh"
friendly_name: Eloverblik Energy
entity_id: group.eloverblik_energy
value_template: >-
{% set hour = now().hour %}
{% set sensor = ['sensor.eloverblik_energy', hour, hour+1] | join('_') %}
{{ states(sensor) }}
attribute_templates:
metering_start: >-
{% set hour = now().hour %}
{% set sensor = ['sensor.eloverblik_energy', hour, hour+1] | join('_') %}
{% set datetimestr = [state_attr(sensor, 'Metering date'),'T', hour] | join('') %}
{{ strptime(datetimestr, '%Y-%m-%dT%H') }}
metering_end: >-
{% set hour = now().hour %}
{% set sensor = ['sensor.eloverblik_energy', hour, hour+1] | join('_') %}
{% set datetimestr = [state_attr(sensor, 'Metering date'),'T', hour, ':59', ':59'] | join('') %}
{{ strptime(datetimestr, '%Y-%m-%dT%H:%M:%S') }}
group:
eloverblik_energy:
entities:
- sensor.eloverblik_energy_0_1
- sensor.eloverblik_energy_1_2
- sensor.eloverblik_energy_2_3
- sensor.eloverblik_energy_3_4
- sensor.eloverblik_energy_4_5
- sensor.eloverblik_energy_5_6
- sensor.eloverblik_energy_6_7
- sensor.eloverblik_energy_7_8
- sensor.eloverblik_energy_8_9
- sensor.eloverblik_energy_9_10
- sensor.eloverblik_energy_10_11
- sensor.eloverblik_energy_11_12
- sensor.eloverblik_energy_12_13
- sensor.eloverblik_energy_13_14
- sensor.eloverblik_energy_14_15
- sensor.eloverblik_energy_15_16
- sensor.eloverblik_energy_16_17
- sensor.eloverblik_energy_17_18
- sensor.eloverblik_energy_18_19
- sensor.eloverblik_energy_19_20
- sensor.eloverblik_energy_20_21
- sensor.eloverblik_energy_21_22
- sensor.eloverblik_energy_22_23
- sensor.eloverblik_energy_23_24
automation:
- alias: "Opdater Eloverblik sensor"
id: update_eloverblik_sensor
trigger:
- platform: time_pattern
minutes: '/60'
action:
- service: homeassistant.update_entity
entity_id: sensor.preceding_day_energy_usage
from homeassistant-eloverblik.
I will consider adding such a sensor.
Can a template sensor not be used as a workaround?
from homeassistant-eloverblik.
I suppose a very long template could make do, or one fetching by name (where name includes current hour).... and then a cron/automation to update it each hour?
from homeassistant-eloverblik.
So, I am a NooB here... but I am trying to get the data from the sensors to show in Grafana, but that dosn't work because there is no time on the sensor, only a date... so i cannot compare my energy consumption whit the hourly energy prices - does this solve this problem and add's a time attribute to the sensor?
from homeassistant-eloverblik.
Hi @slimcdk
Nice work.
How do you compensate for the value of sensor.preceding_day_energy_usage is two days old in your view graph?
The meterdate is the 12-09-2022 but the value will be logged in the history for sensor.preceding_day_energy_usage
for today the 14-09-2022.
So if look at the graph in some days it will show the value metered the 12-09 on the graph as 14-09.
from homeassistant-eloverblik.
That is unfortunately a downside of HA. HA only works with realtime data as there is no option to manipulate the timestamp of data. Timestamps in attributes can however be used to display the correct date on graphs (ex Apexchart) but can not be used in the energy logging.
from homeassistant-eloverblik.
@slimcdk Thanks for pointing me to Apexcharts. Its awesome.
But i can´t figure out to replace the attribute data,
`type: custom:apexcharts-card
graph_span: 24h
now:
show: true
label: nu
header:
title: El forbrug pr time
show: true
show_states: true
series:
- entity: sensor.preceding_day_energy_usage
type: column
name: Forbrug
float_precision: 2
group_by:
func: avg
duration: 60min`
Where it would be best to replace the data in the legend with:
{{ state_attr('sensor.preceding_day_energy_usage', 'metering_start')}}
Or replace "name: xxxx" with that attribute.
How did you solve it?
from homeassistant-eloverblik.
There hasn't been any activity on this issue recently. Issue will be marked as stale and closed after 7 days without any activity.
from homeassistant-eloverblik.
Related Issues (20)
- Long term statistics/Energy dashboard release HOT 2
- Blande realtime og Eloverblik historiske data HOT 1
- Feature request: Get CO2 data HOT 3
- Elspotpris.dk HOT 2
- Unsupported operand type(s) for -: 'datetime.datetime' and 'float' HOT 2
- Error from eloverblik when getting meter rading data: 404 - No readings found in result. HOT 3
- Opdatere ikke statistics efter jeg har sat integration op HOT 5
- Stadig sensorer med unknown status HOT 6
- Data 2 dage bagud? HOT 4
- Problemer med opdatering af data HOT 4
- Får ikke data (har vedhæftet log) HOT 2
- Stops working after a 2-3 days HOT 4
- Hvilket Målepunkt ID skal tilknyttes ? HOT 2
- Missing data HOT 5
- Displaying total energy cost in energy dashboard HOT 2
- Automatisk opdatering af data HOT 2
- Add support for multiple meters HOT 2
- Data for sensor.eloverblik_energy_statistic er forskudt med en dag. HOT 4
- Can't load statistic sensors HOT 6
- REFRESH TOKEN HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homeassistant-eloverblik.