home-assistant-ecosystem/home-assistant-cli

Running as cron job fails with exception

kevincw01 opened this issue · 1 comments

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'

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