bp2008 / DahuaSunriseSunset

A Windows Service which changes the profile of dahua cameras between Night and Day at each sunset and sunrise.
GNU General Public License v2.0
19 stars 8 forks source link

WinOS with engl. language but german keyboard - time not correct #10

Closed kuzco1 closed 2 years ago

kuzco1 commented 2 years ago

Hello, I have some issues with this great tool an the set of sunset and sunrise. I am running Win2019 HomeServer (english, display language englisch but keyboard german and country region german). This means: Short date: 07.06. 2022 Long date: Dienstag, 07.06.2022 Short time: 21:13 Long time: 21:13:51

My area is: Long: 51.374336 Lat: 6.938794

However, if I user the above 51.374 / 6.938 the parameter are not saved correctly. They are saved as 51374 and 6938, which means that "View sunrise/sunset" gives an error. Therefore I am using only 51 and 7. "View Sunrise/Sunset" is now 07.06.06.2022 21:43:41 and 08.08.2022 05:20:20 which is correct. I am uisng "Sunrise/Sunset Offset Hours" 1/-1 which shows: 07.06.06.2022 22:43:41 and 08.08.2022 04:20:20 So far so good.

If I now (07.06.06.2022 21:28:41) start the service the profiles goes to the "Night profile" !!

Something is wrong with time setting (perhaps due to german region ?).

kuzco1 commented 2 years ago

One more comment: I am running in timezone UTC+1, but we have now summertime - this means it is UTC+2.

bp2008 commented 2 years ago

That is strange. I find it hard to believe that Microsoft's XML Serializer would get decimal numbers wrong in your region.

Have you tried entering your location using comma instead of period as the separator between integer and decimal? Like these 51,374336 and 6,938794. I think that is the correct number format for Germany...

I am also concerned about your date formats. Are there typos when you wrote 07.06.06.2022 21:43:41 and 08.08.2022 05:20:20?? I cannot make sense of these. Why is the first date string longer? And why so far apart from the second date?

kuzco1 commented 2 years ago

Thanks for your fast feedback. Yes, Have tried 51,374336 and 6,938794 and this will be saved correctly The sunriseset (08.08.2022) was a typing error - so sorry for the confusion - it was of course 08.06.2022. However, it seems that the summertime (+1 hour) and UTC+1 makes some chaos. Is there any way to create a log or is the any chance to see a "counter" when the service will active day/night (for example: day will be activate in 05:34:12 - means day will be activated in 5 hours, 34 min. 12 secs ?

bp2008 commented 2 years ago

Check DahuaSunriseSunsetErrors.txt in the same directory as the .exe file.

The service logs TriggerSunriseActions and TriggerSunsetActions each time those events occur.

kuzco1 commented 2 years ago

Will do and will send feedback.

kuzco1 commented 2 years ago

It is strange. Now it is working. I have no clue what was happening before. Please close the case. Many thanks.