Bar Graph with relative energy consumption (network, sold, and solar consumed) #379
luissimoes
started this conversation in
Show and tell
Replies: 1 comment
-
Hi
Sorry somehow this went to junk, then I didn’t check, then….
Sorry!
So to your point: can it be that before 8th Mai you didn’t have “eigengebraucht”?
Luis
… On 8. May 2024, at 19:52, leon2908 ***@***.***> wrote:
Hello, I really like the graphics. Great job. I wanted to use it in my Homeassistant but I can’t find my mistake here, can anyone help me? Thanks in advance.
Greenshot.2024-05-08.19.47.32.png (view on web) <https://github.com/dbuezas/lovelace-plotly-graph-card/assets/1901976/f3ae73e9-dfec-444a-9d4b-376e1dc2eabb>
Here is my Code:
`type: custom:plotly-graph
entities:
entity: sensor.daily_energy_eigenverbrauch4
texttemplate: '%{y:.2f}'
textfont:
size: 13
color: '#ffffff'
name: Vom Netz
type: bar
statistic: state
period: day
marker:
color: '#E4443F'
opacity: 0.9
filters:
filter: i>0 && i < xs.length - 1
fn: |
({ys,xs,hass}) => ({
xs: [...xs, new Date().setHours(0,0,0)],
ys: [...ys, hass.states['sensor.daily_energy_eigenverbrauch4'].state],
})
entity: sensor.daily_energy_einspeisung
texttemplate: '%{y:.2f}'
textfont:
size: 12
name: Verkauft
type: bar
statistic: state
period: day
marker:
color: '#F1E1A6'
opacity: 0.7
filters:
map_y_numbers: y *(-1)
filter: i>0 && i < xs.length - 1
fn: |
({ys,xs,hass}) => ({
xs: [...xs, new Date().setHours(0,0,0)],
ys: [...ys, hass.states['sensor.daily_energy_einspeisung'].state * (-1)],
})
entity: sensor.pv_eigennutzen_graf
texttemplate: '%{y:.2f}'
textposition: outside
textfont:
size: 12
name: Pv eigenverbraucht
type: bar
statistic: state
period: day
marker:
color: '#97cd07'
opacity: 0.75
filters:
filter: i>0 && i < xs.length - 1
fn: |
({ys,xs,hass}) => ({
xs: [...xs, new Date().setHours(0,0,0)],
ys: [...ys, hass.states['sensor.pv_eigennutzen_graf'].state],
})
entity: sensor.daily_energy_eigenverbrauch4
type: indicator
mode: number
value: $ex ys.at(-1)
bgcolor: black
title:
text: Vom Netz
font:
size: 8
number:
suffix: ' kWh'
valueformat: '0.11'
font:
size: 14
color: '#E4443F'
domain:
x:
- 0.9
- 1
'y':
- 0.9999
- 1
entity: sensor.daily_energy_einspeisung
type: indicator
mode: number
value: $ex ys.at(-1)
bgcolor: black
title:
text: Verkauft
font:
size: 8
number:
suffix: ' kWh'
valueformat: '0.11'
font:
size: 14
color: '#F1E1A6'
domain:
x:
- 0
- 0.2
'y':
- 0.9999
- 1
layout:
barmode: relative
bargap: 0.2
uniformtext:
minsize: 12
mode: show
modebar:
orientation: h
remove: pan
margin:
t: 25
l: 30
r: 30
height: 500
legend:
'y': -0.25
x: 0.02
xaxis:
gridcolor: rgba(238,235,235,0.3)
showgrid: true
linewidth: 0
linecolor: null
nticks: 6
tickformat: |-
%d %b
%Y
yaxis:
visible: false
hours_to_show: 5d
refresh_interval: auto
title: Übersicht
view_layout:
grid-area: detail5
`
—
Reply to this email directly, view it on GitHub <#379 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AKE3B7S2ZUSU4XGEQVIZJ3LZBJQ47AVCNFSM6AAAAABDWTWUU6VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TGNJYGQZDE>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Perhaps this is interesting to someone else.
There are 3 entities:
(I clearly should have a battery to store the extra solar... it will come soon ;-) )
This is the end result.
Details:
The graph is stapled and relative. I plotted the sold energy as negative.
Yaml for the graph
Template
Beta Was this translation helpful? Give feedback.
All reactions