Rules never executed

interface-openhabe
Hi All,
I’m beginner, I configured openhab. Things are OK when theyr are executed manually via the interface, but when I use rules nothing is happen. It seems that rules are never trigged or executed.

In my configuration files I have th following:

Items file:

// this is Item file
// Demo Items
Switch DEMOSw “Demo Switch” (Bureau, Lights) // [“Lighting”]
// Définition des groupes

Group Bureau

// Scénaris

///Switch FermerBureau “Fermer le bureau”
Switch FermerVoletBureau “Fermer Volet Bureau”
Switch LumBureau2 “Bureau2” (Bureau, Lights) [“Lighting”] {bticino=“if=webserver;who=1;what=1;where=15”}
Rollershutter VoletBureau “volet roulant bureau” (Bureau, RollerUpShutters) [“Switchable”] {bticino=“if=webserver;who=2;what=0;where=62”}
Switch LumBureau “Bureau” (Bureau, Lights) [“Lighting”] {bticino=“if=webserver;who=1;what=1;where=15”}
Switch FermerVoletFentreSalon “Fermer le Volet de la Fenetre du Salon”

Sitemap file:

sitemap sitemap_name label=“CrazyLOVe” {
Frame label=“1er ETAGE”
{
Switch item=DEMOSw

}

Frame label=“Pièces” {
Group item=Bureau label=“Bureau”
}

Rules file:

rule “Open rollershutter / turn light to ON”
when
Item DEMOSw received command
then
if (receivedCommand == ON) {
sendCommand(VoletBureau, UP)
//sendCommand(VoletChambreInvite, UP)
//sendCommand(VoletFenetreSalon, DOWN)
//sendCommand(VoletBureau, ON)
sendCommand(LumiereBureau, ON)

 }

end

And in log files I have only the following:

2020-12-10 14:53:36.385 [ome.event.ItemCommandEvent] - Item ‘DEMOSw’ received command ON
2020-12-10 14:53:36.388 [vent.ItemStateChangedEvent] - DEMOSw changed from OFF to ON

Any idea please and how can I dbug more and resolve this issue.

Regards,
Crazyraurus

This text will be hidden

Summary

C:\Users\mehdi.boumaiza\OneDrive - NTT\Documents\PERSO-PRIVATE\interface-openhabe.png

Welcome.

Please use code fences. Spacing is important & the forum “eats” them otherwise.

My bad regarding Code fences.
An update regarding my rules file:

rule "Open rollershutter / turn light to ON"
when Item DEMOSw received command
then
if (receivedCommand == ON) {
sendCommand(VoletBureau, UP)
sendCommand(LumiereBureau, ON)

}
end

1 Like

Spacing is an issue. Try this

rule "Open rollershutter / turn light to ON"
    when Item DEMOSw received command
then
    if (receivedCommand == ON) {
        sendCommand(VoletBureau, UP)
        sendCommand(LumiereBureau, ON)

    }
end

Try:

VoletBureau.sendCommand(UP)

Or maybe ("UP"). If that doesn’t work, add some logging lines into your code to see whether the rule actually runs or not.

Thank you for your help, after many verification I found that I updated locally my files and nor directly on server either I used samba.
Issue is SOLVED.

Great, and welcome to openHAB!

Have a quick review of this section of the documentation regarding how to use the sendCommand method: the format I suggested is the recommended way.