Giter VIP home page Giter VIP logo

Comments (18)

madbrain76 avatar madbrain76 commented on August 24, 2024 1

I found the serial numbers on the sticker at the bottom of each UPS. With serial=xxxx , the driver works with both UPSes, and so does the integration. The integration reports "Description unavaialble" for each one. I tried to use alias= in the add-on to give them a description, but did not succeed.

from addon-nut.

sinclairpaul avatar sinclairpaul commented on August 24, 2024

Please post the logs and config, it looks like you have an issue with the integration rather than the addon.

from addon-nut.

aquette avatar aquette commented on August 24, 2024

Privet,
you're probably using a default config with "port=auto"
NUT must be able to differentiate the units, for example using a serial number.
As per https://networkupstools.org/docs/man/usbhid-ups.html:
Just add a config "serial = xxxx" for each units.

That means:
config:
- vendorid=051d
- productid=0002

and it's really an addon (config) issue ;)

from addon-nut.

madbrain76 avatar madbrain76 commented on August 24, 2024

Arnaud, Paul, Re: the add-on config, I left everything as default except for the username and password. So yes, I do have port=auto as that's part of the defaults.

In the device section, I have this :

- name: myups
  driver: usbhid-ups
  port: auto
  config: []

Arnaud,
I ran lsusb and it shows the following :

image

Looks like both are on bus 2, but one is device 6 and the other device 4 .
I'm not sure how to determine the serial number.
I'm running HAOS so I don't know how to specify the -DD argument to the driver.

I tried the following config :


- name: myups1
  driver: usbhid-ups
  port: auto
  config:
    - vendorid=051d
    - productid=0002
    - bus=2
    - device=4
- name: myups2
  driver: usbhid-ups
  port: auto
  config:
    - vendorid=051d
    - productid=0002
    - bus=2
    - device=6

And got the following error :

Network UPS Tools - Generic HID driver 0.47 (2.8.0)
USB communication driver (libusb 1.0) 0.43
libusb1: Could not open any HID devices: insufficient permissions on everything
No matching HID UPS found
Driver failed to start (exit status=1)
Network UPS Tools - Generic HID driver 0.47 (2.8.0)
USB communication driver (libusb 1.0) 0.43
libusb1: Could not open any HID devices: insufficient permissions on everything
No matching HID UPS found
Network UPS Tools - UPS driver controller 2.8.0
Driver failed to start (exit status=1)

from addon-nut.

sinclairpaul avatar sinclairpaul commented on August 24, 2024

Please set the following option https://github.com/hassio-addons/addon-nut/blob/main/nut/DOCS.md#option-list_usb_devices

Then post the full addon startup log. Running lsusb from a different container may not get the information you need.

from addon-nut.

madbrain76 avatar madbrain76 commented on August 24, 2024

@sinclairpaul ,
How do I set it ?

I tried the following

- name: myups1
  driver: usbhid-ups
  port: auto
  config:
    - list_usb_devices=true

But it failed:

Fatal error: 'list_usb_devices' is not a valid variable name for this driver.

from addon-nut.

sinclairpaul avatar sinclairpaul commented on August 24, 2024

It is an option at the same level as devices/users/shutdown_host

from addon-nut.

madbrain76 avatar madbrain76 commented on August 24, 2024

Thank you. I found it in the GUI for HAOS. I was trying to set it in the YAML.
Here is the output :

[11:39:17] INFO: Connected USB devices:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 006: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 002 Device 005: ID 1a86:55d4 QinHeng Electronics 800 Z-Wave Stick
Bus 002 Device 004: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

from addon-nut.

sinclairpaul avatar sinclairpaul commented on August 24, 2024

So does bus="002", device="006" not work?, it will be challenging in the container to find the serial number.

from addon-nut.

madbrain76 avatar madbrain76 commented on August 24, 2024

Yes, I tried those two with two leading zeroes - it didn't work.
I can disconnect one or both UPSes from the HAOS VM and onto the Windows host, if that helps.

