wxt9861 / esxi_stats

ESXi component for Home Assistant
MIT License
145 stars 40 forks source link

Unable to change Host State Attribute #82

Open ianfretwell opened 1 year ago

ianfretwell commented 1 year ago

Having changed my config to point at my vCenter rather than my host - I find that I cannot change the Host State Attribute (to any of the options - although what I want is cpuusage_ghz).

When I click submit I get the following message: -

User input malformed: expected bool for dictionary value @ data['notify']

All I can do is close the window.

Can I make the change manually in code - and if so where ?

Environment is: - HA 2023.2.5 VCSA 8.0b ESXi 8.0b

Thanks.

wxt9861 commented 1 year ago

I am not sure - v8 introduces a new API and I haven't checked into it yet. Need to migrate component to new API first before looking into this issue.

wxt9861 commented 1 year ago

Sorry - I think I read this wrong the first time.

What version of the component are you using? If you're on a beta version, can you try beta7?

ianfretwell commented 1 year ago

I'm now on the beta7 version...the logs show this after startup:-

Config entry '192.168.6.231' for esxi_stats integration not ready yet: local variable 'host_power_policy' referenced before assignment; Retrying in background

If I add a second instance and target the host directly - the initial connection is made successfully but I still cannot make any changes as per my original post.

wxt9861 commented 1 year ago

That's interesting. Anyway you can provide a log? Is 192.168.2.231 IP of the vCenter? I think the error is coming during get_host_info but I need to verify.

ianfretwell commented 1 year ago

I'll try to sort the logs out when I'm home.

Yes, 192.168.6.231 is the vCenter. It's actually at another location (LAN-LAN VPN) and is permanently on whereas my host is at home and only on when I need it.

wxt9861 commented 1 year ago

Thank you. The location shouldn't matter as long as you can reach it, but I think what's happening is the component is trying to pull host_power_policy of vCenter itself. vCenter itself wouldn't have this information, which results in an error.

ianfretwell commented 1 year ago

Apologies for having to ask - where do I get the logs ? - I've enabled debug logging but can't see where they actually get put ? (and there's no option to 'download diagnostics').

Thanks.

wxt9861 commented 1 year ago

The logs generally end up in your config folder in a file called home-assistant.log

christophermichaelshaw commented 1 year ago

Also encountering this issue -- HA: 2023.6.1 VC: 7.0.3.01100 ESXi: 7.0.2, 17867351

Receive following error when attempting to configure: User input malformed: expected bool for dictionary value @ data['notify']

Also receive the 'host_power_policy' error in HA logs.

Let me know if you need any additional information/logs to aid in troubleshooting!

wxt9861 commented 1 year ago

@christophermichaelshaw Which version do you have installed?

christophermichaelshaw commented 1 year ago

@wxt9861 Running 0.7.0beta7. Happy to try other versions if you deem it valuable for troubleshooting.

wxt9861 commented 1 year ago

@christophermichaelshaw

I am assuming your integration is pointing at the vCenter? At the moment, changing power policy via vCenter is not supported (it is mentioned in the documentation, as well). That's something I plan to address, however not running vCenter myself, it presents a bit of a challenge.

For the error stating User input malformed: expected bool for dictionary value @ data['notify'] - do you keep receiving this error after your reload the integration or restart home assistant?

christophermichaelshaw commented 1 year ago

@christophermichaelshaw

I am assuming your integration is pointing at the vCenter? At the moment, changing power policy via vCenter is not supported (it is mentioned in the documentation, as well). That's something I plan to address, however not running vCenter myself, it presents a bit of a challenge.

For the error stating User input malformed: expected bool for dictionary value @ data['notify'] - do you keep receiving this error after your reload the integration or restart home assistant?

Yes, I am attempting to add VC. I haven't modified (nor attempted) the power policy -- I receive the error after adding VC.