I don’t get it to work somehow, maybe anyone can help me out…
Config:
Home Assistant running on Synology Docker (everything is working, except nuts)
Using separate file for my sensors: sensor.yaml (included in my configuration.yaml)
For testing, I allowed all port 3493 communications in my Synology firewall
Added, in the Synology UPS Control Panel ‘Permitted Diskstation devices’:
When I use my Linux computer, with command: upsc [email protected]
I have a output:
Init SSL without certificate database
battery.charge: 100
…
battery.runtime: 2880
…
battery.voltage: 27.1
battery.voltage.nominal: 24.0
device.mfr: American Power Conversion
device.model: Smart-UPS 750
…
ups.status: OL
…
Even with a telnet command from my computer: telnet 192.168.6.9 3493
ask for the variables with connected telnet command: LIST VAR ups
I got output:
VAR ups battery.charge “100”
VAR ups battery.charge.low “10”
…
VAR ups battery.voltage “27.1”
VAR ups battery.voltage.nominal “24.0”
VAR ups device.mfr "American Power Conversion "
VAR ups device.model “Smart-UPS 750”
…
VAR ups ups.status “OL”
…
So, the Synology Home Assistant Docker is somehow not able to connect:
2018-12-15 17:49:35 ERROR (SyncWorker_2) [homeassistant.components.sensor.nut] NUT Sensor has no data, unable to set up
2018-12-15 17:49:35 WARNING (MainThread) [homeassistant.components.sensor] Platform nut not ready yet. Retrying in 180 seconds.
What am I missing here?
EDIT: Found something. When using my Synology WAN IP as host: it is working. Something to do with the Synology Home Assistant Docker. It is communicating on the wrong Ethernet card. When checking in the Docker, I can see two cards setup (ifconfig).
Now I have to figure out how a way to solve this…
No, it is not needed. I found the reason why it was not working…
I have a Synology NAS with two Ethernet cards. The Home assistant is installed on the Synology, using the Synology Docker package. The network configuration of the Home Assistant Docker container is set to host, meaning it will use the NAS Ethernet settings.
The Syno first card settings is set to a ‘WAN’ (kind of WAN inside my LAN) and the second is set to my LAN side. So, normally I have to use the LAN IP-address.
I did some reading and checking, and it appears that in the Syno Docker Package you can’t disable one Ethernet card. If you want to do that you could use the Virtual Manager Manager package but my Syno is not on the applied list, so I can use that.
Eventually I used the IP of my Synology ‘WAN’ side. Also for the Synology UPS NUT server setting and my Syno Firewall settings. Now it is working!
So it seems that the HA Docker NUT component only communicates on one port…
I don’t know how to ‘fix’ it but it will do for now. BTW, no user/password setting is needed in the NUT component. (alias must set to ups)
If anybody has troubles, try to connect with telnet for testing.
finally work with me
i connect the ups to synology and enable the UPS server in synology like in the photo
i put the IP for HA in permitted Diskstation devices
in HA config for sensor is:
- platform: nut
name: NUT UPS
host: 192.168.xxx.xxx
resources:
- ups.model
- ups.status.display
- ups.load
- ups.realpower.nominal
- input.voltage
- battery.runtime
no need for the username and password or the port
my only problem is the NUT UPS battery run time is in second not in minute is there a way to make it in minute ?
Thank you very much for the help, I have been in HA for a short time and there are no things that drive me crazy. I did what you told me but there is something that does not work well, create a new sensor and I get this (the one below) the one above is the standard sensor.
I don’t know how that ever worked for you. That will always return 0, no matter what. You’re casting a state object as an int. Then you you it again. This is a state object, it is not the ‘state’. That syntax in all versions of home assistant is invalid. It only would have have worked if you added .state at the end.
{% set time = states.sensor.apc_pro_rs900g_battery_runtime.state | int %}
^
^
^
For anyone interested, I’ve got my setup working with my APC Smart-UPS plugged in to HA and then Synology as the slave, rather than the other way around.
This configuration approach should also work when connecting to any other NUT.
Does anyone know how to get the NUT UPS Device Info into a sensor so that I can display it in lovelace? I have the NUT integration configure and while I see it on the NUT devices page as shown below, i just dont have it in a sensor for display elsewhere. I was wondering if I should manually add NUT and then specifiy all the attributes you can pull from NUT in the manual config if that woul do it? Any help would be appreciated.
I was able to set up my HA as a slave connected to my Synology master UPS server which is connected to my APC via USB. Once you add your HA device IP to the Permitted Synology NAS Devices, you can configure HA NUT as follows: