Hi
I have the following automation and I would like to change the number 145 each month according to the below data. So October = 145 and November = 168 and so on. Can this be done?
So each month has a specific value?
If month = 10 (October) then AzMin (Azimuth minimum) = 145
If month = 11 then AzMin = 168
Then compare AzMin to sensor.sun_azimuth
To close some covers when sun approach my balcony. The truth is I have found that I need some more values ~3 or 4 for each month at least and now I am looking for a way to test them.
Why not use:
sensor.sun_elevation with sensor.sun_azimuth
then the month does not matter
With a compass and a protractor you should be able to easily figure out the conditions the sun hits where you donât want it.
Let me see if I can find a post someone had on mapping shadows, that might be handy to you in this case; at least it can give you your experimental information.
Now this is just personal preference:
I donât like calling the same function multiple times when the value will not change.
now().month will not change during this run, so, I would use a variable; however, variables can be finicky in HA. Not that speed is much of an issue here but it would run faster not calling multiple times.
That being said, if it works, use it.
No problem; I didnât try it myself. I just thought it should work, and give you can example of what I use that does. Why reinvent the wheel every time when you can just plagiarize from someone else.