Thanks for the information - I don’t have an ephemeris.cfg file as the docu states that you can set them in the UI (which I did) otherwise if no country is selected the system defaults are taken.
I’ll give it a try with the config file this evening and report if it worked.
Yes. But I remember problems using ephemeris not working if you do not provide the xml file. I might be wrong though.
The xml file could include “custom” holidays. In fact this is where the regular holidays are stored.
So I tested this and added an ephemeris.cfg file. During startup I can see this in my logs, those settings were set in UI:
2023-02-20 20:43:28.714 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'Europe/Vienna'.
2023-02-20 20:43:28.847 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Location set to '47.65,12.21'.
2023-02-20 20:43:28.851 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'de_DE'.
2023-02-20 20:43:28.854 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Measurement system set to 'SI'.
Under $OH_CONF/services I have a ephemeris.cfg like in the documentation stated. The file contains these lines:
Under $OH_CONF/services there is a Holidays_de.xml with the content provided here
So my rule is working now for reasons I can’t get though…
The only thing I’d expect when using actions.Ephemeris.isWeekend() is that it should return a boolean value. Instead I get undefined. Anything I am missing?
For any reason it is working now … I’m not sure why it didn’t before…
I restarted via service openhab restart (I assume this doesn’t delete any cache). So now I’m having Holiday.xsd, Holidays_de.xml and Ephemeris.cfg under $OH_CONF/services.
For me this sounds like a BUG that setting country and weekend leads to undefined in OH3 JSRules ¯_(ツ)_/¯.
I updated OH to 3.4.1 after release (8th of Jan according to GitHub) and I updated my ressources to the latest version of openhab-js in package.json and installed all dependencies. So they were up to date.
The only thing I haven’t tested so far is, whether or not I set lang, location etc. in system settings (not OH). As the documentation states If no country is provided the service uses your system default locale settings.