diff --git a/source/_integrations/file.markdown b/source/_integrations/file.markdown index 2be2e1855fc..c9f4c9bc856 100644 --- a/source/_integrations/file.markdown +++ b/source/_integrations/file.markdown @@ -115,3 +115,30 @@ sensor: ``` {% endraw %} + +#### Entries as CSV + +Assuming the log file contains multiple values formatted as CSV like shown below: + +```text +timestamp,temperature,humidity +1631472948,21,39 +1631472949,22,36 +``` + +This would require the following entry in the `configuration.yaml` file to extract the temperature: + +{% raw %} + +```yaml +# Example configuration.yaml entry +sensor: + - platform: file + name: Temperature + file_path: /home/user/.homeassistant/sensor.csv + value_template: '{{ value.split(",")[1] }}' + unit_of_measurement: "°C" +``` + +{% endraw %} +