Using the card to display sensors’ change with “Day / Night” as a background graph:

type: 'custom:mini-graph-card'
entities:
- entity: sensor.cleargrass_1_co2
name: CO2
color: green
unit: ''
show_state: true
show_indicator: false
show_graph: true
show_line: true
show_fill: true
show_points: true
show_legend: false
state_adaptive_color: false
fixed_value: false
- entity: binary_sensor.night
name: Day/night
color: 'rgba(50,73,92,0.85)'
unit: ''
show_state: false
show_indicator: false
show_graph: true
show_line: false
show_fill: true
show_points: false
show_legend: false
state_adaptive_color: false
fixed_value: false
aggregate_func: min
y_axis: secondary
name: CO2
hours_to_show: 24
points_per_hour: 60
aggregate_func: last
update_interval: 0
height: 150
line_width: 1
hour24: true
lower_bound: ~400
lower_bound_secondary: ~0
smoothing: false
show:
name: true
icon: true
state: true
graph: true
fill: fade
points: true
legend: false
average: false
extrema: true
labels: true
labels_secondary: true
state_map:
- value: 'off'
label: '0'
- value: 'on'
label: '1'
Recently I realized that the browser is flooded by warnings:
I suspect that this happens since the
"state_map"
is provided only for one graph.
So this issue -
https://github.com/kalkih/mini-graph-card/issues/271 - is more important, it is not just an “improvement”.
Another case - let’s use only ONE graph with state_map like this:
state_map:
- value: unavailable
label: Sensor off
- value: unknown
label: Sensor off
Even now we have to receive lots of warnings.
So my proposal is:
- provide
"state_map"
for all entities;
- meanwhile DISABLE these warnings.