Automation: trigger every X minutes based on state of an entity

I’m trying to show a notification on the tv every 30 mins.
I’ve tried the time_pattern for: ‘/30’ minutes. it works for every 30 minutes based on the time, not the actual usage of the Wii u. and when using the for: minutes: ‘30’. it only triggers once for the first 30mins

thanks in advance,

alias: 'testing TV notification'
    initial_state: true
    trigger:
        platform: state
        entity_id: switch.wii_u
        to: 'on'
        for:
            minutes: '30'
    action:
        service: notify.lg_tv
        data_template: 
            message: "Played {{(((as_timestamp(now())-as_timestamp(states.switch.wii_u.last_updated))/60) | round(0))}} minutes, Take a break"`

Take a look at the alert component - it will send notifications based on intervals as long as the ‘trigger condition’ is fulfilled:

Thank you
This is exactly what I needed.

1 Like