Soundboard V2 (PC) icon Soundboard V2 (PC) — Play MP3/WAV via PC sound output with timeline scripts to trigger movements, auto-position actions, and optional looping for synced routines Try it →
Asked — Edited
1 Participant

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

Stay at the forefront of robot programming innovation with ARC Pro, ensuring your robot is always equipped with the latest advancements.

Author Avatar
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.