Hi =), I try to define a simple rule under OH3 with the main UI…The syntax is the following:
When I turn on the “Küchendimmer” above a value of 80, it should turn on my “Arbeitsplattenlicht” and “Dunstabzugshaube” Items…The rule reacts, but as soon as I define the “only if item state > 80” the rule never runs…Here is the code of main-ui:
That is the Rule known working under “old” syntax:
rule "Kuechenbeleuchtung Regel"
when
Item Dimmer_Kuechenlicht_Esstischlicht received update
then
if (Dimmer_Kuechenlicht_Esstischlicht.state > 80) {
Dunstabzugshaube.sendCommand(ON)
Schalter_Arbeitsplattenlicht_Kueche.sendCommand(ON)
}
else {
Dunstabzugshaube.sendCommand(OFF)
Schalter_Arbeitsplattenlicht_Kueche.sendCommand(OFF)
}
end
I know the new rule will turn on AND off, but such a syntax is not possible under main-ui…
I just want to understand, why the rule is not working on the “new” main-ui syntax, or what I’m doing wrong here…
Platform Info: OpenHab Docker 3.0, hypriot OS latest, Rpi 4
Even more strange. Is there anything in the logs? Does the value of “DimmerKuechenlicht” really change to a value above 80? Perhaps try it with “core.ItemStateChangeTrigger” instead (just in case).
No warn or error…I tested the rule Trigger by deleting the “only if” condition…the rule turns on then…so the rule-trigger should work…I also tested with stateChange… nothing happened…
var dimmerValue;
dimmerValue = itemRegistry.getItem('DeckenleuchteTisch_Helligkeit').getState();
if (dimmerValue > 80) {
events.sendCommand('FlurDeckenleuchte_Helligkeit', 'ON');
}
This works perfectly.
In regards of opening an bug: maybe, especially issues with an operator will probably occur as well in other cases and the Main UI offer those operators.
I don’t assign anyone to do anything. This is an open source project. Literally everything that gets coded, documented, or fixed is done because someone volunteers to do it. Every question that is answered in the forum is answered because someone volunteers to answer it.
No one assigns anyone anything to do.
The issue is filed and it will be fixed when and if someone with the skill, time, and willingness volunteer to do the work and submits a PR.
Sorry I didn’t mean it that way…just wanted to help solve it…I know that @rlkoshak have an extremely good thread about rules in 2.5 OpenHab where you explained everything extremely good…that’s why I marked you… sorry…I know that this is an opensource project and I really appreciate the work all of you have done to make such a cool software! So I’m really sorry if I offended you or someone else somehow…