Sensor template updating too frequently

I’m using a sensor template to set up some times to trigger Presence Mimicking routines - this is currently set with a time-based trigger of midnight, as well as on system startup. The problem is, it is regenerating the times every minute, which I don’t really want as it could cause some routines to then not run, or run more than once (as well as, I would imagine, creating a resource overhead by running this 1440 times a day).

Is there any way to make this just run at midnight, to create the times for the coming day? Snippet of configuration.yaml in the picture

Hello Mike Osborne,

Maybe this will help.

1. Home Assistant Trigger

This triggers on system startup:

    platform: homeassistant
    event: start

2. Event Trigger

This triggers whenever the Template integration is reloaded (which happens on startup and other times):

    platform: event
    event_type: event_template_reloaded

Your example uses the Event Trigger. I suggest you try the Home Assistant trigger (and then restart Home Assistant).

@mikeosborne69 The actual problem here is the hyphen before sensor: which “orphans” the trigger section and creates a bunch of non-trigger-based template sensors. Remove that hyphen and all will be well.

See the first example here:

Please post code properly in future, not screenshots.

Thanks for this - apologies for the malformat, was stuck using a device that wouldnt let me copy the code (at work and the network blocks access to my HA instance through laptop so i was phone only)

1 Like