from addon-nut.

madbrain76 avatar madbrain76 commented on August 24, 2024

@sinclairpaul , is there any way to resolve the following error:

libusb1: Could not open any HID devices: insufficient permissions on everything

It seems to happen anytime I try to specify vendorid, productid, bus, device ...
Not sure if using serial would fare any better given this.

from addon-nut.

sinclairpaul avatar sinclairpaul commented on August 24, 2024

It may show the serial, I wouldn't know. I believe the error is thrown when it can't locate the device correctly.

But in all honesty if you have a VM, why are you running the NUT addon (which is a container). In my opinion you would be much better of managing the UPS devices at the host OS, as you will have visibility into the Shutdown process. I should also add that the Integration for HA itself is in no way related to the addon, NUT can be run anywhere.

from addon-nut.

madbrain76 avatar madbrain76 commented on August 24, 2024

Great question. The two UPSes support a number of devices, some less critical than others, many on smartplugs. In case of power outage, an HA automation routine can decide to shutdown the non-critical devices on the UPS, and restore them when the power is back.
As far as the VM (HAOS) triggering a shutdown of the host, I don't think that would be easily done, unfortunately, maybe through some networking between the VM and host, but hard to coordinate any case. This isn't something I have given much thought about.

from addon-nut.

aquette avatar aquette commented on August 24, 2024

hey guys,
looking at the last comments, I just realized that you're running in VM mode :D
So, check the config on vmware side, there may be missing privileges for your VM to get exclusive access to your devices.
That should fix your libusb1 privileges issue.
Ref: https://docs.vmware.com/en/VMware-Workstation-Player-for-Windows/17.0/com.vmware.player.win.using.doc/GUID-E003456F-EB94-4B53-9082-293D9617CB5A.html

Then a few comments:

  • prefer to use the serial config field. device number proved to be unstable over reboot.
  • the serial reported by NUT driver should be the same as on the physical sticker... in case you can't test on a separate Linux system
  • NUT 2.8.1 (IIRC, I'm just the retired leader and author of this :D) will introduce the allow_duplicates option.
    Once Debian is updated (again, retired Debian Developer for NUT, so... :D) and thus HAOS, there should be a small edit to support it

from addon-nut.

madbrain76 avatar madbrain76 commented on August 24, 2024

@aquette
Thanks for your help.
Thanks, I have read that VMWare doc already. I have my Z-Wave USB stick working in the VM, as well as one of the two UPSes. lsusb is reporting all 3 devices are present. So, I'm confident I have the right VMWare configuration.

Re: stickers, are you referring to the "QC passed" stickers that originally were taped on the UPS by APC ? Those might have had the serial number indeed. But they were long ago removed and throw away. I don't see any other sticker on the BX1500M.

I do have another Linux system to test with, running Ubuntu 22.04. How would I get the driver to report the serial number on that machine ?

Also, shouldn't it be possible to get the serial number for the one UPS I have under HAOS? Maybe I can get both by connecting one UPS at a time to the VM.

from addon-nut.

sinclairpaul avatar sinclairpaul commented on August 24, 2024

Glad you have the addon working, I don't believe "alias" is a valid option for the driver as per the NUT docs.

Issues with the Integration will need to be logged against the Home Assistant repo, as we can't help you with that here.

Can this then be closed out.

from addon-nut.

madbrain76 avatar madbrain76 commented on August 24, 2024

Yes.

from addon-nut.

aquette avatar aquette commented on August 24, 2024

thanks for the confirmation on using serial config, glad to see your issue is fixed.
I'll check for the description unavailable (you may log an additional issue so that I don't forget ;))
Note that I'm unsure on which NUT data this description maps to. @sinclairpaul any hint welcome.
I'd also be interested in discussing with you on discord @sinclairpaul :)

Now that I've a week of HA use, I'm starting to have visibility and ideas on how to improve this NUT addon.
Look forward for news soon :)

from addon-nut.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.