Marfi
(Martin)
July 23, 2019, 9:50pm
1
Hello everybody,
I’m using 2 Astro things: one regular one and one with an offset:
astro:sun:home [ geolocation="x,y", interval=300 ]
astro:sun:minus60 [ geolocation="x,y", interval=300 ] {
Channels:
Type rangeEvent : set#start [
offset=-60
]
}
But the “minus60” does not seem to work correct. In the logs I can see that both channels trigger at the same time:
2019-07-23 21:28:00.030 [vent.ChannelTriggeredEvent] - astro:sun:minus60:set#event triggered START
2019-07-23 21:28:00.036 [vent.ChannelTriggeredEvent] - astro:sun:home:set#event triggered START
I set up some variables to see if the times are correct.
DateTime Sunset_Light "Sunset Light[%1$tH:%1$tM]" <sun> (gAstro) {channel="astro:sun:minus60:set#start"}
DateTime Sunset_Time "Sunset [%1$tH:%1$tM]" <sunset> (gAstro) {channel="astro:sun:home:set#start"}
The values seem to be ok:
Sunset_Light is 2019-07-23T20:28:00.000+0200
Sunset_Time is 2019-07-23T21:28:00.000+0200
I think I have something wrong in the offset config of the item.
Regards Martin
rossko57
(Rossko57)
July 23, 2019, 11:27pm
2
Notice the difference -
If you want to offset that event , you need to specify that event
Type rangeEvent : set#event [
Note that if you also want to offset in an Item, then you must separately spcify the offset for a state channel (like set#start
)
rak
(Ralf Klüber)
July 24, 2019, 6:47pm
3
Hello,
Thanks for the willingness to help. I don’t understand. Can you elaborate with a bit more info and a light example?
Thanks in advance.
Regards
Ralf
rossko57
(Rossko57)
July 24, 2019, 8:17pm
4
If you want to offset that event , you need to specify that event
astro:sun:home [ geolocation="x,y", interval=300 ]
astro:sun:minus60 [ geolocation="x,y", interval=300 ] {
Channels:
Type rangeEvent : set#event [
offset=-60
]
}
If you want to offset an Item’s state, you need to specify the state channel
astro:sun:home [ geolocation="x,y", interval=300 ]
astro:sun:minus60 [ geolocation="x,y", interval=300 ] {
Channels:
Type rangeEvent : set#start [
offset=-60
]
}
If you want to offset both, you need to specify both
astro:sun:home [ geolocation="x,y", interval=300 ]
astro:sun:minus60 [ geolocation="x,y", interval=300 ] {
Channels:
Type rangeEvent : set#start [
offset=-60
]
Type rangeEvent : set#event [
offset=-60
]
}
set#start and similar are state channels, presenting a datetime value that you can put into an Item
set#event and similar are trigger channels, cannot be linked to any Item because they are transient events, but invoke an openHAB event when their time comes.
Two different uhh, things.
Have another look with that in mind
2 Likes
Marfi
(Martin)
July 25, 2019, 8:37pm
5
Thanks for your help. Sounds reasonable and I will try.
Unfortunately it takes 24 hours to test
rpwong
(Russ)
July 25, 2019, 9:04pm
6
You could test it by offsetting to a time that’s 5-10 minutes away.
I also had a hard time wrapping my head around offsetting Astro. I think I got it going through sheer dumb luck, which meant that I didn’t know what to do when I subsequently broke it. @rossko57 ’s explanation is about the best I’ve read to explain the difference between the the state and the event.
@rpwong right!! excellent advice!
rpwong
(Russ)
July 26, 2019, 3:07am
8
It’s better to be lucky than good, right up until your luck runs out.
1 Like
Not really. For testing purposes you can take another offset. (e.g. -1438) So you will get the result after two minutes
Marfi
(Martin)
July 28, 2019, 9:46am
10
Thanks for the clarification.
I think I need the set#event. For testing I defined both (set#event and set#start):
astro:sun:minus60 [ geolocation="x, y", interval=300 ] {
Channels:
Type rangeEvent : set#start [
offset=-60
]
Type rangeEvent : set#event [
offset=-60
]
}
At the same time I have a thing without offset:
astro:sun:home [ geolocation="x, y", interval=300 ]
Both channels trigger at the same time:
2019-07-27 21:23:00.006 [vent.ChannelTriggeredEvent] - astro:sun:home:set#event triggered START
2019-07-27 21:23:00.013 [vent.ChannelTriggeredEvent] - astro:sun:minus60:set#event triggered START
Any ideas?
Regards
Martin
rossko57
(Rossko57)
July 28, 2019, 10:26am
11
When you edit things (as opposed to creating new) there can be cache effects in play. I don’t know the details, but for example
Often when one encounters a problem with OH, particularly after an update, OH will refuse to run or certain parts of OH stop working. Some reported errors include:
500 or 404 errors when accessing the UIs
lots of exceptions from Jetty or other core components in openhab.log
OH refuses to start at all
The first step in debugging the problem is to clear the tmp and cache.
Installed OH
If you are running an installed OH (openHABian, installed using apt or yum):
openhab-cli stop
openhab-cl…
For Astro in particular, you do need the binding to run its “initialize job” like it does at midnight to calculate the coming day’s schedule. Usually means a reboot.
Marfi
(Martin)
July 28, 2019, 10:47am
12
I just rebooted OpenHAB. We will see what happens…