The nut integration is used when you want HA to become a client of an existing NUT server. It pulls info from it into sensors and such so you can use that info in automations.
The NUT addon is a NUT server. It’s used when you have a UPS attached to the HA machine. Then HA can use the NUT integration to talk to the addon and pull in info from that UPS.
Also in general integrations are part of HA. They don’t run in a separate container or even a separate process, they’re just HA. If you use them the code is loaded, if not then it’s not.
Addons are entirely separate software. They run in their own docker container. It’s often possible to load/configure an integration in HA which then talks to them (Mqtt, nut, influx, etc). Sometimes they only talk to HA (nginx ssl proxy, node red, studio code server, etc). Sometimes they just completely do their own thing alongside HA (let’s encrypt, duckdns, bitwarden, bookstacks, etc). It varies.
I submitted a pull request to add a new service to run the commands. Let’s see if it makes it to the next release.
In the next iteration I can add a sensor with the available commands.
My Cyber Power unit was displaying that the battery was healthy but in reality it was not. The unit failed a couple of times when we lost power, so I decided to run a self test and it failed again. With the new service I can run periodic self tests and be alerted about when it is time to replace the battery again.
I believe in the release of April 2023, since it looks like we just missed the cutoff date for the March one (the pull request is still open).
The commands will show up as device actions, meaning that you can use them in automations. My initial idea was to use services, but after some discussion we agreed that device actions were a better fit.
I am attaching a screenshot from my local dev environment. Apologies for the delayed response, somehow I had missed your comment.
The PR has not had activity for some time and is still pending approval, so I guess it won’t be included in the April release. I just pinged the reviewer to see if there is anything else required from my end.
The wait is over . The ability to run commands as device actions made it to the May 2023 release. The NUT integration now includes a section dedicated to Device Actions.
can this be used to change battery.date or other variables? and how do I execute the commands. in your link it shows upscmd -l and and example, but I don’t know where to input the commands.
I would really like to contribute, but have no experience with contributing to an add-on.
Is there a guide?
I have a large UPS ( 9355-30-NL-15 by Powerware Corporation - 27 kW - 28 kWh)
The driver in NUT has only a few device actions.
I have communication up and running and can perform test
I would ideally have all the controls that are described in the manual- see pic.
Maybe there is some guide how to do this? Unfortunately I do not have an access to my HA with UPS right now (it is in other country), so I cannot check this… But maybe the integration author can help?
You can see the actions in a few ways, like when creating a script or automation from the UI and selecting as one of the actions Device Actions.
For a script: Settings > Automations & scenes > Scripts (on the top) > Add script > Create new script > Add Action > Device > Look for your UPS device in the Device dropdown
The Action dropdown will have all the available actions.
Noob question, but how are you running docker exec? I’ve tried to run it in both the VSCode addon’s terminal & ssh addon, and in both cases, I’m getting:
$ docker
zsh: command not found: docker
Obviously, this is because both of these terminals are running a docker container themselves, but that begs the question, how do you shell into the docker host itself? Are you using the Home Assistant debug mode?
Yes, I used Debug Mode to execute the command (you need ssh access to the host in order to control the docker containers, you cannot send commands from within an Add-on itself).
But if you don’t want to go through all that, now device actions are available for Network UPS Tools, so you can create a script / automation that executes the command on the chosen UPS.
When you are creating your script / automation, just add a device action and search for your UPS with the name you have given to it, then it will list all the possible commands you can run.