Hi,
I have defined a RESTful-Sensor:
resource: "http://xxx:61208/api/3/fs"
sensor:
- name: "Data FS /"
unique_id: data_fs_root
json_attributes_path: $.[?(@.mnt_point == '/')]
state_class: measurement
json_attributes:
- device_name
- fs_type
- mnt_point
- size
- free
- percent
value_template: "{{ (value_json|selectattr('mnt_point','eq','/')|first)['used'] }}"
This is a call to the Glances-Service on my Homeserver.
The call works and I get the following result:
state: 3012525264896
state_class: measurement
device_name: /dev/sdj1
fs_type: ext4
mnt_point: /mnt/extUsb
size: 11904378875904
free: 8291829956608
percent: 26.6
friendly_name: Data FS ExtUsb
Is there a way to format the values? I know I can do it with the value_template. What about the json_attributes? I would like to avoid a template sensor just to format them.
Best regards
Goran