Hi everyone, I’m currently extracting a value from a JSON of my inverter with the following code
sensor:
- platform: file
name: SoC
file_path: /config/details.txt
value_template: "{{ value_json.paramCategoryList[5].fieldList[4].value | float(default=0) }}"
unit_of_measurement: "%"
what I get is a “sensor.soc” of a percentage value, but the automation does not recognize the value, for example when the number is greater than 50 the automation does not start.
Then, “file” does not allow you to assign classes to the identity
How can I convert “file” to a battery class sensor? Thank you