Hello - sorry if that is the wrong place, i did not know where else i should ask.
I have a rest integration sensor where the value template works fine, but i can't get the attributes to work.
The Rest message that i get is the following:
{
"queue": 3,
"processing": 1,
"processed": 9434,
"time": "4:36:08",
"processingFiles": [
{
"name": "my_name",
"relativePath": "my_path",
"library": "my_library",
"step": "FFMPEG Builder: Executor",
"stepPercent": 49.23714
}
]
}
The yaml is as follows:
rest:
- resource: http://some_ip:19200/api/status
scan_interval: 30
method: GET
sensor:
- unique_id: fileflows_bigbox_queue
name: Fileflows Bigbox Queue
force_update: true
value_template: "{{ value_json['queue'] | int }}"
state_class: measurement
json_attributes_path: "$."
json_attributes:
- "processing"
- "processed"
- "time"
The value_template works fine and i get the queue length.
But i want the 3 other values as attributes, which i can't seem to get to work. I guess it has something to do with that they are on the root level?
Of course i could make separate sensors for that, but that would mean that i get a lot of sensors that in reality should belong together.
On a second note, independently from that: how should i configure a number sensor? It's not a "number" entity, as it is readonly, but it also does only have positive integers, because it is a count, but that is not available as a device-class.