Hi there,
I’m updating my OpenHAB server to a new Raspberry PI4 and updating it to 2.5.9 (I know, it’s about time).
Basically, this means moving to the new 2.5.x MQTT binding. Most of the update has been smooth sailing, but one thing still causes issues.
Previously, I had an MQTT publish
action that would send an MQTT message to my shellies and have the update to the latest firmware.
Now I am trying to use the Rule Action that is described on the new bindings addon page (https://www.openhab.org/addons/bindings/mqtt.generic/#rule-actions), but it simply will not work.
I keep getting errors like this in the log:
An error occurred during the script execution: Could not invoke method: org.openhab.binding.mqtt.action.MQTTActions.publishMQTT(org.eclipse.smarthome.core.thing.binding.ThingActions,java.lang.String,java.lang.String,java.lang.Boolean) on instance: null
Here’s my MQTT thing:
Bridge mqtt:broker:mosquitto [ host="192.168.0.11", clientID="openhab2", port=1883,secure=false,retainMessages=false, retain=false ] { }
and here’s my test rule:
rule "Shellies Announce"
when
Item Shellies_Command received command
then
logDebug(logger, "Shelly maintenance on all devices: " + receivedCommand)
val actions = getActions("mqtt","mqtt:broker:mosquitto")
actions.publishMQTT("dollerup/home/test","Shellies Announce")
switch (receivedCommand)
{
case "announce" :
{
actions.publishMQTT("mosquitto", "shellies/command", "announce")
logDebug(logger, "All Shellies are requested to announce themselves")
}
}
Shellies_Command.postUpdate(NULL)
end
What am I doing wrong?