home-assistant-ecosystem / home-assistant-cli

:computer: Command-line tool for Home Assistant
Other
446 stars 69 forks source link

Running as cron job fails with exception #395

Closed kevincw01 closed 1 year ago

kevincw01 commented 1 year ago

Hassos 9.3 and core 2022.11.5

When attempting to execute any hass-cli command via Cron job on the hassos host, it fails.
Cron job executes ha info: Error: time="2022-12-19T06:23:50-08:00" level=error msg="Unexpected server response. Status code: 401"

The same error occurs when trying to using a remote ssh command: ssh root@<hassos host> 'ha info'

kevincw01 commented 1 year ago

Retried command using --api-key and it works now.