I have a conditional card show when my vacuum is in “error” state, i also have an entity which states the error as a raw, numerical value (1,2,4,6,8,etc)
I can’t get my head around templates yet but i know its possible to translate the number value into a message and i know what i want to say but can’t write the template to do it as i dont understand it just yet
I have an automation to notify me of the errors which works well, i just want a conditional card to say the same thing as my notification does…
YAML for my automation…
description: ""
trigger:
- platform: state
entity_id:
- vacuum.cybovac
to: error
condition: []
action:
- if:
- condition: state
entity_id: sensor.cybovac_fault
state: "1"
then:
- service: notify.notify
data:
message: Cliff Error
title: Cybovac
- if:
- condition: state
entity_id: sensor.cybovac_fault
state: "2"
then:
- service: notify.notify
data:
message: Roller Brush Error
title: Cybovac
- if:
- condition: state
entity_id: sensor.cybovac_fault
state: "4"
then:
- service: notify.notify
data:
message: Left Wheel Fault
title: Cybovac
- if:
- condition: state
entity_id: sensor.cybovac_fault
state: "8"
then:
- service: notify.notify
data:
message: Right Wheel Fault
title: Cybovac
- if:
- condition: state
entity_id: sensor.cybovac_fault
state: "16"
then:
- service: notify.notify
data:
message: Bin Full
title: Cybovac
- if:
- condition: state
entity_id: sensor.cybovac_fault
state: "32"
then:
- service: notify.notify
data:
message: Edge Brush Fault
title: Cybovac
- if:
- condition: state
entity_id: sensor.cybovac_fault
state: "64"
then:
- service: notify.notify
data:
message: Collision Error
title: Cybovac
mode: single