Hi all
I have a template sensor that displays my google home mini’s volume and buttons to set 10%, 20% etc…
The problem is when the googles arent playing this state attribute is hidden and in floorplan that shows as “NaN” on my SVG.
is it possible to somehow hide when unknown or display something else ?
Here is my template
- platform: template
sensors:
bathroom_mini_volume:
value_template: '{{ states.media_player.bathroom_speaker.attributes.volume_level | multiply(100) | round(0) }}'
friendly_name: 'Bathroom Volume'
unit_of_measurement: "%"
And my floorplan
- name: volume_level
entities:
- sensor.bathroom_mini_volume
- sensor.bedroom_mini_volume
- sensor.audio_cast_volume
- sensor.kitchen_mini_volume
- sensor.tv_mini_volume
- sensor.spare_mini_volume
text_template: '${entity.state ? Math.ceil(entity.state) + "%": "undefined"}'
class_template: 'return "volume_level";'