hassio-addons / addon-nut

Network UPS Tools - Home Assistant Community Add-ons
https://addons.community
MIT License
194 stars 37 forks source link

UPS NUT Server and NUT monitor on Home Assistant Blue #211

Closed PaulLeadbeater1 closed 2 years ago

PaulLeadbeater1 commented 2 years ago

I am relatively new to home assistant. I have a home assistant blue which is working properly. I have added the network ups tools add on to my assistant. I am now trying to add the n u t integration. The integration requires host port username and password. I have tried various combinations of information and the integration fails to connect to the server. Is there a step-by-step set of instructions to tell me how to achieve connection? - Such as - is The Host localhost or IP address or http:/ip address or what? Or am I doing something fundamentally wrong?

PaulLeadbeater1 commented 2 years ago

Here is some extra info, if it helps someone to advise me. I am using a 'Salicru sps one' UPS. It is connected to a Home Assistant Blue (odroid N2+) by usb. I have installed Home Assistant add-on 'NUT'. It's config is:- devices:

The add-on log shows:- Info Documentation Configuration Log Network UPS Tools [s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] nut: applying... [fix-attrs.d] nut: exited 0. [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] 00-banner.sh: executing...

Add-on: Network UPS Tools Manage battery backup (UPS) devices

Add-on version: 0.9.0 You are running the latest version of this add-on. System: Home Assistant OS 7.1 (aarch64 / odroid-n2) Home Assistant Core: 2021.12.9 Home Assistant Supervisor: 2021.12.2

Please, share the above information when looking for help or support in, e.g., GitHub, forums or the Discord chat.

[cont-init.d] 00-banner.sh: exited 0. [cont-init.d] 01-log-level.sh: executing... [cont-init.d] 01-log-level.sh: exited 0. [cont-init.d] nut.sh: executing... [21:07:45] INFO: Setting mode to netserver... [21:07:45] INFO: Generating /etc/nut/upsd.users... [21:07:45] INFO: Configuring user: pfjl [21:07:46] INFO: Password is NOT in the Have I Been Pwned database! Nice! [21:07:47] INFO: Configuring Device named myups... [21:07:47] INFO: Starting the UPS drivers... Using protocol: Voltronic-QS 0.07 No values for battery high/low voltages Using 'guesstimation' (low: 10.400000, high: 13.000000)! Battery runtime will not be calculated (runtimecal not set) Network UPS Tools - UPS driver controller 2.7.4 [cont-init.d] nut.sh: exited 0. [cont-init.d] nutclient.sh: executing... [cont-init.d] nutclient.sh: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. [21:07:49] INFO: Starting the UPS information server... 0.000000 fopen /run/nut/upsd.pid: No such file or directory 0.000582 listening on 0.0.0.0 port 3493 0.000979 Connected to UPS [myups]: nutdrv_qx-myups [21:07:50] INFO: Starting the UPS monitor and shutdown controller... 0.000000 fopen /run/nut/upsmon.pid: No such file or directory 0.000270 Using power down flag file /etc/killpower 0.000414 UPS: myups@localhost (master) (power value 1) 0.000481 debug level is '1' 0.000490 Warning: running as one big root process by request (upsmon -p) 0.000759 Init SSL without certificate database 0.002696 Trying to connect to UPS [myups@localhost] 0.490121 User upsmonmaster@127.0.0.1 logged into UPS [myups] 0.003799 Logged into UPS myups@localhost

I understand some of the above, but not enough to troubleshoot. I will be grateful for any assistance.

sinclairpaul commented 2 years ago

The addon logs show that the addon is started correctly and working. It appears that you question is around the Home Assistant integration.

As per the docs at:

https://github.com/hassio-addons/addon-nut/blob/main/nut/DOCS.md#home-assistant-community-add-on-network-ups-tools

You can use the hostname a0d7b954-nut to connect to the addon from the integration.

I would suggest that for config queries you will get a quicker response on the community forums or Discord, we use Github for issue tracking.

PaulFLeadbeater commented 2 years ago

Paul, Many thanks for your reply. I have seen that hostid mentioned elsewhere. Out of interest, where did it come from? I will try again, and thanks for pointing me to the right place for thses sort of queries. I haven't used forums very often so I am unfamiliar with the protocol. Apologies for making a noobie entry. Paul

PaulFLeadbeater commented 2 years ago

Added your "Host ID' - everything fired up! NUT fully working within Home Assistant. Thanks again for your expert advice.

PaulFLeadbeater commented 2 years ago

Perhaps a silly question, but how do I close this issue?

sinclairpaul commented 2 years ago

Glad you got it working, to answer the question of where it comes from, its the individual ID assigned to the container by the Home Assistant Supervisor, it is the same for every install (it's based on a has on the repo I believe).

Closing is a button on the comment, but I'll do it for you :)