Asked — Edited

Receiving Mqtt

I want to receive ON OFF messages from Openhab to turn on Inmoov scripts. Binary array is unchecked and this is the script on the mqtt line . But its not working with a "Error on line 1: Variable is an array: $awaiting_your_command"

if $awaiting_your_command = ("ON") ControlCommand("Script Manager", ScriptStart, "awaiting your command") endif


ARC Pro

Upgrade to ARC Pro

Become a Synthiam ARC Pro subscriber to unleash the power of easy and powerful robot programming

PRO
USA
#1  

@GregC

$awaiting_your_command is an array variable. you need to specify the index e.g. array position



#compare position 0
if $awaiting_your_command[0]="ON"
....
endif

#compare position 1
if $awaiting_your_command[1]="ON"
....
endif


#2  

So it looks like unchecking Binary array then testing for a string is what works.


if ($awaiting_your_command = "ON")
ControlCommand("Script Manager", ScriptStart, "awaiting your command")
endif

I think this needs to be on the help page. There are send examples but no receive ones.

On the openhab side item Switch inmoov_awaiting_your_command "awaiting_your_command" (inmoov) {mqtt="<[mosquitto:robot:state:default::]", mqtt=">[mosquitto:robot:command:ON:ON],>[mosquitto:robot:command:OFF:OFF]" }

Now openhab and "BOB my inmoov" can talk.