Closed Saentist closed 2 years ago
Hi, thanks for your report. Could you please provide your full card configuration & can you please confirm that the entity does (still) exist?
Entity exist im use it in other cards
- type: custom:mini-graph-card
name: Temperature
icon: mdi:thermometer-lines
hour24: true
line_width: 2
animate: true
entities:
- entity: sensor.outdoor_temperature
- entity: input_number.nighttime
name: Night
show_line: false
show_points: false
show_legend: false
y_axis: secondary
hours_to_show: 168
show:
fill: true
extrema: true
labels: true
labels_secondary: true
color_thresholds:
- value: -5
color: '#1286f3'
- value: 0
color: '#e317c4'
- value: 15
color: '#f5f1a9'
Could you provide the config of your number helper; and/or perhaps a history of it? I just did a quick extra test using 0 & 1 as values on an input_number, but this works fine.
Can you try a browser refresh clearing cache to ensure it's not a weird caching-related issue?
# time date
- platform: time_date
display_options:
- 'time'
- 'date'
- 'date_time'
- 'date_time_utc'
- 'date_time_iso'
- 'time_date'
- 'time_utc'
- 'beat'
- 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 %}
It looks like you're referring to input_number.nighttime
in your template, but are actually using sensor.day_night
?
But how is changed from sensor.day_night to input_number.nighttime? I dont change this from year
p.s. even with corected name it not show night graph as before.
I can't provide you an answer to that, the config you provided above indicates you created a sensor.day_night
, and the error implies that the input_number.nighttime
no longer exists.
There was a recent fix to more properly report configuration errors, so perhaps 0.10 was just silently failing on that missing entity for you?
even with corected name it not show night graph as before.
What are you getting now & what are you expecting?
this is now 1 week but no night background Must be some as this
when i point Night i get NaN
You would need something like a state_map to do this within mini-graph-card https://github.com/kalkih/mini-graph-card#non-numeric-sensor-states
Could it be that you accidentally deleted your input_number.nighttime
which was providing day/night as a simple 1
/0
numeric value?
p.s.: Binary input doesn't have ideal support yet (#505) but your case just seems to be a string; not a binary
But how is changed from sensor.day_night to input_number.nighttime?
Use the same entity in the card as you specified in configuration for this purpose. Otherwise the issue is meaningless and is not supposed to be even raised.
What you can do is:
sensor:
- platform: template
sensors:
night:
icon_template: mdi:power-sleep
value_template: >-
{% if is_state('sun.sun','above_horizon') -%}
{{ 0 | int }}
{%- else -%}
{{ 1 | int }}
{%- endif %}
- entity: sensor.night
color: some semi transparent color (darkish for light theme)
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: last
y_axis: secondary
Surely you may use a binary_sensor
alternatively + state_map
but the state_map
is currently not supported per-entity and you'll see warnings in the browser then.
Answers were given.
After update to latest version v0.11.0 card refuse to use day/night binari sensor.
message
In version v0.10.0 there was no problem.