More UPS and Nut issues

In a previous thread, I was walked thru installing sshpass in order to issue commands to my ups units with Nut control.

Previous thread

But, my system at the time was linux with docker installed and Home Assistant installed into docker. So, I had ssh access into the HA cli and into the base system cli with access to docker from the base system.

Now I have moved to a “healty and supported” Debian 10 install still running docker, but managed by Home Assistant. I think I said that properly…

System info:

System Health

version: core-2021.2.2
installation_type: Home Assistant Supervised
dev: false
hassio: true
docker: true
virtualenv: false
python_version: 3.8.7
os_name: Linux
os_version: 4.19.0-13-amd64
arch: x86_64
timezone: America/Chicago


GitHub API: ok
Github API Calls Remaining: 5000
Installed Version: 1.11.0
Stage: running
Available Repositories: 743
Installed Repositories: 11


host_os: Debian GNU/Linux 10 (buster)
update_channel: stable
supervisor_version: supervisor-2021.02.6
docker_version: 20.10.2
disk_total: 218.1 GB
disk_used: 9.9 GB
healthy: true
supported: true
supervisor_api: ok
version_api: ok
installed_addons: Backup Hassio to Google Drive (1.7.2), Dropbox Sync (1.3.0), Duck DNS (1.12.5), FTP (4.0.0), File editor (5.2.0), Log Viewer (0.9.1), RPC Shutdown (2.2), WireGuard (0.5.0), Mosquitto broker (5.1), SSH & Web Terminal (8.0.1), Samba share (9.3.0), TasmoAdmin (0.14.0), motionEye (0.11.0), AdGuard Home (3.0.0), Portainer (1.4.0), Glances (0.11.0), Check Home Assistant configuration (3.6.0), Network UPS Tools (0.5.0), DHCP server (1.2)


dashboards: 1
resources: 3
views: 16
mode: storage

So, now I only have access to the Home Assistant cli via SSH with the SSH addon. I no longer have SSH access to the base system, staying in compliance with a proper install. In the Home Assistant shell I can issue the following command and get the expected results:

sudo docker exec addon_a0d7b954_nut upsc DR_UPS

If the command is issued via a command line switch, I get an error both from the homeassistant.components.command_line and homeassistant.components.command_line,switch:

Command failed: sudo.docker exed addon_a0d7b954_nut upsc DR_UPS

I am not sure how to get this to work, the linked solution in the previous tread does not make sense now that I am running a system without base system shell access.

The command does not work in the container homeassistant when the cli is accessed via portainer. It does work in the cli of the nut container as the command only. “upsc DR_UPS”

The upsc command is being used only for non=disruptive testing. Other commands will be actually used to initiate UPS tests and configure things like low voltage, shutdown times and self test triggers.

Any ideas?
Thanks Matt