It’s a Broadlink driven British General smart socket.
It’s not coming from the app there is nothing set in it at all.
I used to have a routine in HA that turn on at sunrise but this has been removed.
It’s not turning on at 8 am it tracking the sunrise backwards as we head into summer.
I’m totally at a loss as to what is causing this. It’s definitely the sun rise trigging it so it must be from within HA as the app is totally absent of anything, and additional I have never used the app to do anything but set it up.
I don’t have Alexa and their is no trigger coming from Google I ha e triple checked this ther isn’t anything there.
There is no else case. Jinja if testes require an else case.
This makes no sense:
and states('sensor.date_time')
Likewise I am not sure what you are trying to accomplish here:
elif states('sensor.date_time')
If this is unrelated to your switch on issue would be best if you opened a new topic about this template (sensor?) explaining what you are trying to accomplish.
Agree, but orphan automations might have other errors, than not showing up in GUi. It is actually a long time since I experienced the error of automations not showing in GUI, might be a old problem.