Automation not working but working

The following (simple) working automation started generating errors after upgrade to HA 2025 versions.

alias: "Time: Today's stats"
description: Call script to provide usage stats on water and energy every 3hrs
triggers:
  - trigger: time_pattern
    hours: /3
conditions: []
actions:
  - action: script.todays_stats
    metadata: {}
    data: {}
mode: queued

development template shows script syntax to be valid as well:

action: script.todays_stats
data: {}

I get this error in Settings page:

The automation "Time: Today's stats" (automation.time_today_s_stats) has an unknown action: script.todays_stats.

This error prevents the automation from running correctly. Maybe this action is no longer available, or perhaps a typo caused it.

The automation runs as expected.

I keep hitting ‘submit’ button on settings page to get rid of it, but it keeps popping back up. I’m sure its a simple goof-up but I can’t for the life of me figure it out.

It can’t find this script. So you should not try to fix automations, but look in scripts. Did you rename some script or script entity id? Are there errors in your log showing scripts don’t load properly?

Thank you, @Edwin_D

Are there errors in your log showing scripts don’t load properly?

The last screenshot is of the script (not the automation) running.

Did you rename some script or script entity id?

Not since year 2023. However, I can check core.entity_registry and report back shortly.

With errors in the log I mean Settings, System, Logfiles. If there is an error in a script above it in the file, it might affect all other scripts.

None which I could find.

core.entity_registry had the following entry:

      {
        "aliases": [],
        "area_id": null,
        "categories": {},
        "capabilities": null,
        "config_entry_id": null,
        "config_subentry_id": null,
        "created_at": "2024-12-27T20:15:57.966179+00:00",
        "device_class": null,
        "device_id": null,
        "disabled_by": null,
        "entity_category": null,
        "entity_id": "script.todays_stats",
        "hidden_by": null,
        "icon": null,
        "id": "c2397dbfc08e458d351bb4af75b2910f",
        "has_entity_name": false,
        "labels": [],
        "modified_at": "2025-03-25T18:51:01.072959+00:00",
        "name": null,
        "options": {
          "conversation": {
            "should_expose": false
          }
        },
        "original_device_class": null,
        "original_icon": "mdi:calendar-badge-outline",
        "original_name": "todays_stats",
        "platform": "script",
        "supported_features": 0,
        "translation_key": null,
        "unique_id": "todays_stats",
        "previous_unique_id": null,
        "unit_of_measurement": null
      },

what caught my eye was the unique_id entry. So, I’ve changed it

"unique_id": "ecf5a307b6bb41a2be82072d17530300_todays_stats"

At the next reboot, I’ll see whether the problem is resolved.

I doubt that is the case.The unique_id is not a required property but used for UI configuration. Also because the changes you make if HA is running get overwritten. Editing storage is not advised if you are not 100% sure you know what you are doing.