UPS USB signal passed to HA Virtualbox guest possible?

The host has a CyberPower USB cable from the UPS for power status and shutdown signal if needed. Can this signal 1) be passed to the HA Virtualbox guest to trigger automations while 2) still maintain the host’s ability to “see” the USB signals?

If so, how?

Thanks.

Hi, I don’t know if this applies to CyberPower devices, but I have an APC Back-UPS-750 connected via USB to my Ubuntu Machine (Host) that is running Home Assistant on a VirtualBox (Guest). I am able to monitor the UPS on HA via the Network UPS Tool Integration and monitor the UPS also on the Ubuntu Machine via NUT (Network UPS Tools).

On HA (Guest)

On Ubuntu (Host)

[ubuntu@f-N40]:(32.4kb)/etc/nut$ upsc apc-750@localhost
Init SSL without certificate database
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.date: 2001/09/25
battery.mfr.date: 2012/10/04
battery.runtime: 1680
battery.runtime.low: 120
battery.type: PbAc
battery.voltage: 13.8
battery.voltage.nominal: 12.0
device.mfr: American Power Conversion
device.model: Back-UPS ES 750G
device.serial: 3A2547W40455  
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.synchronous: no
driver.version: 2.7.4
driver.version.data: APC HID 0.96
driver.version.internal: 0.41
input.sensitivity: medium
input.transfer.high: 139
input.transfer.low: 92
input.transfer.reason: input voltage out of range
input.voltage: 120.0
input.voltage.nominal: 120
ups.beeper.status: disabled
ups.delay.shutdown: 20
ups.firmware: 841.I4 .D
ups.firmware.aux: I4 
ups.load: 1
ups.mfr: American Power Conversion
ups.mfr.date: 2012/10/04
ups.model: Back-UPS ES 750G
ups.productid: 0002
ups.realpower.nominal: 450
ups.serial: 3A2547W40455  
ups.status: OL
ups.test.result: No test initiated
ups.timer.reboot: 0
ups.timer.shutdown: -1
ups.vendorid: 051d

I used this guide to install the drivers on ubuntu.

Once you have it setup and running the UPS will be auto discovered by HA by the NUT integration. If not, then you can add it manually under Settings > Devices > Integrations on HA

1 Like

@luisgarcia87 thank you. This helped a lot. Even though I don’t use Ubuntu as my host, your information gave me enough pieces to get NUT working (and learn about NUT in the first place). I have an APC connected to a NAS, the NAS is now a NUT server and the HA guest connected to it the first time and all is working. Cheers!

And just for others that come by this thread.
No, USB devices can’t be shared on hardware level.

1 Like

Great to hear that you got it working!

Correct. I didn’t specified it on my post that the USB is connected to the host and I integrate it via software to HA.

Your software still emulates hardware, so it is a hardware connection here also.

In addition to the network UPS monitor I set up via NAS, I wanted to also monitor another UPS that is connected to the host for HA.

Previously, I used CyberPower’s PowerPanel for local monitor and shutdown. After installing NUT and the driver, PowerPanel no longer “sees” the USB-connected UPS. Is this where NUT has taken over the COM port and I will need to configure NUT to emulate (or maybe pass through) the COM port so PowerPanel can see the UPS again?

I’m not even concerned about HA integration at this point. I would simply like to restore the PowerPanel’s USB connection to the UPS.

Thanks.

Com ports and USB ports is single use only, so only one OS can use it.
NUT will be using it in your case and no other program can then use it.
NUT might relay the values through some kind of network service, which can then be accessed and maybe even be multiple simultaneous connections.

1 Like

Thanks. So in this case I guess NUT’s driver took over, which is why PowerPanel no longer sees the UPS?

Another question–in HA, what is the difference between the NUT Integration and NUT Add-On? I was able to use the integration to connect to a NAS with UPS enabled, but not sure what the Add-On provides.

Thanks for all the help!

The add-on is a Nut Server. The integration is a Nut Client. Your NAS likely provides a Nut Server so you don’t need the add on. The Nut Server connects to the UPS device usually via USB. So the comms path is

UPS → USB driver → Nut Server → Nut Client (ha integration)

1 Like

@PeteRage thanks for taking the time to answer. I eventually figured out the same. Interestingly, I was not able to get NUT to work on the host, but was able to get the NUT-addon working on HA, so I guess HA will be the server rather than the host machine.

I may revisit and try to get NUT server working on the host because during a power outage and low battery conditions, I want HA to fully shutdown, then the host to shutdown. I don’t see how I can do this with HA as the NUT server.

As a related matter, I have been unsuccessful with finding a way to get Windows to tell the guest to shutdown and wait for the guest to complete its shutdown before Windows reboots or shuts down. The shutdown/reboot happens during Windows update. I know I can disable the update, but it would be nice to have a smooth workflow of shutdown. If anyone knows of a reliable solution, please do chime in. I asked this question in another thread, the answer I got was “don’t use Windows as the host”.

hi, I purchased a tecnoware Era plus 1100. HA OS is installed in win10 - Virtualbox.
in VB USB devices I only see the Sonoff USB Zigbee Dongle but not the UPS, I think this is the main problem, right?
This is the NUT integration log at startup.
Anyone have any idea how to fix it?
Thank you
Emanuele

no one helps me?

You should make your own thread.
This one will be ignored by many because it is already being handled.

Your case is the same though.
Only one thing can use the USB device.