Hi all,
I do need some help, guess its just a small thing but I can’t figure it out at the moment.
I want to change the value output from, lets say, “none” to “uit”.
The sensor gives the value “none” if the washing machine is doing nothing, so I want to have the value in the frontend set to “uit”.
type: custom:button-card
entity: sensor.wasmachine_washer_job_state
icon: mdi:washing-machine
show_name: false
font-size: 10px
show_state: true
styles:
card:
- height: 150px
- width: 150px
- font_size: 5px
state:
- value: none
color: rgb(125, 128, 130)
- value: wash
color: rgb(145, 229, 235)
- value: rinse
color: rgb(235, 180, 30)
- value: spin
color: rgb(30, 105, 235)
Though if I insert the if state like this it should work.
type: 'custom:button-card'
entity: sensor.wasmachine_washer_job_state
icon: mdi:washing-machine
show_state: true
state: >
{% if is_state('sensor.wasmachine_washer_job_state', 'none') %}
Uit
{% elif is_state('sensor.wasmachine_washer_job_state', 'wash') %}
Wassen
{% elif is_state('sensor.wasmachine_washer_job_state', 'rinse') %}
Spoelen
{% elif is_state('sensor.wasmachine_washer_job_state', 'spin') %}
Centrifugeren
{%- endif %}
- value: 'none'
color: rgb(125, 128, 130)
- value: wash
color: rgb(145, 229, 235)
- value: rinse
color: rgb(235, 180, 30)
- value: spin
color: rgb(30, 105, 235)
But it doesn’t.
Anyone knows the magic answer?