Hi everyone, I have a single line text file that gets updated from an xml that stores a bunch of keywords and their values. I'm using a few 'platform: file' entries in the configuration.yaml to make into entities. Is there a better way to structure the code such its not repeating the same lines over, like 'file_path'?
sensor:
- platform: file
file_path: /config/dpool.txt
name: mainVolt
value_template: >
{{ value | regex_findall_index('<mainVolt>(.*?)<') }}
unit_of_measurement: "V"
- platform: file
file_path: /config/dpool.txt
name: carportVolt
value_template: >
{{ value | regex_findall_index('<carportVolt>(.*?)<') }}
unit_of_measurement: "V"
- platform: file
file_path: /config/dpool.txt
name: cpLgBattVolt
value_template: >
{{ value | regex_findall_index('<cpLgBattVolt>(.*?)<') }}
unit_of_measurement: "V"