Stuck with simple rule (SOLVED)

it amazes me how you are all getting all these complicated rules to run while im stuck creating the most basic when trigger_alert is on send LSELECT to GAlert

rule "Alert ON"
when
trigger_Alert =ON
then
sendCommand( GAlert, LSELECT)
logInfo("Rule", "ALERT ON ran (Alert.rules)")
end

TIA

And it amazes me why anybody would try to start coding without having a look into the documentation.
Hint: the trigger syntax is wrong!

1 Like

i have been looking at the documentation but like i have said before its extremely overwhelming too keep reading code you dont understand and a big part is not everybody can learn from reading big blocks of text its great for some im a more visual practical learner

rule "Alert ON"
when
Item trigger_Alert changed from OFF to ON
then
sendCommand( GAlert, LSELECT)
logInfo("Rule", "ALERT ON ran (Alert.rules)")
end

your link did help though thanks for that its been accepted by karaf now but gave error when i tried too run

21:22:30.218 [ERROR] [.script.engine.ScriptExecutionThread] - Rule ā€˜Alert ONā€™: An error occurred during the script execution: The name ā€˜LSELECTā€™ cannot be resolved to an item or type.

Unless LSELECT is a variable you defined earlier, you should define it as:

sendCommand(GAlert, "LSELECT")
1 Like

LSELECT is the command you use to make hue lights flash on the alert channel

Thanks for that your version worked i was missing the " Marks and there was a space and im an idiot lol

I might suggest that you are approaching it wrong. When opus and others suggest reading the docs, it isnā€™t so much that we expect you top set aside a week or two to read through hundreds of pages of docs. But when you run into an error we would like you to look at your Rule and compare it to what the Rules docs says it should be and verify that what you have matches what the docs say it should be.

So for the above open https://docs.openhab.org/configuration/rules-dsl.html and start going down from top to bottom and verify that your Rule matches.

That is what we mean by reading the docs. They are there to be used as a reference. No one reads them end to end and understands them all. We look up the parts we want to learn about and/or having problems with at any given time.

Now there will be many times when you get all the way to the bottom of the docs and you still havenā€™t fixed your problem. Then is a good time to look for examples and/or asking a question here.

2 Likes