Network UPS Tools (NUT) integration issues errors

I have configured successfully a NUT server in my RPi and I can get UPS values from a remote client by using upsc.

I added the NUT integration in Home Assistant by adding the following in the configuration.yaml file under the sensors section:

  - platform: nut
    name: "UPS"
    host: 192.168.1.100
    port: 3493
    resources:
      - ups.load
      - ups.temperature
      - ups.status
      - input.voltage
      - input.frequency
      - output.voltage
      - battery.voltage
      - battery.charge

However when I restart Home Assistant the entity is not available and I get the following error in the log file:

2020-07-05 18:51:20 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 129, in async_init
    flow, flow.init_step, data, init_done
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 201, in _async_handle_step
    result: Dict = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/nut/config_flow.py", line 143, in async_step_import
    if self._host_port_alias_already_configured(user_input):
  File "/usr/src/homeassistant/homeassistant/components/nut/config_flow.py", line 218, in _host_port_alias_already_configured
    for entry in self._async_current_entries()
  File "/usr/src/homeassistant/homeassistant/components/nut/config_flow.py", line 218, in <setcomp>
    for entry in self._async_current_entries()
  File "/usr/src/homeassistant/homeassistant/components/nut/config_flow.py", line 106, in _format_host_port_alias
    host = user_input[CONF_HOST]
KeyError: 'host'

Any ideas what to look for?

Thank you in advance!

So I had this same issue, it was because i had “ignored” the nut sensor originally (from another machine). Try going to integrations, the 3 dots in the corner, show ignored and stop ignoring.

1 Like

So simple and it resolved my problem.

Thank you mattlebaugh!!!

Have a similar problem
Server is running - while integration connection give me
Verbindungsfehler: [Errno 113] Connect call failed (‘172.30.33.5’, 3493)
the host name i think is correct but the ip is public not mine probably nabucasa

hmmm cannt connect

What is the IP address of your NUT Server?
Did HA auto-discover the NUT Server?