-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add instructions for using sun2 sensors in automations #128
Comments
That is almost never the right approach to an automation.
By "nautical sunset" do you mean nautical dusk (i.e., sun is 12 degrees below the horizon)? So, which do you want the automation to trigger on - sunset or nautical dusk?
The sun phase sensor has a Probably the easiest way to trigger an automation at sunset is to define the elevation binary sensor with an elevation threshold of Or if you use the sun phase sensor, then trigger when it changes from |
Sounds good - thanks for the thorough and timely reply! I know it's not typically best practice to trigger every second and then bail out based on a condition.. I'm curious if there's any real significant penalty to doing this, as it can make the logic easier to set up in some cases (this is a more general question, rather than something specific to sun2) Re: sunset vs nautical dusk, I still need to play around with it to get a feel for what it's like outside at my location at those times. Using a custom binary sensor makes a lot of sense. I think what I ended up doing was using "next nautical dusk" "changed" as my conditions, but that won't have the flexibility of offsetting to fine tune. Going back to the original intent of opening the ticket - it would be great if the guidance you gave me was integrated into the readme at some point for the benefit of others. Thanks again! |
There is much more work for the system to do if you're firing an automation every second and then having it check conditions as opposed to just triggering on the event(s) you're interested in. Will you ever really notice the difference, though? Depends on how powerful your system is, how much other stuff you're asking it to do, etc., etc. In my mind, it's more "logical" to define the trigger(s) based on the event(s) that should cause the automation's actions to run rather than waking up every second and asking, "are we there yet"? But then, everyone has their own way of looking at things, so do whatever makes the most sense to you. In programming, generally it's better to worry about functionality first, and then optimize if/when it's necessary.
That's just one of many possible use cases. The docs are really meant to explain what the integration does, not necessary how it might be used. Obviously, some examples could be added, but I'm really not interested in doing that at this time. |
I'm also playing with this and I'm currently trying to figure out how to turn on a switch at golden hour in the evening. Could you give a quick explanation for that, please? Still finding my way with HA. By the way - I enabled deCONZ, and noticed it mentions "nautial dusk" instead of "nautical dusk". |
Enable the phase sensor, then trigger on its
Good catch. That's a typo in the English translation file. I'll fix it. Thanks! |
Hola! I love this package. So good.
I am trying to set up an automation to trigger at sunset. Currently, it isnt clear to me if I should:
Assuming there's no sensor that has the current sun's risingness/settingness (which is what the builtin Sun integration provides, e.g. trigger on sunset / trigger on sunrise), it would be great if the documentation (README.md) was updated with a little info on the best way to trigger automation based on sun state.
The text was updated successfully, but these errors were encountered: