Don't know where this error is coming from

Hi guys,

I am havin a long time this error and i did check every event/template/helper/automation.
i don’t know where it’s coming from

Any idea how i can log trace it to see what is causing it?

regards

2022-04-07 09:41:38 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'trigger' is undefined when rendering '{{ trigger.to_state.state != 'None' }}'
2022-04-07 09:42:38 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'trigger' is undefined when rendering '{{ trigger.to_state.state != 'None' }}'
2022-04-07 09:43:38 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'trigger' is undefined when rendering '{{ trigger.to_state.state != 'None' }}'
2022-04-07 09:44:38 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'trigger' is undefined when rendering '{{ trigger.to_state.state != 'None' }}'

This is what i did so far:

  • checked every running automation (nothing running that time)
  • turned off automations (still the error)
  • checked all entity that changed during this time (no entity change that time)
  • deleted all templates from yaml. (still the error)

I really don’t know where it’s coming from…

Well it seems that you may have a template that is causing the issue. With you deleting all the templates should have cured the problem, but you might have missed one. Something that you can do is use the Developer Tools and check to see if all your templates are correct. You just have to paste the template in and see if it gives you an error. This is where I would start.

I’m assuming you’re not manually triggering the some automation as part of testing. If you are, there is no trigger.

Otherwise, do you have automations that have e.g. both a state and time trigger? If you have a template that refers to fields that will only exist if the state trigger fires, but it actually triggered based on time, then you could get such an error.