Write charging data to a file in Home Assistant using the notify.file integration

I’m trying to log power data to a CSV file from Home Assistant using the Notification to File integration, but I’m hitting an error.

What I’ve done:

  • Home Assistant OS 2025.6.1
  • Installed the “Notification to File” integration via Settings > Devices & Services > Add Integration
  • Set the file name to charging_log.csv (full path: /config/charging_log.csv)
  • The file exists and is writable
  • No notify: section in configuration.yaml
  • Restarted Home Assistant fully (not just YAML reload)
  • Integration appears as:
Integration entries
Notify [charging_log.csv]
1 entity

Automation used:

alias: Log power to file every 5 minutes
trigger:
  - platform: time_pattern
    minutes: "/5"
action:
  - service: notify.notify_charging_log_csv
    data:
      message: "{{ now() }},{{ states('sensor.positive_active_power') }}"
mode: single

Error shown when automation runs or I trigger the service manually:

Error: Action notify.notify_charging_log_csv not found

I cannot find the service in Developer Tools → Actions either.

Any ideas what I’m missing?

File was updated in 2024.05 to the new entity-based notification method.

The service/action should be notify.send_message:

alias: Log power to file every 5 minutes
triggers:
  - trigger: time_pattern
    minutes: "/5"
actions:
  - action: notify.send_message
    data:
      message: "{{ now() }},{{ states('sensor.positive_active_power') }}"
    target:
      entity_id: notify.notify_charging_log_csv
mode: single

If the above doesn’t work, check your entities to confirm that the notify entity’s ID matches.