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.