I am trying to make two sensors for myself. One to calculate the size of the folder (it used to work), and the other to get a list of files in the directory. But they don’t work. Can you tell me why? The state is unavailable.
My sensors in packedges.
command_line:
- sensor:
name: folder_cam_captures_size
command: "du -sh /config/www/cam_captures | awk '{print $1}'"
unit_of_measurement: "KB"
unique_id: folder_cam_captures_size
and anothe (It was suggested to me by Chat GPT)
command_line:
- sensor:
name: file_list
command: "ls /config/www/cam_captures/2023-07-11"
scan_interval: 300
value_template: "{{ value.split('\n') }}"
json_attributes:
- files
By the way, what is the correct way to register two sensors together in one package?