What is the var newMsg
for ?
Looks overcomplicated to me, why not using a switch node instead ?
[{"id":"a8102671.cb1ee","type":"inject","z":"7307521d.db778c","name":"Videomotion/1/Stop","topic":"Videomotion/1/Stop","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":314,"y":224,"wires":[["7ca00b6a.aa8754"]]},{"id":"7ca00b6a.aa8754","type":"switch","z":"7307521d.db778c","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"Videomotion/1/Stop","vt":"str"},{"t":"eq","v":"Videomotion/1/Start","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":498,"y":252,"wires":[["39726e74.e0f3d2"],["b596218.1e882e"]]},{"id":"39726e74.e0f3d2","type":"change","z":"7307521d.db778c","name":"0","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":638,"y":224,"wires":[["fa706fc.e7c379"]]},{"id":"a31cbdc6.a144","type":"inject","z":"7307521d.db778c","name":"Videomotion/1/Start","topic":"Videomotion/1/Start","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":314,"y":280,"wires":[["7ca00b6a.aa8754"]]},{"id":"b596218.1e882e","type":"change","z":"7307521d.db778c","name":"1","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":638,"y":280,"wires":[["e28bd41d.ab15c"]]},{"id":"fa706fc.e7c379","type":"debug","z":"7307521d.db778c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":798,"y":224,"wires":[]},{"id":"e28bd41d.ab15c","type":"debug","z":"7307521d.db778c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":798,"y":280,"wires":[]}]