I would like to define some new sensors, but with only one rest call. Result is
{
"devices": [{
"deviceID": "abc",
"measurement": {
"id": "fsdafsdfdsafsd",
"deviceID": "abc",
"timestamp": "2026-06-09T13:24:34Z",
"lowBattery": false,
"transmissionCounter": 12033,
"sensorValues": [{
"value": 4.7,
"valueType": 0,
"noConnection": false,
"overflow": false
}],
"created": "2026-06-09T13:24:40.7865701Z"
}
}, {
"deviceID": "def",
"measurement": {
"id": "fsdafsdfa",
"deviceID": "der",
"timestamp": "2026-06-09T13:23:18Z",
"lowBattery": false,
"transmissionCounter": 12033,
"sensorValues": [{
"value": -20.700000000000003,
"valueType": 0,
"noConnection": false,
"overflow": false
}],
"created": "2026-06-09T13:23:24.363331Z"
}
}, { ...
But currently all my ideas are stuck.
# - name: "TFA Sensor Gerät abc"
# unique_id: sensor_geraet_BC
# value_template: >
# {% set device = value_json.devices | selectattr('deviceID', 'eq', 'BC') | first %}
# {{ device.measurement.sensorValues[0].value | round(2) if device is defined else 'unknown' }}
# attributes:
# low_battery: >
# {% set device = value_json.devices | selectattr('deviceID', 'eq', 'BC') | first %}
# {{ device.measurement.lowBattery if device is defined else 'unknown' }}
is not working, because attributes seems not be supported here.
- name: SensorHub
value_template: "{{ value_json.generated }}"
json_attributes:
- devices
with template sensors afterwards not working either and bringing back only first device
Using single paths seems only to work wtth 0, 1, 2, but if this is not stable
- name: TFA abc
value_template: "{{ value_json.devices[1].measurement.sensorValues[0].value }}"
json_attributes_path: "$.devices[1].measurement"
json_attributes:
- lowBattery
json_attributes_path: "$.devices[?(@.deviceID=='abc')].measurement"
Such filters are supported and only do not work here?
Any hint or idea?