openhab / openhab-addons

Add-ons for openHAB

Home Page:https://www.openhab.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[ephemeris] This dayset is not configured : weekend

lolodomo opened this issue · comments

With Main UI, when I link one of the channels "Weekend Today" or "Weekend Tomorrow", I got these 2 errors:

18:29:45.963 [WARN ] [hemeris.internal.EphemerisManagerImpl] - This dayset is not configured : weekend
18:29:45.970 [WARN ] [hemeris.internal.EphemerisManagerImpl] - This dayset is not configured : weekend

I have setup nothing for ephemeris, I am using the default settings:

image

Looks like Saturday and Sunday are setup by default as weekend days.

So why these warnings ?

@clinique for information

PS: Channel state is OFF which is normal as we are Monday. I would have to wait until Saturday to see if the channel state is properly updated to ON.

I added logs to see what is in the ephemeris configuration when it is activated.

https://github.com/openhab/openhab-core/blob/main/bundles/org.openhab.core.ephemeris/src/main/java/org/openhab/core/ephemeris/internal/EphemerisManagerImpl.java#L134

Here is the resumt:

19:09:19.869 [WARN ] [hemeris.internal.EphemerisManagerImpl] - ephemeris config key service.config.factory => false
19:09:19.871 [WARN ] [hemeris.internal.EphemerisManagerImpl] - ephemeris config key service.pid => org.openhab.ephemeris
19:09:19.872 [WARN ] [hemeris.internal.EphemerisManagerImpl] - ephemeris config key osgi.ds.satisfying.condition.target => (osgi.condition.id=true)
19:09:19.874 [WARN ] [hemeris.internal.EphemerisManagerImpl] - ephemeris config key service.config.category => system
19:09:19.875 [WARN ] [hemeris.internal.EphemerisManagerImpl] - ephemeris config key service.config.label => Ephemeris
19:09:19.876 [WARN ] [hemeris.internal.EphemerisManagerImpl] - ephemeris config key component.name => org.openhab.ephemeris
19:09:19.877 [WARN ] [hemeris.internal.EphemerisManagerImpl] - ephemeris config key component.id => 452
19:09:19.879 [WARN ] [hemeris.internal.EphemerisManagerImpl] - ephemeris config key service.config.description.uri => system:ephemeris

The code is expecting a key starting with "dayset-" to initialize a dayset. None is provided in the configuration and so it explains why dayset weekend is not configured.
Does it means it is an error in Main UI showing a wrong default ?

After updating the ephemeris settings, then it is OK and the warning disappears.

So the problem is of course not in the binding.

The problem is either in core that do not set a default weekend dayset. Or it is in Main UI that displays Saturday and Sunday as weekend days while in fact weekend dayset is not yet configured on server side.

After updating the ephemeris settings, then it is OK and the warning disappears.

So the problem is of course not in the binding.

The problem is either in core that do not set a default weekend dayset. Or it is in Main UI that displays Saturday and Sunday as weekend days while in fact weekend dayset is not yet configured on server side.

Maybe, I'll have a look. On my side, I use file based daysets, reason maybe when I did not see this issue.

Regarding the binding itself, it should ideally trigger channels refresh when the core ephemeris config is updated.
If I set Monday as weekend day, the channel "Weekend Today" remains OFF. It switches to ON If I relink the channel to the item.

@florian-h05 : how do you get the weekend days in Main UI for ephemeris settings?

Probably because of this default:
https://github.com/openhab/openhab-core/blob/main/bundles/org.openhab.core.ephemeris/src/main/resources/OH-INF/config/ephemeris.xml#L11

The problem could be in core that does not setup any default "weekend" dayset.

All service settings are entirely build on what the REST API returns ... Main UI just loads the config descriptions and the current config: https://github.com/openhab/openhab-webui/blob/df8ef84ff097dcce606115f084ba3daa8d319c88/bundles/org.openhab.ui/web/src/pages/settings/services/service-settings.vue

The problem could be in core that does not setup any default "weekend" dayset.

I think so, core seems to provide the wrong default.

I am going to submit a fix.