var Temp.Aussen = Aussentemperatur_Temperature.state as Number
var Temp.Wohn = ThermostatWohnzimmer1OG_Temperature.state as Number
if(Temp.Aussen > Temp.Wohn) {
val telegramAction = getActions("telegram","telegram:telegramBot:1337263e00")
telegramAction.sendTelegram("TEST")
I found this in the log file. But it does not help me. Is this helpful for you?
2022-07-29 18:33:27.128 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'b61402e0ba' failed: var Number TempAussen = Aussentemperatur_Temperature.state as Number
var Number TempWohn = ThermostatWohnzimmer1OG_Temperature.state as Number
if(TempAussen > TempWohn) {
val telegramAction = getActions("telegram","telegram:telegramBot:1337263e00")
telegramAction.sendTelegram("Temp Check")
logInfo("TempComparison", "Aussen: " + TempAussen + " / Wohn: " + TempWohn)
}
end
The method or field end is undefined; line 8, column 393, length 3
Sounds like you copied a rule example intended for xxx.rules file based usage, into a GUI rule environment. You have to be careful about that.
Sure, see various options at
Depends what you did with it. It’s not DSL rules language, so it wouldn’t work if you just copy/pasted into the same rule type you used for the other stuff.
You have to pay attention to which language you are trying to use.
I must disable the rule and enable a other rule inside the script. It does only happen when the telegram message was send. But I can’t find that way to disable/enable a rule in your linked post. I am stupid?
How to disable/enable rules is shown in the section marked “Scripted Automation”
It looks like you found that before, and tried to copy-paste part of into a DSL rule.
That won’t work, because the example is not using DSL rules language.
It’s in “scripted automation” or Jython. You need to take care to use the same rules language.
There is just no way to enable/disable in DSL, but there are alternative approaches to get the same effect. Also described in that post.
There’s also the built-in action in the UI rules editor
but I think you’ll have to make a separate rule for that and call it from your first rule.