Page 3 of 7

Re: Python plugin: UPS Monitor

Posted: Thursday 15 February 2018 20:51
by ycahome
Also, am wondering if you could include a bash script on your plugin in order to update with a single command:

filename: upgrade.sh

Code: Select all

#!/bin/bash

git reset --hard
git pull --force
sudo chmod +x plugin.py
sudo chmod +x upgrade.sh
sudo /etc/init.d/domoticz.sh restart
this way, next time you can upgrade with a single command

Code: Select all

sudo ./upgrade.sh

Re: Python plugin: UPS Monitor

Posted: Thursday 15 February 2018 23:00
by Logread
@ycahome,

Thanks for the suggestions... please feel free to contribute the script on GitHub and/or the wiki

Re: Python plugin: UPS Monitor

Posted: Saturday 17 February 2018 6:05
by hamster
Logread wrote: Thursday 15 February 2018 14:13 New version 0.2.1 is available.
AWESOME! Will install and begin testing.

Re: Python plugin: UPS Monitor

Posted: Saturday 17 February 2018 8:18
by manutremo
Hi, just wanted to let you know that I just installed it on my Synology and it works perfect. Many thanks!

Re: Python plugin: UPS Monitor

Posted: Saturday 17 February 2018 17:24
by Logread
manutremo wrote: Saturday 17 February 2018 8:18 Hi, just wanted to let you know that I just installed it on my Synology and it works perfect. Many thanks!
Thanks for the positive feedback 8-)

Re: Python plugin: UPS Monitor

Posted: Saturday 17 February 2018 19:01
by nmaster
Hi Logread,

I upgraded to the last plugin version, all is fine here with 4 UPS.

Re: Python plugin: UPS Monitor

Posted: Sunday 18 February 2018 15:05
by Velly
Help needed with EATON 9130 running on Windows 10:
EATON 9130
ip of Windows server : 192.168.1.107
port: 4679
Usp name in EATON Intelligent Power Manager: EATON9130

error:
2018-02-18 16:57:52.553 Error: (UPS EATON) Error reading UPS variables: HTTP/1.0 501 Not Implemented
2018-02-18 16:58:44.241 Error: (UPS EATON) Error reading UPS variables: HTTP/1.0 501 Not Implemented
2018-02-18 17:00:09.587 Error: (UPS EATON) Error reading UPS variables: HTTP/1.0 501 Not Implemented
2018-02-18 17:01:18.703 Error: (UPS EATON) Error reading UPS variables: HTTP/1.0 501 Not Implemented
2018-02-18 17:02:18.751 Error: (UPS EATON) Error reading UPS variables: HTTP/1.0 501 Not Implemented

Anybody with NUT on Windows Intelligent Power Manager?
Thank you!

Re: Python plugin: UPS Monitor

Posted: Monday 19 February 2018 1:35
by hamster
Latest update working great for me on pi Logread. Thanks!

Re: Python plugin: UPS Monitor

Posted: Monday 19 February 2018 7:27
by Logread
Velly wrote: Sunday 18 February 2018 15:05 2018-02-18 16:57:52.553 Error: (UPS EATON) Error reading UPS variables: HTTP/1.0 501 Not Implemented
@Velly, looks like you are configuring the plugin to hit a http webserver (the Eaton intelligent power manager) rather than a NUT server... first make sure you have a NUT server up and running and adjust to the right IP/Port

Re: Python plugin: UPS Monitor

Posted: Tuesday 27 February 2018 13:48
by jeecee
Tnx a lot, works perfectly!

Re: Python plugin: UPS Monitor

Posted: Wednesday 14 March 2018 20:52
by febalci
@Logread, thanks for the great work! Works perfectly with 2 APC BX950U-GR UPSes. One of them is installed on a Synology and the other one on ubuntu Domoticz Server Intel NUC. Everything works perfectly, i also set a notification on UPS Alert Sensor; If svalue is 'ONBATTERY DISCHARGING', send a notification as 'Power Cut!!!', If 'ONLINE CHARGING' send 'Power Back ON!'. However, as you have guessed the status change waits up to 1 minute for UPS Status update. Is there any way you can suggest for the status change to be reflected instantenously?

Thanks again...

Python plugin: UPS monitoring

Posted: Wednesday 04 April 2018 23:02
by Number8
I recently installed this plugin, it works like a charm. It happens that the NUT server is a Synology NAS that is shut down every night. Power resumes in the morning. I wonder whether the plugin could take that into account in order to avoid the flooding of the log.
Thank you

