I have some trouble with one command in the sensor command_line platform:
The first try: one of the examples out of the documentation:
- platform: command_line
name: HA release
command: python3 -c "import requests; print(requests.get('https://pypi.python.org/pypi/homeassistant/json').json()['info']['version'])"
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