Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 106800

RestAPI sensors

$
0
0

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"] }}'

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 106800

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>