Closed Pimentoso closed 1 year ago
Is there a way to configure the day/night axis to pull data from the sun entity?
A graph is build based on a particular entity, not some template. You have to create a template sensor for day/night and then use this sensor for the 2nd axis.
A possible example:
template:
- sensor:
- name: night
icon: mdi:power-sleep
state: >-
{% if is_state('sun.sun','above_horizon') -%}
{{ 0 | int }}
{%- else -%}
{{ 1 | int }}
{%- endif %}
type: custom:mini-graph-card
entities:
- entity: sensor.processor_use
- entity: sensor.night
show_line: false
show_fill: true
show_state: false
show_points: false
show_legend: false
y_axis: secondary
color: grey
hours_to_show: 72
points_per_hour: 60
line_width: 1
smoothing: false
aggregate_func: last
Please ask similar questions in the Community and leave Github for reporting bugs & feature requests. Let us know if you are satisfied with this answer, then the issue will be closed. Any further discussions may be continued in the Community.
Thanks @ildar170975 I still have a long way to go with yaml sensor syntax. This example is good enough for my use! Feel free to close this. I will use the community thread next time.
Hello, this is probably not the right place to ask this, feel free to redirect me somewhere else
I find adding a night overlay on 24-hour charts really useful, like in this example: https://github.com/kalkih/mini-graph-card#alternate-y-axis
Is there a way to configure the day/night axis to pull data from the sun entity?