Run automation and the end of every hour problem

I want an automation to run at the end of every hour, eg 01:59 , 02:59 etc.
The problem is that it, for some reason, also runs every whole hour, ev 02:00, 03:00 , so it runs twice every hour.
How can I prevent that?

I use this code

alias: Save Consumption Every hour
description: ""
trigger:
  - platform: time_pattern
    minutes: /59
condition: []
action:
  - service: input_number.set_value
    data:
      value: "{{ states('sensor.accumulated_consumption_current_hour_hem') }}"
    target:
      entity_id: input_number.last_hour_consumption
mode: single

Ok.
I found the solution my self

trigger:
  - platform: time_pattern
    minutes: '59'
    seconds: '59'

That’s it. Reason explained in this recent post:

1 Like