Is there a way to find out what triggered a light to trigger my automation?
I have 18 zigbee spots in the living room. I do have a switch that switches the power to those lights off, when all lights have been of for over 2 hours, thus saving electricity. Only when we use a switch again or it is at the time we would wake up, the switch switches the electricity back on. As soon as a light is detected in Zigbee, the state goes from unavailable to on. I detect that, and will switch the light to the required state (often Off). However, sometimes such a light will not respond, and within HA I will see the light is switched on again, without a ‘triggered by’.
I want to catch those un-triggered changes of state.
I seen an automation option of ‘triggered by’, but it states I must set ID’s to my automations, to use this function. However, I want those who do not have an ID. I just want to create one automation for all these lights, that sees when any of these lights go from off to on. There I want to filter out those that are triggered by automation, scripts, scenes and those who we switch on manually on our mobile (thus no automation). Only those who I see in my log as ‘switched on’, without any reason why, will then be switched off again in this automation.
Well, as mentioned, if you check the history of state of the lamp, you see things like ‘Triggered by automation ’ or ‘Triggered by action: Light switch off’. I want to have a trigger that acts when NO trigger is detected, thus when the log currently states ‘Switched On’. This happens when the light status is changed outside of the home automation, or (in my case) when the light has not processed the ‘Off’ request, and HA detects later that the state is currently (still) On and changes this in HA aswell.
I want to create an automation when that happens, so I can switch these lights off, when they should have stayed/been off.
Thank you, I was not aware this was called ‘Context’. As English is not my first language, the only way I knew how to descripe it, was ‘a change of state without automation’. I am greatfull that you were able to decipher my broken English.
I will try your sollution tonight, and will let you know if this was indeed the solution, as it now to me seems to be.