How can I trigger a rule some time after the start of pimatic?
When pimatic is starting after 60s do this...
doesnt seem to work.
-
Time after Pimatic starts
-
This is not possible as a “1-step” action (as far as I know).
I would set a variable (for example START_TRIGGER) upon startup with a rule.
I would create a rule checking the status of that variable (not updated for …), do something and reset the variable.Something like:
"rule": "when pimatic is starting then set $START_TRIGGER to 1",
and the second rule:
"rule": "when $START_TRIGGER=1 and $START_TRIGGER was not updated for 1 minutes then "do something" and set $START_TRIGGER to 2",
Edit: I changed the START_TRIGGER from a text variable to a numeric variable as you don’t need to escape double-quotes for a numeric variable
-
it is better to set the trigger to trigger + 1 and use a timer device wich show the variable trigger in the gui .
-
Can’t you add the delay on the action part? After “then”?
When pimatic is starting **then** after 60s do this...
-
i agree with @abmantis
why not use the time trigger in the THEN part.
should be of no problem. and if you face any trouble, try to use the gui rule editor.
that’s a really nice tool especially for evaluation of tricky rules.
I use it likeWhen pimatic is starting THEN after 10 seconds push title:"pimatic has been started!" message:"The home automation server has been started and is at your disposal" priority:1
works for me
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebookmake it so !
-
I already used the time after the THEN part but first it doesn´t work.
For testing i have two rules:
when pimatic ist starting then after 30 seconds send email to: "emailadress" subject: "frueh"
and
when pimatic ist starting then after 120 seconds send email to: "emailadress" subject: "spaet"
but both emails arrive nearly at the same time. (11:19:51.170 and 11:20:03.097 in the pimatic log)If I set the second time greater than ~180 seconds it works as expected.
-
sorry, that’s beyond me!
maybe anybody else has a good explanation ?
you can try to activate the logging of the rule to see when it has been triggered and see when it has been processed.pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebookmake it so !
-
Please check your logs when pimatic is starting until it is “ready” starting. On my old RPI it takes 40 seconds before the pimatic-cron plugin is loaded and can start doing things.
After 2 minutes 10 seconds it is ready loading the plugins, but continues with the devices and so on.
Until pimatic is really ready starting I’m 3 minutes 40 seconds further.I simply think pimatic is so busy loading it can’t do those 2 jobs in such a short time. And after 3 minutes (in your case) it has again enough resources free to do other things.
-
Could be an explanation. I also thought about this but my pi/pimatic starts up very quickly, that’s why I haven’t thought it to the end.
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebookmake it so !
-
I guess it depends on which hardware you run pimatic
On my Raspi B (not 2B) it is slow. That’s why I gave that example.
On my bananapi it is so much faster. (A bananapi is slightly faster than a raspi 2B.)It also matters how much (obvious) plugins and which plugins you use. Some plugins take much longer to load than others, at least on both of my systems.
-
Thanks @all, especially @Harry-van-der-Wolf, I guess thats the explanation.
In my opinion the point “pimatic is starting” is not precisely defined. Maybe some kind of “pimatic is completely started” is much clearer.
I also found out that i got some port errors when i sent an email directly with “pimatic is starting”.