Java Runtime Environment: which java platform is used and what version
openHAB version: 2.2.0
Hello again,
I am setting up my first rule. I cannot get my sunset rule to work. My astro.rules is below.
I have confirmer the sendCommand function is working by placing it into a different rule triggered by a cron schedule.
The sunset time/sun elevation is working correctly and appearing in the BasicUI.
Can I have a clue of what is wrong, please?
Thanks, George
rule "Sunset Rule"
when
Channel "astro:sun:local:set#event" triggered START
then
// Do what you want to do at start of sunset for example:
// tplinksmarthome:hs110:energyswitch2:switch
sendCommand(F2_Loft_Light, ON)
end
rule "Sunrise Rule"
when
Channel "astro:sun:local:rise#event" triggered START
then
// Do what you want to do at start of sunset
sendCommand(F2_Loft_Light, OFF)
end
I have a test rule for sun set that is working…the only difference I can spot from yours is that i put the astro:sun:local:set#event in single quote, not doubles.
I don’t know…I just pointed out a difference…let’s wait someone who knows more.
Meanwhile…can you confirm you have the Channel in the astro thing configuration? and that is named that way?
I have taken the sendCommand from a different rule file, which works fine. So, I would be surprised if this did not work. Nevertheless, I have changed this commend and will wait until tomorrow morning and see if the light is turned on.