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

How to show sensor as a custom state?

$
0
0

@membersound wrote:

I created a sensor that shows an integer as state, fetched from a web api.
Now I’d like to give those integers a meaningful name in the ui, or even for use in automations. Is that possible?

sensor:
  - name: Door State
    platform: rest
    resource: 'apicall'
    value_template: '{{ value_json.state}}'
    scan_interval: 60

I’d like to set:
1 = locked
2 = unlocked
3 = open

Because currently the sensor os shown as “1” in the HA overview, and in a few weeks I will have forgotten which those numbers stand for. Or even in automations: when I check sensor.state = 1, this won’t help be when modifying the automation in a few weeks. But sensor.state = 'locked' would help.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95478

Trending Articles



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