core: Failure getting NUT ups alias

The problem

I’ve got my UPS setup with the NUT integration. When I go through a fresh install it gets setup and the sensors appear in the dash. When I check later (anything more than an hour or so) the integration has lost connection with this error message in the log:

Logger: homeassistant.components.nut
Source: components/nut/__init__.py:212
Integration: Network UPS Tools (NUT) (documentation, issues)
First occurred: 11:26:38 PM (1 occurrences)
Last logged: 11:26:38 PM

Failure getting NUT ups alias,

It looks like the log message may have more to it that’s cut off, but I’m not sure how to read it, so I can’t tell if this is a repeat of https://github.com/home-assistant/core/issues/52635 or https://github.com/home-assistant/core/issues/42154.

What is version of Home Assistant Core has the issue?

core-2021.9.4

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

Network UPS Tools (NUT)

Link to integration documentation on our website

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

Example YAML snippet

# add-on config

users:
  - username: nut
    password: {a password}
    instcmds:
      - all
    actions: []
devices:
  - name: warpdrive
    driver: usbhid-ups
    port: auto
    config: []
mode: netserver
shutdown_host: 'false'
list_usb_devices: 'true'

Anything in the logs that might be useful for us?

# From the add-on logs:

200644.326051	UPS [warpdrive@localhost]: connect failed: Connection failure: Cannot assign requested address
{"message": "Event nut.ups_event fired."}Network UPS Tools upsmon 2.7.4
200649.326718	Trying to connect to UPS [warpdrive@localhost]
200779.493984	UPS [warpdrive@localhost]: connect failed: Connection failure: Cannot assign requested address
200784.494170	Trying to connect to UPS [warpdrive@localhost]

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 34 (4 by maintainers)

Most upvoted comments

@Dude4Linux Just tested it out and so far so good. No disconnects from the integration.

Ok, I used a0d7b954-nut as the hostname, and it finally worked.

I’m running Home Assistant on a Raspberry Pi4 using HAOS with the NUT Add-on and Integrations. For months I’ve been struggling with this issue. I happen to have a Tripplite SMART1500LCDT UPS. I’ve tried about every combination of pollinterval, deadtime, and maxage that I found on this and other threads. I even upgraded the Pi’s firmware to the latest version. None of these suggestions seem to help for very long.

Now I tried setting pollonly = “enabled” and it appears to be working without disconnection (48 hours +). Thanks @eyal0 for the hint! See usbhid-ups stops working after 10-20 minutes.

I have to replace the host address in the NUT integration (not in the addon) from localhost to the addon hostname, and after that I successfully connected to my HA NUT server.