Timer for my Lights

I’m really new to the home assistant, automation and stuff and thats high level for me :smiley:

Do I get that right, that the differents between the automation you wrote and the automation hellis wrote is, that yours only starts to trigger if the light level is below 30.
Hellis starts to trigger and then notices, ok light level below 30, no need to go on. and yours doesnt even start befor the light level is below 30.

I guess that helps when you got many automation that its not to much data for the home assisant to handle right?

Work smarter, not harder.

1 Like

Then again… However you code it, the code still needs to check the light level.
There is no or very minor difference when or where you check that.

But as noted before, mine would say it triggered when it actually didn’t turn on any lights.

1 Like

Okay, just wanted to understand the difference between the two automation.

Thanks for the help :slight_smile:

Its placement determines if the automation’s last_triggered is updated and if a trace is produced.

Ideally you want the automation’s last_triggered to be updated, and a trace generated, only if there was a genuine need to execute its actions. In other words, only when the automation does actual work.

One isn’t obligated to structure it that way but then the automation’s last_triggered is updated more frequently, with less meaningful values, plus a lot of worthless traces are created.

Sure… if the automation is an automation you actually care about and need to keep track of.
But for lights in at night?

I usually only put effort where it’s meaningful. But you are right that it updates the last triggered, just as I said just below the part you quoted.

Regardless of an automation’s perceived importance, when it malfunctions one might want to check its recent trace to see what went wrong. This may prove to be impossible if it records traces even when it’s unnecessary. The trace you need to see, at the moment when the malfunction occurred, may have already been discarded because, by default, it only stores the last 5 traces.

100times last-triggered-disk-writes vs 10times is in my opinion meaningful

In that case you shouldn’t have any motion detectors at all since they update and write to your disk.

well, my point was where ever one can minimize disk-writes one should/could , for same reason i i.e use only “include” in Recorder-settings and try to “use/think” in this term, whatever i “incorporate/create” in HA

Reducing usage, wear and tear, is essential and meaningful to me … I know :wink: i could live without HA as-well , but one gotta have some fun in life, even if it tears on ones patience :slight_smile: