Could you please send me the config for that night_time entity + automations, Iâll set it up and see if I can reproduce the issue, thanks!
Config looks good, Iâm not able to reproduce the issue either.
Iâm 99% confident youâre still loading the old version fo the card, we could easily figure this out if you create a very basic graph and try with and without the new smoothing option, do you see any difference?
I am not sure why (probably bad memory ) but I thought with card-mod I had to go and wrap everything inside another card, thatâs why it was scaring me
night_time:
name: Night Time
icon: mdi:theme-light-dark
min: 0
max: 1
step: 1
sensor:
platform: template
sensors:
day_night:
friendly_name: "Day/Night"
value_template: >-
{% if is_state('sun.sun', 'above_horizon') %}
Day
{% else %}
Night
{% endif %}
icon_template: >-
{% if is_state('sun.sun', 'above_horizon') %}
mdi:weather-sunny
{% else %}
mdi:weather-night
{% endif %}
automations:
To 1:
alias: System - Night Time On
initial_state: on
trigger:
- platform: state
entity_id: sensor.day_night
to: 'Night'
- platform: homeassistant
event: start
condition:
condition: and
conditions:
- condition: state
entity_id: sensor.day_night
state: 'Night'
action:
- service: input_number.set_value
data_template:
entity_id: input_number.night_time
value: 1
To 0:
alias: System - Night Time Off
initial_state: on
trigger:
- platform: state
entity_id: sensor.day_night
to: 'Day'
- platform: homeassistant
event: start
condition:
condition: and
conditions:
- condition: state
entity_id: sensor.day_night
state: 'Day'
action:
- service: input_number.set_value
data_template:
entity_id: input_number.night_time
value: 0
One thing I have noticed, is that when the card itâs using âbarâ mode, the night_time is showed as a bar rather than a âbackgroundâ as I would like, but on the lines (temperatures), it doesnât show at all
Wow⊠so how long ago did the card name change? I was using the old version all along⊠as soon as I changed to the new version, my colours started working in the graphsâŠ
Okay, that it shows as a bar in âbar modeâ is expected, thereâs currently no way of mixing bar and line graphs in the same card. In the example itâs just rendered as another line graph entity on a separate y-axis so that it span over the full graph height.
In HACS you mean?
I donât know to be honest, a few months ago I think, donât know exactly what version of HACS it changed in and couldnât find any mention of it in the HACS release notes.
The change has caused quite some headache for users of my cardsâŠ
Yeah⊠I guess I downloaded the updated card but never noticed the name had changed so I still had the old one AND the new one but because I didnât see to change the resources I was still using the old card.
Yeah I was going CRAZY with wondering why my colours wereât reacting to the different values of the lineâŠ
Turns out I still had the old mini-media card as well
So I thought some more about this and itâs actually possible to achieve.
If you set the option line_width to 0, bars/values at the lower bound should be completely hidden.
Hey, with last version of the card you should be able to use binary sensors directly in the card.
So if youâr light sensor reports itâs state as âonâ and âoffâ, consider a config like this:
- type: custom:mini-graph-card
name: Temperature
entities:
- entity: sensor.temp_sensor
- entity: binary_sensor.light_sensor
y_axis: secondary
aggregate_func: min
smoothing: false
color: black
show_line: false
show_points: false
points_per_hour: 6
line_width: 2
state_map:
- value: "off"
label: Lights off
- value: "on"
label: Lights on
Youâll want to set points_per_hour pretty high to be able to spot small durations of âLights onâ, you can also paly around with the aggregate_func option, max/min.
Nice!
Indeed, this feature allows for a whole bunch of new use cases!
OK. So I updated my binary sensor a little bit and input that as an entity to read in the mini graph card.
As a y_axis secondary, the values are 0 and 0. In a graph by itself it reads as NaN with no graph values.
Looking at my History panel, I see no line graph data for either the binary_sensor or the sensor template I created of the binary_sensory.
Could this be why there isnât data loading to the mini graph?