Migrate legacy file notify service

After installing 2024.6 I have a repair message that says:
image
I guess this relates to an automation which includes:

  - service: notify.energy
    data_template:
      message: >-
        {{ now().day}}/{{now().month}}/{{now().year}},{{
        now().hour}}:{{now().minute}}:{{now().second}},{{
        states.sensor.givtcp_ed2248g390_pv_energy_total_kwh.state }},{{
        states.sensor.givtcp_ed2248g390_import_energy_total_kwh.state }},{{
        states.sensor.givtcp_ed2248g390_export_energy_total_kwh.state}}

when I edit this automation I can see that the notify.energy service has a new format e.g.

  - service: notify.energy
    metadata: {}
    data: {}

but I can’t figure where to put my data template to make it work. Any ideas? TIA

this is just the notify format, not specifically notify.energy… and i think your notify.energy is actually using the file notify?

so if i’m understanding it right, perhaps just this?

- service: notify.energy
  data:
    message: >-
      {{ now().day}}/{{now().month}}/{{now().year}},{{
      now().hour}}:{{now().minute}}:{{now().second}},{{
      states.sensor.givtcp_ed2248g390_pv_energy_total_kwh.state }},{{
      states.sensor.givtcp_ed2248g390_import_energy_total_kwh.state }},{{
      states.sensor.givtcp_ed2248g390_export_energy_total_kwh.state}}

so “data_template” becomes “data” ?
Now I have this message:
image
My whole automation looks like this:

alias: 13. Energy hourly values
description: ""
trigger:
  - platform: time_pattern
    minutes: "59"
condition: []
action:
  - service: notify.energy
    data:
      message: >-
        {{ now().day}}/{{now().month}}/{{now().year}},{{
        now().hour}}:{{now().minute}}:{{now().second}},{{
        states.sensor.givtcp_ed2248g390_pv_energy_total_kwh.state }},{{
        states.sensor.givtcp_ed2248g390_import_energy_total_kwh.state }},{{
        states.sensor.givtcp_ed2248g390_export_energy_total_kwh.state}}
mode: single

which sat with an entry in configuration.yaml

#################################################################
# file notify                                                   #
#################################################################    
#notify:
#  - name: energy
#    platform: file
#    filename: /config/files/energy.csv
#    timestamp: false

Do I need to be looking for a new way to copy hourly values to a file?

this work for you?

alias: 13. Energy hourly values
description: ""
trigger:
  - platform: time_pattern
    minutes: "59"
condition: []
action:
  - service: notify.send_message
    target: 
      entity_id: notify.energy
    data:
      message: >-
        {{ now().day}}/{{now().month}}/{{now().year}},{{
        now().hour}}:{{now().minute}}:{{now().second}},{{
        states.sensor.givtcp_ed2248g390_pv_energy_total_kwh.state }},{{
        states.sensor.givtcp_ed2248g390_import_energy_total_kwh.state }},{{
        states.sensor.givtcp_ed2248g390_export_energy_total_kwh.state}}
mode: single

warning freehand coded this…

The error message is gone.
I’ll check the CSV fle later.
Thank you.

I use Node-Red but if I switch to the “notify.send_message” service I get an API error.
Service needs to be the phone in my case.

I don’t have an automation that uses the print_export file.

Any ideas why the error is still present.