Closed Azenet closed 2 years ago
I have same issue
I am having this issue, documented a bit here because I didn't consider it was an upstream issue.
yep, this was driving me nuts the lat two days...
~/Desktop ❯❯❯ hass-cli state history --since 6h binary_sensor.konnected_zone_2_front_and_rear_door ✘ 130
Trying to locate Home Assistant on local network...
Found and using https://automation.xxxxx.xxxxx.com as server
error: HomeAssistantCliError: Error while getting all states: 401: Unauthorized
Run with -x to see full exception information
~/Desktop ❯❯❯
next command works
~/Desktop ❯❯❯ hass-cli entity list kitchen ✘ 1
ENTITY_ID NAME DEVICE_ID PLATFORM CONFIG_ENTRY_ID DISABLED_BY
switch.kitchen_bar_switch Kitchen Bar Switch 8457c7f4356b4f83820d04acf14d6877 zwave 7b123350c2fc44f9ad6c146b0b335d40 None
switch.kitchen_under_cabinet_right_side Kitchen Under Cabinet Side 857967db45534ea69fe7a3274721e378 zwave 7b123350c2fc44f9ad6c146b0b335d40 None
light.kitchen_ceiling_dimmer Kitchen Ceiling b831a81397a54d7c91b928320454b930 zwave 7b123350c2fc44f9ad6c146b0b335d40 None
zwave.kitchen_bar_switch Kitchen Bar Switch 8457c7f4356b4f83820d04acf14d6877 zwave 7b123350c2fc44f9ad6c146b0b335d40 None
zwave.kitchen_under_cabinet_right_side Kitchen Under Cabinet Side 857967db45534ea69fe7a3274721e378 zwave 7b123350c2fc44f9ad6c146b0b335d40 None
zwave.kitchen_ceiling_dimmer zwave.kitchen_ceiling_dimmer b831a81397a54d7c91b928320454b930 zwave 7b123350c2fc44f9ad6c146b0b335d40 None
binary_sensor.kitchen_zooz_zse40_4_in_1_sensor_sensor Kitchen Motion Sensor 3b109d82986841a4bcad8d920053bd13 zwave 7b123350c2fc44f9ad6c146b0b335d40 None
sensor.kitchen_zooz_zse40_4_in_1_sensor_alarm_level Kitchen Motion Alarm Level 3b109d82986841a4bcad8d920053bd13 zwave 7b123350c2fc44f9ad6c146b0b335d40 None
sensor.kitchen_zooz_zse40_4_in_1_sensor_alarm_type Kitchen Motion Alarm Type 3b109d82986841a4bcad8d920053bd13 zwave 7b123350c2fc44f9ad6c146b0b335d40 None
sensor.kitchen_zooz_zse40_4_in_1_sensor_battery_level Kitchen Motion Battery Level 3b109d82986841a4bcad8d920053bd13 zwave 7b123350c2fc44f9ad6c146b0b335d40 None
sensor.kitchen_zooz_zse40_4_in_1_sensor_burglar Kitchen Motion Burglar 3b109d82986841a4bcad8d920053bd13 zwave 7b123350c2fc44f9ad6c146b0b335d40 None
sensor.kitchen_zooz_zse40_4_in_1_sensor_clock Kitchen Motion Clock 3b109d82986841a4bcad8d920053bd13 zwave 7b123350c2fc44f9ad6c146b0b335d40 None
sensor.kitchen_zooz_zse40_4_in_1_sensor_emergency Kitchen Motion Emergency 3b109d82986841a4bcad8d920053bd13 zwave 7b123350c2fc44f9ad6c146b0b335d40 None
sensor.kitchen_zooz_zse40_4_in_1_sensor_homehealth Kitchen Motion HomeHealth 3b109d82986841a4bcad8d920053bd13 zwave 7b123350c2fc44f9ad6c146b0b335d40 None
sensor.kitchen_zooz_zse40_4_in_1_sensor_sourcenodeid Kitchen Motion SourceNodeId 3b109d82986841a4bcad8d920053bd13 zwave 7b123350c2fc44f9ad6c146b0b335d40 None
sensor.kitchen_zooz_zse40_4_in_1_sensor_system Kitchen Motion System 3b109d82986841a4bcad8d920053bd13 zwave 7b123350c2fc44f9ad6c146b0b335d40 None
sensor.kitchen_zooz_zse40_4_in_1_sensor_luminance Kitchen Motion Luminance 3b109d82986841a4bcad8d920053bd13 zwave 7b123350c2fc44f9ad6c146b0b335d40 None
sensor.kitchen_zooz_zse40_4_in_1_sensor_relative_humidity Kitchen Motion Relative Humidity 3b109d82986841a4bcad8d920053bd13 zwave 7b123350c2fc44f9ad6c146b0b335d40 None
zwave.kitchen_zooz_zse40_4_in_1_sensor Kitchen Motion 3b109d82986841a4bcad8d920053bd13 zwave 7b123350c2fc44f9ad6c146b0b335d40 None
sensor.kitchen_zooz_zse40_4_in_1_sensor_temperature Kitchen Motion Temperature 3b109d82986841a4bcad8d920053bd13 zwave 7b123350c2fc44f9ad6c146b0b335d40 None
~/Desktop ❯❯❯
Same issue, history
command just doesn't seem to follow expected host and authentication configuration like other commands.
I had to downgrade to 0.8.0 to get state history working again
Still and issue
Yep. Still happening.
$ hass-cli --version
hass-cli, version 0.9.4
$ hass-cli --sort-by last_changed state history --since 50m sensor.motion_sensor_basement_cave_temperature
Trying to locate Home Assistant on local network...
Found and using https://<redacted>.ui.nabu.casa as server
error: HomeAssistantCliError: Error while getting all states: 401: Unauthorized
Run with -x to see full exception information
$ hass-cli entity list | grep cave_temperature
sensor.motion_sensor_basement_cave_temperature Motion Sensor Basement Cave 73b7c67a48011aebe67b43e7dcef83ab deconz b6bc1c797fd8d3e5b23721e3b5142aae None
Confirmed that #375 fixes the issue.
Hi,
I cannot figure out how to get state history when defining a server (either through env variables or --server), as it seems to be ignored when calling
hass-cli --server https://x state history <entity>
orenv HASS_SERVER=https://x hass-cli state history <entity>
. The CLI tries to find HASS on the network instead of using the configured server. I have tried with 0.9.0 and latest git (c0aa3a40abc8e16afc201cb07a3b1fa606b3088f).Stack trace with breakpoint in _locate_ha() in config.py:
The _locate_ha() function isn't called when doing
state get <entity>
, for example.Thank you!