Hi guys!
I have a RestAPI sensor reading the status of my dishwasher.
How can I display this status on the Picture Elements Card as an icon?
If ‘Status’ = ‘inactive’ then the icon should be gray and if the ‘Status’ <> ‘inactive’ then the icon should be red.
Thanks in advance!
Helmuth
sensor geschirrspüler:
- platform: rest
resource: http://10.10.1.4/ai?command=getDeviceStatus
name: Geschirrspüler
scan_interval: 15
json_attributes:
- Status
- Inactive
- Program
value_template: '{{ value_json.vzug }}'
- platform: template
sensors:
Status:
friendly_name: 'Status'
value_template: '{{ states.sensor.json_vzug.attributes["Status"] }}'
Inactive:
friendly_name: 'Inactive'
value_template: '{{ states.sensor.json_vzug.attributes["Inactive"] }}'
Program:
friendly_name: 'Program'
value_template: '{{ states.sensor.json_vzug.attributes["Program"] }}'