Re: Python plugin: UPS monitoring

Posted: Sunday 08 April 2018 17:41
by Number8
For those that might be interested, I modified the script as follows:
In def __init__(self):
Added

Code: Select all

self.commerror = False
[/code]
And in the try section of I made this modification

Code: Select all

            except Exception as errorcode:
                if self.commerror == False:
                    Domoticz.Error("Cannot communicate with NUT Server at {}:{} due to {}".format(Parameters["Address"], Parameters["Port"], errorcode.args))
                    self.commerror = True
                self.error = True
                self.UpdateDevice("ups.status")  # we flag the error to the status device
            else:
                if self.commerror == True:
                    Domoticz.Log("Communication with NUT Server resumed at {}:{}))                    
                    self.commerror = False
So the communication error is reported once a day in the described scenario, and not every minutes, which is in my case useless and tend to spoil the log system. One could think the logic could be refined, that is take into account the periods when the NUT server (NAS Synology) is shutdown. I must admit I've been a bit lazy.

Re: Python plugin: UPS monitoring

Posted: Sunday 08 April 2018 18:22
by Logread
@Number8,

I assume you refer to the NUT UPS plugin I wrote... almost by definition a UPS works 24/7 and so does my own synology server... and I have had a DS710+ working 24/7 since 2010 with the same HDDs that I only replaced two months ago not because it died but because it’s DSM version was obsolete. But this is off topic...

I would not recommend adding the tweak you described to the plugin standard code because most of us immediately want to know when the reading of the UPS status is incorrect or impossible.

I’d rather suggest that if you really need/want to shut down the NAS at night, you connect your UPS to your Raspberry and install a NUT server on the Pi... then you get 24/7 monitoring by domoticz and can still have your NAS safe shutdown if it is on when a power failure happens (though this set up probably requires some linux skills as probably not off the shelf from DSM).

Re: Python plugin: UPS monitoring

Posted: Sunday 08 April 2018 18:45
by Number8
First of all I'd like to thank you for this very handy and excellent plugin.
almost by definition a UPS works 24/7
This is an endless debate, I can't say I disagree, neither I agree, it depens. My professional experience on this matter says that disk failures do not depend on 24/7 operation or nightly shutdown, and all NAS are powered by UPS. I'm not referrring to big farms, but small professional operations.
So, yes I agree that it would be preferable to install the code on a RaspPI which is a bit more engaging, that this ready made one. On my side I don't have time to dig into that.
I just wanted to share this modification, which is perfect in my specific case, no intent to ask for a modification, whatsoever.
Again, thank you
Nicolas

Re: Python plugin: UPS Monitor

Posted: Thursday 26 April 2018 10:34
by copernicnic
Hello, thanks for the plugins :D . I have a little worry with nut, my ups is directly plugged into my raspberry and the server nut is also on the raspberry. my problem is that i can not disable user / password access.
do you have an idea of ​​how?

Re: Python plugin: UPS Monitor

Posted: Friday 27 April 2018 7:39
by Logread
@copernicnic, authentication is not yet handled by the plugin. Not difficult to implement, bear with me for a few days and I’ll send you by pm a new version for testing.

Re: Python plugin: UPS Monitor

Posted: Friday 27 April 2018 10:57
by copernicnic
hello, everything is ok now :D :D , just wait a moment that domoticz update the device.
do you know what value to put in the event to make interact?
screenshot 2018-04-27 à 10.54.41 1.jpg
screenshot 2018-04-27 à 10.54.41 1.jpg (34.77 KiB) Viewed 7902 times
Thank you very much for your work

Re: Python plugin: UPS Monitor

Posted: Friday 27 April 2018 11:32
by copernicnic
@Logread,
I just tested the plugin you sent me, it does not work unfortunately. here is the log
The attachment screenshot 2018-04-27 à 11.28.57.jpg is no longer available
I just saw in the command that there is a story of master and slave
The attachment screenshot 2018-04-27 à 11.28.57.jpg is no longer available

Re: Python plugin: UPS Monitor

Posted: Friday 27 April 2018 19:18
by Logread
@copernicnic, let’s debug this by private message rather than posting on the public thread, to avoid clogging it... in my last pm, I told you that the edits were not tested... since my own setup does not require a login. Let me do some investigations in the network ups tools code and docs but this will not be before several days.
In the meantime, if you have the knowledge to do this, please try to login from shell with a telnet session and post me the result by pm, not on the forum thread pls.