#kindly asking for help with sensor command_line

1 messages · Page 1 of 1 (latest)

lavish wigeon
#

I have some trouble with one command in the sensor command_line platform:

The first try: one of the examples out of the documentation:

works fine.
the next one:
- platform: command_line
name: JSON Test
command: python3 -c "import requests; print(requests.get('http://192.168.178.227:4321/Ccct/hk1').json()['hk1']['name'])"
fires the error:
2022-10-06 13:35:58.397 ERROR (SyncWorker_0) [homeassistant.components.command_line] Command failed (with return code 1): python3 -c "import requests; print(requests.get('http://192.168.178.227:4321/Ccct/hk1').json()['hk1']['name'])"

in homeassistant.log.

both commands worked without an error when executed in a shell of the operating system, hassio is running in.

Any suggestions are welcome!!!

Thanks

Peter

#

mmh - cut & paste converted some single quotes to -%27-

limber dragon
#

That's more #integrations-archived than automations, but please either use code markup (in a thread there) or use a code share site