I’m trying to operated on my vms with an mqtt service I’ve adapted for used.
I’m trying to get a string channel to accept and use multiple values.
The run time values are Off, Paused, Running.
The commands however are:
to Pause
pause,mymachine
To Run
resume,mymachine
So I’ve got this:
Type string : state "Machinestate" [
stateTopic="iotlink/workgroup/host/hyper-v/state/mymachine",
allowedStates="Off,Paused,Running",
commandTopic="iotlink/workgroup/host/hyper-v/operate",
Off="stop,mymachine",
Paused="pause,mymachine",
Running="resume,mymachine" ]
ANd on screen it looks ok with a nice selection drop down with the allowed states. But no matter what I set the desired state to the mqtt command is just the Allowed state value:
iotlink/workgroup/host/hyper-v/operate Running
iotlink/workgroup/host/hyper-v/operate Paused
Can I do what I want, or should i alter the message structure?
ideally I’d change the message structure to
iotlink/workgroup/host/hyper-v/operate/machine
But the mqtt thing I’m using doesn’t seem to allow me to subscribe to
iotlink/workgroup/host/hyper-v/operate/+
else I wouldn’t be having to do it this way.