I assume according to your rule that you are using OH2!
First of all, you do not need to import any openhab or esh packages!
As a preliminary question: are you using the Eclipse Smarthome Designer?
If yes, do you see any error with the trigger referring to Channel xxx?
which brings me to the next point: your chanell name “astro:sun:28bc7fcd:” seems odd. did you choose that on purpose and does it match the chanell name shown in the log/paperUI?
Uh…you should have only one thing,not three:
astro:sun:local:
astro:sun:28bc7fcd:
astro:sun:home:
That is not OK. I have no idea how you even managed to do that.
Check your setup, all chanells should be tied to only one thing (e.g. astro:sun:28bc7fcd: )
Once you have sorted that out start thinking about why the rule does not work(and i see a solid chance it will work once this is fixed)
I’m struggling with the same. I’m a ‘fresh’ beginner, 3 days in, so posting under beginners.
I run on a windows server - latest release version openhab2.
I have the events in the log:
2017-05-27 05:39:00.008 [ChannelTriggeredEvent ] - astro:sun:local:daylight#event triggered START
2017-05-27 05:39:00.011 [ChannelTriggeredEvent ] - astro:sun:local:rise#event triggered START
My rule won’t fire.
// Imports
import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*
// Global Variables
rule "example trigger rule"
when
Channel 'astro:sun:local:rise#event' triggered START
then
MqttUpdate.postUpdate("astro:sun:local Channel trigger fired")
pushsafer("DXL81o4a2HUALnFmW5Hp","Sunset event triggered!")
sendCommand(WandContactSchakelaar3Command,ON)
end
So I googled, and searched. And finally found what might be the reason. In the latest release, the rules were not responding to ChannelTriggered Events? In any case I downloaded nightly build and trying again. pullrequest
I have 3 questions:
Was the rule trigger mechanism broken in latest release, so I can see different results now? If not, how to debug?
Is there an easy way to debug a ChannelTriggered Event that only takes place a few times a day? Any other binding that fires ChannelTriggered Events regularly?
(offtopic) I would like to request a feature, but cannot find MQTT binding in github under Add-ons. State’s and Commands are posted to MQTT, but not ChannelTriggeredEvents. Can that be added?
I found that if I had any CRON rules, however I wrote or copied them from working examples, not only did they fail to trigger reliably, but that they would interfere with the triggering of ASTRO events.
I eliminated CRON triggers and the ASTRO events starting triggering as expected. I then used these with timers instead of the few CRON triggers I wanted.
I wasn’t sure how to identify what the actual issue with my CRON statements was, so I haven’t raised an issue so far.
I had CRON statements across 4 rules files. They all had to be removed.
I found that I could use the ASTRO events (with or without timers) to trigger the things I was using CRON for. If I needed something very regularly firing, then the updating of my NEST thermostat provides a good regular trigger.