Open volkuhl opened 4 months ago
If anyone is interested, here is my workaround: Define a sensor template in configuration.yaml
- platform: template
sensors:
val_shelly006:
unique_id: val_shelly006
friendly_name: "Value Shelly006 IR-Heizung Werkstatt"
unit_of_measurement: "W"
value_template: >-
{% if is_state("switch.shell_006", "unavailable") -%}
{{ 0 }}
{%- else -%}
{{ states("sensor.shell_006_power")|float }}
{%- endif %}
In the bar card, references to template-sensor instead of directly to the power sensor:
- entity: sensor.val_shelly006
name: Heiz.Werkstatt
severity:
- from: 0
to: 0.1
hide: true
It works well, but could be much easier to have a "switch" in the bar-card directly, instead of having to create a template for each sensor
Even when the bar-card
is hidden by it's native hide
option (for supported numerical values), the card anyway occupies some space (https://github.com/custom-cards/bar-card/issues/167).
For unavailable
value - you may use a standard conditional card/row to hide the whole bar-card. But the "hidden" row also occupies some space (https://github.com/home-assistant/frontend/issues/7292).
So, the only option to hide the card totally - card-mod & display: none
.
Thanks for this pretty card! Hiding bar depending on value works like a charm. Would be nice, if I can hide the bar also, when sensor is unavailable.