- Platform information:
- Hardware: ODROID-XU4, armv7l, 2GB RAM
- OS: Armbian (Debian) Buster with Linux 4.14.180-odroidxu4
- Java Runtime Environment: Azul 8
- openHAB version: 2.5.5-1 from https://dl.bintray.com/openhab/apt-repo2 (stable)
Been scratching my head on this one all day so far, searched/read through several similar topics but still can’t figure it out. Even took a break and made myself a sandwich… But still no joy.
Here is the actual error:
2020-06-09 11:08:29.504 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model '433mhz_button.rules' has errors, therefore ignoring it: [3,5]: no viable alternative at input '433'
[5,12]: missing ')' at 'toMQTT_value'
[5,38]: mismatched input ')' expecting 'end'
Complete rules file in question (433mhz_button.rules
):
rule "433mhz buttons"
when
Item 433toMQTT_value changed
then
if (433toMQTT_value.state == NULL)
{
logInfo("rule 433mhz buttons", "Item is null, cancelling...")
return;
}
var rfData = 433toMQTT_value.state.toString
logInfo("rule 433mhz buttons", "Incoming RF code: " + rfData)
switch (rfData) {
case "969554":
{
if (433_remote_button_1of5.state == ON)
{
logInfo("rule 433mhz buttons", "-> 433_remote_button_1of5.sendCommand(OFF)")
433_remote_button_1of5.sendCommand(OFF)
}
else
{
logInfo("rule 433mhz buttons", "-> 433_remote_button_1of5.sendCommand(ON)")
433_remote_button_1of5.sendCommand(ON)
}
// Reset Last Received Code
rfData=""
433toMQTT_value.postUpdate(rfData)
}
}
end
Relevant item from (433mhz.items
):
String 433toMQTT_value "Received value from OMG/433toMQTT" {channel="mqtt:topic:cubietruck:OMG:433_value"}
Relevant bits of (mqtt.things
):
Bridge mqtt:broker:cubietruck [ host="192.168.X.Y" ]
{
Thing topic OMG "Open MQTT Gateway" {
Channels:
Type string : 433_value "name here no matter" [
stateTopic="home/+/433toMQTT",
transformationPattern="JSONPATH:$.value"
]
}
}
The .items and .things files are parsed without errors. I have rebooted the ODROID, etc. but now running out of ideas…