home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70.93k stars 29.58k forks source link

Proxmox VE Entities not appearing correctly #107047

Open a-pir1 opened 7 months ago

a-pir1 commented 7 months ago

The problem

Per the docs, the PVE integration "will automatically create a binary sensor for each tracked virtual machine or container... The created sensor will be called binary_sensor.NODE_NAME_VMNAME_running." When I followed the guide in the docs, I did not see any binary sensors created by the integration. They did however create several device_trackers for my nodes that are always reading as Away whether my VM is running or stopped.

In addition, the node names that home assistant has are those of deleted nodes, and not the current nodes that occupy the id slots. For example, initially, node 101 was HASS. I deleted that VM months ago, and now VM101 is NUT. In Home Assistant, I have no device_tracker.NUT, but I do have a device_tracker.HASS.

What version of Home Assistant Core has the issue?

core-2024.1.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Proxmox VE

Link to integration documentation on our website

https://www.home-assistant.io/integrations/proxmoxve

Diagnostics information

Proxmox VE is not managed via GUI, so I am unable to generate diagnostic data.

Example YAML snippet

proxmoxve:
  - host: 192.168.1.8
    username: hass@pve
    password: beesbeesbeesbeesbeesbeesbeesbeesbeesbeesbeesbeesbeesbeesbeesbeesbeesbeesbeesbees
    nodes:
      - node: pve
        vms:
          - 1000
        containers:
          - 201
          - 250
          - 300
          - 303

Anything in the logs that might be useful for us?

No response

Additional information

I have tested this integration across my production environment, and I spun up another clean Home Assistant OS environment to test this, and I saw no difference in my results, unfortunately

home-assistant[bot] commented 7 months ago

Hey there @jhollowe, @corbeno, mind taking a look at this issue as it has been labeled with an integration (proxmoxve) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `proxmoxve` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign proxmoxve` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


proxmoxve documentation proxmoxve source (message by IssueLinks)

issue-triage-workflows[bot] commented 4 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

a-pir1 commented 4 months ago

I am running the most up to date software. I have seen no progress and am still having the same issue as previously.

smibrandon commented 3 months ago

I was able to get mine going after a little trial and error. Here's my config for reference:

proxmoxve:
  - host: 192.168.0.1
    username: hass@pve
    password: {{my password}}
    verify_ssl: false
    realm: pve
    nodes:
      - node: proxmoxserver
        vms:
          - 116
          - 117
        containers:
          - 100
          - 102
          - 103
          - 104
          - 105
          - 106
          - 107
          - 108
          - 109
          - 110
          - 111
          - 112

I did realize I had to put in the verify_ssl: false piece in mine to work.

henriklund commented 3 months ago

@a-pir1 as I read the source code, you should not understand "...will automatically create a binary sensor.." as an automatic iteration through all available VMs / LXC and create binary sensors for those. You need to explicitly list the VMs/LXC that you want to have monitored (see post from @smibrandon). E.g. rather than iterating through the result from an API call to /api2/json/nodes/proxmox1/lxc, the code relies on calling /api2/json/nodes/proxmox1/lxc/[vmid] for each LXC.

MartinHynek commented 2 months ago

@henriklund sorry, but i'm bit confused.. so you are basically saying that the how to on manual page is wrong? 'cos as @a-pir1 wrote i'm in same situation and from your comment i don't get it :-( using same syntax and example as @smibrandon above.. no new entities or devices

henriklund commented 2 months ago

The code does not show any form of detection of VMs / LXCs. Furthermore, the documentation states: You should have at least one VM or container entry configured, else this integration won't do anything.. I'd thus say that the documentation matches what you see and what the code appears to be doing.