Error 2: what's wrong... turn Curl in shell command?

HI

i have these zwave switches i readout over MQTT in Hassio.
On and Off work fine, but now and then the state isn’t transmitted quite alright. Which is rather inconvenient for other nations in my setup relying on that state obviously.

I therefor want to create a set of shell commands, scripts or what other option would be best to click on a button in Hassio and force read the state of the switches.

I can Curl them like this:

  command_state: >-
    curl -X POST -d '{"seq":1, "method":"object_prop_get", "arguments":{"oid":"03ad5421", "prop":"state"}}' http://192.168.xxx.xxx/iungo/api_request

ive tried it like this:

sw_audio_auditorium_state_cl:
  alias: Audio Auditorium State (cl)
  audio_auditorium_state: curl -X POST -d '{"seq":1, "method":"object_prop_get", "arguments":{"oid":"03ad5421", "prop":"state"}}' http://192.168.xxx.xxx/iungo/api_request

but get following errors"

2018-02-25 17:09:46 ERROR (MainThread) [homeassistant.components.shell_command] Error running command: OrderedDict([('alias', 'Audio Auditorium State (cl)'), ('audio_auditorium_state', 'curl -X POST -d \'{"seq":1, "method":"object_prop_set", "arguments":{"oid":"03ad5421", "prop":"command", "value":"on"}}\' http://192.168.xxx.xxx/iungo/api_request')]), return code: 2

What is wrong, and secondly, is this the best way to do this?

Thanks for looking,
Marius

http://tldp.org/LDP/abs/html/exitcodes.html

I don’t know if that helps you, but gives you somewhere to start.

If the script/command runs OK in a shell, I would suspect permissions issues.

lol, not really…
suppose it is a syntax error but wouldn’t know how to solve this.

asked differently: how would you turn this curl command into a Hassio actionable script?

curl -X POST -d \'{"seq":1, "method":"object_prop_set", "arguments":{"oid":"03ad5421", "prop":"command", "value":"on"}}\' http://192.168.xxx.xxx/iungo/api_request'