APC UPS and Synology NAS integration for Home assistant

Hi togehter,

a few days ago i’ve setup my new APC UPS (BX950U-GR) for my synology DS1517+.
With the intention to track some values auf the ups, i found the components for HA:

The problem is, this ha integration seems only to work with APCUPSd NIS. But i’ve no idea which type of service is running on the synology dsm. the nas and the ups is connected with usb and i’ve activated the network ups server on the dsm.

I’ve setup the ha configuration with the right port for synology (3493) but it didn’t work:

–>
2018-03-16 09:49:46 WARNING (MainThread) [homeassistant.setup] Setup of apcupsd is taking over 10 seconds.
2018-03-16 09:50:06 ERROR (SyncWorker_17) [homeassistant.components.apcupsd] Failure while testing APCUPSd status retrieval.
Traceback (most recent call last):
File “/usr/src/app/homeassistant/components/apcupsd.py”, line 54, in setup
DATA.update(no_throttle=True)
File “/usr/src/app/homeassistant/util/init.py”, line 319, in wrapper
result = method(*args, **kwargs)
File “/usr/src/app/homeassistant/components/apcupsd.py”, line 90, in update
self._status = self._get_status()
File “/usr/src/app/homeassistant/components/apcupsd.py”, line 85, in _get_status
return self._parse(self._get(host=self._host, port=self._port))
File “/usr/local/lib/python3.6/site-packages/apcaccess/status.py”, line 41, in get
buffr += sock.recv(BUFFER_SIZE).decode()
socket.timeout: timed out
2018-03-16 09:50:06 ERROR (MainThread) [homeassistant.setup] Setup failed for apcupsd: Component failed to initialize.
<–

That components are not combatible with the synology network ups service, isn’t it?

Maybe someone any ideas to work around that?

Regards,
Dissi

If you are trying to use the synology nas component:

The correct port should be 5000.

The APCUPSd component is directly for the APC, it has no relation to Synology. Does your APC have an Ethernet connection? If the answer is no, you cannot use this component. Also, according to the docs, the correct port for the apc is 3551. The component requires you to have it connected to the network with its own IP.

hi petro.

there are 2 network ports:

but i don’t think they have any logic, they are only for overvoltage protection.

regards,
dissi

What are you trying to do with the APC component?

I use SNMP to monitor the time remaining on my Cyberpower UPS which is connected to my Snyology NAS via USB. Since I connect to Snyology and not UPS, I’m hoping this works for you.

  - platform: snmp
    name: "UPS NAS Time Remaining"
    host: 10.20.30.100 # NAS IP
    community: public
    baseoid: 1.3.6.1.4.1.6574.4.3.6.1.0
    unit_of_measurement: 'minutes'
    value_template: '{{((value | int) / 60) | int}}'
    accept_errors: true

Don’t forget to enable SNMP on the NAS

3 Likes

Another option is to enable the NUT server in DiskStation

Home Assistant Component

https://github.com/SilvrrGIT/HomeAssistant/blob/master/sensors.yaml#L45

5 Likes

works great, thanks

Hi! Old post from you, but do you have a tut how to enable NUT server in a DS?

I can make a quick walk through later if needed.

Take a look under power settings. Then UPS, you have to have the UPS connected to get the options IIRC.

Then the setting should be there.

1 Like

Would be great!

The APC UPS is now connected to the Syno NAS.

Click the “Enable network USP Server” button.

I would then limit the “Permitted DiskStation Devices” to only the IP of your HA instance. Might as well keep the access as narrow as possible.

1 Like

Ok done! Is NUT now working?

Should be.

Just so we are clear.

The Disk Station can be plugged into your UPS and shut down in the event of a power outage, no NUT required.

NUT allows you to connect the UPS to one device and create a server to broadcast that information so other devices can use this info to shutdown gracefully should the need arise.

HA uses this tool (NUT) to pull information about the status/state of a UPS.

All that to say NUT should be running, however, if you don’t setup something to query the server it will never get used.

2 Likes

Aa so i need to add NUT to HA to make it work? Just to understand how NUT works: if i would want the Syno to listen to a other NUT server (other Pi or my pfSense Router) then i do need to configure stuf in my Syno right?

EDIT: It works!! Thanks alot. Do you shutdown your Pi when UPS batt is low?

Its working, however, with nothing connecting to it, the NUT server isn’t doing anything, it is waiting for a client to connect and ask for information.

Yes, NUT can run on a number of devices. You could move the USB connection from your Disk Station to a Pi or your router and have it act as the server.

I don’t know how to make the DS listen to another NUT server though.

Awesome, will expand this to my pfSense box aswell…

So now i got it working, but not all resources are loading in HA. Could it be because the Syno NAS doesn’t give al the data? I can only see the Data the Syno shows from within DSM.

Click the ‘device information’ button shown in your screen shot above. That will display the information the DS is able to pull from the UPS. Not all UPS models provide the same info. The NUT server (DS in your case) can only serve up what it is provided by the NAS.

Well… That sucks, it only shows Batt charge and Estimated Batt time.

I can try my pfsense box and then make the Syno a NUT client. (dont know how yet but will find out!). Then i could make HA pull from the pfSense box right?

Just set my new UPS up through this guide:

It is running on a rpi where the ups is connected through USB.
it guides you through setting it up to work with synology.
I just added the NUT sensor to HA, and everything is working.

Hope it will help you.

Great!! Wil follow this guide. Thanks alot