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


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"}}'

ive tried it like this:

  alias: Audio Auditorium State (cl)
  audio_auditorium_state: curl -X POST -d '{"seq":1, "method":"object_prop_get", "arguments":{"oid":"03ad5421", "prop":"state"}}'

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"}}\'')]), return code: 2

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

Thanks for looking,

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"}}\''