I was reviewing the code, it looks like this integrations doesn’t use upsc and upscmd like I thought but telnet. Anyways it is using a library which already has implemented the instant commands functionality so it should be easy to implement it.
I will try to find time to collaborate with a fork but I need to learn first some things about homeassistnat for the UI part.
I saw that some users use the SSH addon to make NUT run the commands with the help of automations, even if this solution uses way more steps than I’d like to (an automation that tells an addon to run a script that tells another addon to send a command)
This is something I am also missing. upscmd can give you list of possible commands and the calling of these commands through NUT integration should not be really hard to do.
Has anybody contacted developer to get his feedback on this?
Hmm, I am looking at the same thing, to control the beeper.
I have protected mode off and when I execute the command in the console I get “No such container: addon_a0d7b954_nut”
➜ /config sudo docker exec addon_a0d7b954_nut /usr/bin/upscmd -u monuser -p xxx -l eatonElipse
Error: No such container: addon_a0d7b954_nut
does the nut integration always use this container ID and how can I find the container ID of an integration, I see nothing in the logs that shows this unique id ?
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.