Hi,
FIX Edit: After once more carefully reading the documentation I noticed the state
instead of value_template
. The following worked and solved the issue
template:
# Ducobox Sensors
- sensor:
- name: "Ducobox Status"
state: "{{ state_attr('sensor.ducobox', 'state') }}"
Original issue below
Somehow this seems to stop working due to 2022.11, but I can’t find the reason nor a resolution.
I used to have the following setup to display a value from my REST API.
sensor:
- platform: rest
name: duco_sensor_ducobox
json_attributes:
- state
- trgt
- actl
- temp
- rh
value_template: 'OK'
resource: https://myurl.test/nodeinfoget?node=1
- platform: template
sensors:
# Ducobox
duco_ducobox_state:
unique_id: duco_docubox_state
friendly_name: "Ducobox State"
value_template: '{{ states.sensor.duco_sensor_ducobox.attributes["state"] }}'
I have switched my REST, and I noticed that {{ states.sensor.ducobox.attributes.state }}
isn’t recommended. I also noticed there is a new way in creating templates.
rest:
# Ducobox
- resource: https://myurl.test/nodeinfoget?node=1
scan_interval: 5
sensor:
- name: "Ducobox"
value_template: "OK"
json_attributes:
- "state"
- "actl"
- "trgt"
- "temp"
- "rh"
template:
- sensor:
- name: "Ducobox State"
value_template: '{{ state_attr('sensor.ducobox','state') }}'
The individual sensor isn’t displaying anything, but the REST sensor is (saying “OK”), and all the attributes show the right information.Now I can’t figure out how to make “state” a separate sensor so I can add it to the Lovelace dashboard. I now with the “entity” card can do this, but I do not like the size of the card. I want to have a simple list like the “entities” card
What am I missing?