here is the json api:
{“id”:“jetnano01”,“description”:“MaskCam @ Jetson Nano”,“file_server_address”:“http://192.168.1.49:8080”,“statistics”:[{“device_id”:“jetnano01”,“datetime”:“2021-07-15T13:06:18.740421”,“statistic_type”:“REPORT”,“people_with_mask”:1,“people_without_mask”:0,“people_total”:1},{“device_id”:“jetnano01”,“datetime”:“2021-07-15T13:06:33.740174”,“statistic_type”:“REPORT”,“people_with_mask”:1,“people_without_mask”:0,“people_total”:1},{“device_id”:“jetnano01”,“datetime”:“2021-07-15T13:06:48.739909”,“statistic_type”:“REPORT”,“people_with_mask”:1,“people_without_mask”:0,“people_total”:1},{“device_id”:“jetnano01”,“datetime”:“2021-07-15T13:07:03.739594”,“statistic_type”:“REPORT”,“people_with_mask”:1,“people_without_mask”:0,“people_total”:1}
i want to get data of
- people_with_mask
- people_without_mask
- people_total
This is my config:
sensor:
-
platform: rest
name: “maskcam”
resource: “http://ipcam:554/devices/jetnano01”
value_template: “{{ value_json.statistics }}”unit_of_measurement: people
json_attributes:- people_with_mask
- people_without_mask
- people_total