smitopher
(Christopher Smith)
September 2, 2019, 3:41pm
1
Openhab 2.5m2
I have a rule
rule "Sparkley Darkley Jars OFF"
when
Time cron "0/5 0 0 ? * * *"
then
logInfo("SonoffRFBridge", "Sparkley Darklies turned off")
SonoffRFBridge_SparkleyDarkleyJar01.sendnCommand(OFF)
SonoffRFBridge_SparkleyDarkleyJar2.sendCommand(OFF)
end
it should fire every 5 seconds, but it never fires
log
==> /var/log/openhab2/openhab.log <==
2019-09-02 10:27:55.813 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'SparkleyDarkleyOff.rules'
==> /var/log/openhab2/events.log <==
2019-09-02 10:31:38.476 [vent.ItemStateChangedEvent] - BRCloset2Door_BatteryLevel changed from 81 to 78
2019-09-02 10:37:00.001 [vent.ChannelTriggeredEvent] - astro:moon:local:rise#event triggered START
Any suggestion on what may be the problem
It’s hanging…
you haven’t mentioned the platform but I’m not sure if any platform is going to run fast enough to have OpenHAB doing something none stop ever 5 seconds. Stupid question, I see it is sonof bridge but what is this thing doing?
Celaeno1
(Alex)
September 2, 2019, 3:58pm
3
Above line has a typo: “sendn Command”
vzorglub
(Vincent Regaud)
September 2, 2019, 4:13pm
4
No this will fire at midnight exactly and at 5 seconds after midnight.
Review your cron
1 Like
Celaeno1
(Alex)
September 2, 2019, 4:17pm
5
@vzorglub
According to this cron generator, it fires every 5 seconds, starting at 0 seconds.
https://www.freeformatter.com/cron-expression-generator-quartz.html
Nope, as Minute and Hour is fixed to 0, it will fire only at 00:00:00, 00:00:05, 00:00:10, 00:00:15, 00:00:20, 00:00:25, 00:00:30, 00:00:35, 00:00:40, 00:00:45, 00:00:50 and 00:00:55
the correct Time cron is this:
Time cron "0/5 * * * * ?"
or
Time cron "0/5 * * ? * *"
But as always: What do you want to achive?
2 Likes
Celaeno1
(Alex)
September 2, 2019, 4:28pm
7
@vzorglub @Udo_Hartmann
Yes, you were right. The generator confused me, because there are more tabs to fill. SORRY!
Now I also get:
Time cron "0/5 * * ? * *"
Btw: there also is the typo “sendnCommand”.
3 Likes
smitopher
(Christopher Smith)
September 2, 2019, 5:48pm
9
The above rule is a demo. The every 5 seconds is just for debugging. It will ultimately run once a day.
1 Like
smitopher
(Christopher Smith)
September 2, 2019, 6:22pm
10
Thank you all.
I… uhm… never have typos…
1 Like
smitopher
(Christopher Smith)
September 2, 2019, 6:26pm
11
I’m sending a MQTT command to a Tasmota flashed Sonoff RF bridge that sends an RF command to an EL CHEAPO rf switch which will switch on or off some decorative light fixtures.
1 Like
Now that is the perfect OpenHAB task if I ever heard one!
good on you!
smitopher
(Christopher Smith)
September 3, 2019, 7:26pm
13
Just FYI
This is all with the 2.5M2 MQTT binding.
All config is done in Paper UI. There are no Item or Thing files
@David_Graeff has performed an excellent refactoring that matches the OH2 idiom… and I think this even having used the old MQTT binding.
1 Like