Hiya
I have this:
value_template: >-
{% if (states.sensor.washer_program_length.state | int) < 1 %}
0
{% else %}
{% set washerprogress = (100 - (((states.sensor.washer_remaining_time.state | int) / (states.sensor.washer_program_length.state | int)) * 100)) %}
{{ washerprogress }}
{% endif %}
icon_template: mdi:washing-machine
which gives me the likes of this:
How do I drop all decimal points? E.g. here just 51 %
Sorry I know it’s been asked before, but the examples I found all look quite different, and I’m pretty new to this.
Not sure if it can be done simply in the card, or should be done in the template.
This is the card, FWIW:
type: custom:stack-in-card
mode: horizontal
title: Washing Machine
cards:
- type: gauge
entity: sensor.washer_progress
min: 0
max: 100
unit: '%'
- type: entity
entity: sensor.washer_state
name: Wash Cycle
icon: hass:none
- type: entity
entity: sensor.washer_remaining_time
unit: Minutes
state_color: false
name: Remaining
icon: hass:none
square: false
Much appreciated!!
Paul