Hi, I still have the same challenge. I already bind the ‘mqtt-action’ but this code:
rule "Phone is ringing"
when
// fboxRinging is a switch item which switches to ON if call is detected
Item fboxRinging_In changed from OFF to ON
then
logInfo(“Anrufermeldung”, “Generating caller name message…”)
indeed, my actual workging simple background is as follows:
in my *.items I declare a string item, which is modified by the .rule in case of changing, e.g.:
+++++++++++
String TEST_FB (gTEST) {mqtt=">[mosquitto:openhab/…:command::default]"}
+++++++++++
So, in my *.rules I write appropriate:
+++++++++++
var String FBText
rule "Phone starts ringing OUTGOING"
when
// fboxRinging_In is a switch item which switches to ON if call is detected
Item fboxRinging_Out changed to ON
then
FBText= "Klingeling - Ein Ruf geht raus…"
sendCommand( TEST_FB, FBText)
logInfo(“Anrufermeldung”, “Generating caller name message…”)
end
+++++++++++
All the time, when my variable ‘TEST_FB’ is modified by the rule, the mqtt broadcast fires the appropriate topic. This works fine for me, but I also want to know the possibilites and (may be) advantages of the mqtt-action