Two weeks ago a made a trial to set up last OH5.2.0-Milestone and a I noticed about a strange issue in units of the Azymuth channel of Local Sun thing of Astro Binding. Perhaps wiith local Moon thing could be happening the same, but I don’t use this thing.
The Azymuth units range changed from 0 - 360º to -180º - 180º so all rules I had related with authomatic behaviour of shades and awnings started to work unproperly, with actions delayed for 12 hours.
I am not sure if its convenient to generate an official issue in Github in case of a Milestone OH version, or if it is better to build a post like this, but I think that this should be “polished” for next version.
I’m in -5 hr UTC, but I don’t think that has a bearing on Azimuth as the standard convention is 0 - 360. For now I’ve just added 180 to the reported Azimuth, but this should be fixed the binding.
I’m not saying that it should matter, but it could by mistake. If it works for some and not for others, the question is what’s different. But, -5 and +1 doesn’t explain a 180 degree shift.
edit: Maybe it’s a hemisphere bug. Are you by chance in the Southern Hemisphere?
I live in the east of Spain and what I noticed was a shift of one action’s rule that theoretically was happening around 8:00 to 20.00, then I noticed that all rules with a trigger and condition based on Azymuth’s Local sun had their actions shifted for 12 hours.
I think that is consistent with the astro mechanics. When the sun has a positive azimuth at mid day, I believe it should have (effectively) an equal negative azimuth at mid night. Or??
Azimuth is in the horizontal plane, 0 degrees is north, 180 south, clockwise. It’s not normal to use negative values, although you could argue that they are “valid”.
I am not arguing, neither about normality, nor about validity. Merely that as the OP observes, an “up” delta in the day translates effectively – 12 hours earlier/later – to an equivalent “down” delta. This is simply a hint to think about whichever math error is causing the OP’s issue. Or to say that the 12 hour inversion is most likely not an absolute longitude/time zone issue, nor probably an absolute latitude issue, but rather a simple math error.
I’m not sure that I understand. The error isn’t only that it’s in the -180 to 180 range, but that is seem to be 180 degrees off as well (I assume that 12 hours and 180 degrees is the same here). This sounds like a simple bug somewhere, but then @glhopital reports that it works correctly for him. They could be on different snapshots though, so not actually running the code. But, my idea was that if they run the same version of the code, and they have different results, then something in the configuration/data must be what triggers the bug. And, for this calculation input is only date/time, latitude and longitude as far as I can remember.
If the assumption that they run the same code isn’t the case, there’s no reason to look for configuration/data that triggers the bug, the bug could be permanent in some version of the binding.
Your point about different snapshots is right on target. I am running 5141. The problem may or may not be fixed in 5142 as that version is reported to not have the issue. However, that snapshot for docker is no longer available so I can’t test it. I will try a later snapshot when I get few minutes.
UPDATE:
I tried build 4143 and the Astro Binding is still reporting negative Azimuth values, the same as 4141.
UPDATE 2:
To further narrow the root cause, I uninstalled the Astro Binding 5.2 from my installation and used Astro Binding v5.1.1 in the Addons Folder. The results are as expected, Azimuth is reported as 0 - 360. This seems to indicate that changes made to Astro Binding v5.2 are the cause of the negative Azimuth values. While -180 to 180 “could” be a valid representation of Azimuth, it is not the generally accepted convention for reporting Azimuth.
Hello @John_Siemon , thanks for your update - and be happy: you’re no more the only one. I found the cause I did not have the same effect than you : a left binding version was present in /usr/share/openhab/addons - so I was not using the one from the snapshot.
Now it’s removed, and I observe your behaviour. I’ll be able to dig it. Let me start by opening an issue.