I did create an graph with mini-graph-card. Showing my energy consumption.
It is working fine.
Because I do use solarpannels it can also be a negative value.
Now the graph shows no 0-line and the difference between negative and positive value is hard to see.
I like to add an x-as 0-line.
I’m not able o fix it:
Exactly. I was thinking the same.
But I’m not able to add the extra sensor
giving error.
Any code advice?
(I’m not very good in coding)
Lets say there is a sensor.zero
Sorry but i’am new to programming. Could you tell me how to make the 0-line sensor? Could you share the yaml-code so i can do the same in my graphs? Thanks!
note that i used rgba because i wanted the opacity variable so i set it 0.2, i thought i looked nicer.
the extra addition is the grey block which represents nighttime from sun.sun
my orange section is what i define as normal consumption so i can see when im power positive or not
for my watt consumption vs generation this is my configuration.yaml code
- platform: template
sensors:
greenhousev2_consumption_amps:
friendly_name: 'Consumption Amps'
device_class: current
value_template: >-
{% set b = (states.sensor.greenhousev2_ina219_1_current.state | default(0) ) | float(2) %}
{% set s = (states.sensor.greenhousev2_ina219_2_current.state | default(0) ) | float(2) %}
{{ (s-b) | round(2)}}
greenhousev2_consumption_watts:
friendly_name: 'Consumption Watts'
device_class: power
value_template: >-
{% set b = (states.sensor.greenhousev2_ina219_1_power.state | default(0) ) | float(2) %}
{% set s = (states.sensor.greenhousev2_ina219_2_power.state | default(0) ) | float(2) %}
{{ (s-b) | round(2)}}