Python plugin: UPS Monitor

Python and python framework

Moderator: leecollings

toutazimuth
Posts: 16
Joined: Tuesday 29 September 2015 19:20
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python plugin: UPS Monitor

Post by toutazimuth »

Hi Logread
Your Python plugin UPS monitor, works perfectly with my Pi3B, Python 3.4, Domoticz béta 9424, Synology and eaton 650 Pro.
everything is great
Thx ;)
Logread
Posts: 229
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python plugin: UPS Monitor

Post by Logread »

toutazimuth wrote: Friday 11 May 2018 20:47 Hi Logread
Your Python plugin UPS monitor, works perfectly with my Pi3B, Python 3.4, Domoticz béta 9424, Synology and eaton 650 Pro.
everything is great
Thx ;)
Thanks for your appreciation !
User avatar
lmet
Posts: 23
Joined: Wednesday 19 July 2017 22:35
Target OS: Raspberry Pi / ODroid
Domoticz version: v4.9700
Location: France
Contact:

Re: Python plugin: UPS Monitor

Post by lmet »

Hi,
Now i have UPS Monitor working fine on Domoticz 4.9700 using stretch.
For me the reason was python version 3.5.1.x after downgrade it to 3.4.1.x all is Ok now.
Thanks a lot for this very usefull plugin.
legus49
Posts: 1
Joined: Monday 05 November 2018 1:26
Target OS: Linux
Domoticz version: 3.7207
Location: Bretagne ;-)
Contact:

Re: Python plugin: UPS Monitor

Post by legus49 »

Hi,
I just installed UPS Monitor and it's working fine on Domoticz 3.7207, but I do not have the units for the sensors (Volt, %, W...) Any idea ?
Thanks a lot for this very usefull plugin.
Logread
Posts: 229
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python plugin: UPS Monitor

Post by Logread »

legus49 wrote: Monday 05 November 2018 1:34 Hi,
I just installed UPS Monitor and it's working fine on Domoticz 3.7207, but I do not have the units for the sensors (Volt, %, W...) Any idea ?
Thanks a lot for this very usefull plugin.
Your version of Domoticz probably is too old... as said in the installation instructions it must be 3.7418 at a minimum. You should also disable the plugin (to delete its devices) before upgrading domoticz and re-enabling the plugin. Hopefully this should fix the issue you are having.
Skydesign
Posts: 7
Joined: Monday 31 December 2018 7:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: UPS Monitor

Post by Skydesign »

Hi.
Thank you for the plugin.
I installed a plugin that monitors UPS Power Walker with blazer_usb driver, in the terminal it displays a lot of information, eg input voltage, power, battery voltage, etc. Unfortunately, domoticz shows only a few data:
UPS status mode, UPS AC ferquency, UPS Charge %, UPS Load %, UPSAC Input.
How can I add more sensors eg battery voltage?
Logread
Posts: 229
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python plugin: UPS Monitor

Post by Logread »

Skydesign wrote: Monday 31 December 2018 7:44 Hi.
Thank you for the plugin.
I installed a plugin that monitors UPS Power Walker with blazer_usb driver, in the terminal it displays a lot of information, eg input voltage, power, battery voltage, etc. Unfortunately, domoticz shows only a few data:
UPS status mode, UPS AC ferquency, UPS Charge %, UPS Load %, UPSAC Input.
How can I add more sensors eg battery voltage?
The list of status variables handled by the plugin is embedded in the code:

Code: Select all

        self.variables = {
            # key:              [device label,         unit, value, device number, used by default]
            "ups.status":       ["UPS Status",          "",  0,     1, 1],
            "battery.charge":   ["UPS Charge",          "%", None,  2, 1],
            "battery.runtime":  ["UPS Backup Time",     "s", None,  3, 1],
            "input.voltage":    ["UPS AC Input",        "V", None,  4, 0],
            "ups.load":         ["UPS Load",            "%", None,  5, 0],
            "ups.realpower":    ["UPS Power",           "W", None,  6, 0],
            "input.frequency":  ["UPS AC Frequency",   "Hz", None,  7, 0]
        }
If your UPS server reports other variables that you want to capture, the above table needs to be expanded accordingly.
bob69740
Posts: 2
Joined: Tuesday 01 January 2019 16:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Location: France - Lyon
Contact:

Re: Python plugin: UPS Monitor

Post by bob69740 »

Hello,

I just found your python plugin and i wanted to install it on my Domoticz Raspberry.
My UPS is an APC Back-UPS BX700.

I have installed your plugin in following this : https://www.domoticz.com/wiki/Plugins/NUT_UPS.html
But i think i have to install a nut server on my Raspberry, and i don't know where found tutorial to install it.

Can you please help me, or say me where i can found informations to install NUT server on the raspberry to use your plugin.

Thank you for your help :)
hamster
Posts: 42
Joined: Friday 28 April 2017 19:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: USA
Contact:

Re: Python plugin: UPS Monitor

Post by hamster »

Skydesign
Posts: 7
Joined: Monday 31 December 2018 7:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: UPS Monitor

Post by Skydesign »

Logread wrote: Tuesday 01 January 2019 10:32 If your UPS server reports other variables that you want to capture, the above table needs to be expanded accordingly.
Thank you, it works great
bob69740
Posts: 2
Joined: Tuesday 01 January 2019 16:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Location: France - Lyon
Contact:

Re: Python plugin: UPS Monitor

Post by bob69740 »

hamster wrote: Tuesday 01 January 2019 17:31 http://lmgtfy.com/?q=raspberry+pi+nut+setup

top result
Thank you :)
I have succeed (almost).
Some information are now visible on domoticz.

But about all 2 days, the informations are not transmits to domoticz.
I have to restart "upsdrvctl" manually with putty "sudo upsdrvctl start" and it's good for 2 days approximatly. The raspberry is always online, and domoticz doesn't restart.


Image

Image

Have you somes ideas about this problem, or somes keywords with lmgtfy ;)

Thanks,
haden
Posts: 7
Joined: Sunday 28 February 2016 17:11
Target OS: Windows
Domoticz version:
Contact:

Re: Python plugin: UPS Monitor

Post by haden »

Thanks for nice plugin. works great

But for some reason i'm unable to see logs from any of the UPS devices on my Android phone using the lite app. It works fine for other sensors, and the UPS logs is working fine in a normal browser.
Logread
Posts: 229
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python plugin: UPS Monitor

Post by Logread »

haden wrote: Monday 14 January 2019 21:29 Thanks for nice plugin. works great

But for some reason i'm unable to see logs from any of the UPS devices on my Android phone using the lite app. It works fine for other sensors, and the UPS logs is working fine in a normal browser.
Probably because the UPS devices created in domoticz are of « custom » type and I suspect these devices are not fully handled by the mobile app... but this is just a guess
renevb
Posts: 3
Joined: Sunday 03 March 2019 22:35
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Python plugin: UPS Monitor

Post by renevb »

Thanks for this great plugin. works great. The only problem i have is getting the actual status notification "like online"and running on battery etc send as an email alert or push. I can get it to send the status change via notifications or blockly but i cant not get it to send also the actual text i see in the logs like charging or on battery etc. The value is always 0? Anybody have a clue how to send the actual text data with it?

René
droop7
Posts: 2
Joined: Monday 03 July 2017 14:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Belgium
Contact:

Re: Python plugin: UPS Monitor

Post by droop7 »

Hello everybody

I try to word with this script but i'm a little bit blocked.

2019-04-09 15:51:14.549 Error: (APC) 'onStart' failed 'KeyError'.
2019-04-09 15:51:14.549 Error: (APC) ----> Line 199 in /home/pi/domoticz/plugins/NUT_UPS/plugin.py, function onStart
2019-04-09 15:51:14.549 Error: (APC) ----> Line 89 in /home/pi/domoticz/plugins/NUT_UPS/plugin.py, function onStart

2019-04-09 16:00:34.501 (APC) Processing 'onHeartbeatCallback' message
2019-04-09 16:00:34.501 (APC) Calling message handler 'onHeartbeat'.
2019-04-09 16:00:34.558 (APC) Variable UPS Load = 7
2019-04-09 16:00:34.558 (APC) Creating device 'UPS Load'.
2019-04-09 16:00:34.558 (APC) Variable UPS Backup Time = 5226
2019-04-09 16:00:34.559 (APC) Creating device 'UPS Backup Time'.
2019-04-09 16:00:34.559 (APC) Variable UPS Power = None
2019-04-09 16:00:34.559 (APC) Variable UPS Charge = 100
2019-04-09 16:00:34.559 (APC) Creating device 'UPS Charge'.
2019-04-09 16:00:34.559 (APC) Variable UPS AC Input = 230.0
2019-04-09 16:00:34.560 (APC) Creating device 'UPS AC Input'.
2019-04-09 16:00:34.560 (APC) Variable UPS AC Frequency = None
2019-04-09 16:00:34.560 (APC) Variable UPS Status = OL
2019-04-09 16:00:44.455 (APC) Pushing 'onHeartbeatCallback' on to queue
2019-04-09 16:00:44.479 (APC) Processing 'onHeartbeatCallback' message
2019-04-09 16:00:44.480 (APC) Calling message handler 'onHeartbeat'.

Can anybody explain me where is the problem?
Logread
Posts: 229
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python plugin: UPS Monitor

Post by Logread »

droop7 wrote: Tuesday 09 April 2019 16:07 Hello everybody

I try to word with this script but i'm a little bit blocked.

2019-04-09 15:51:14.549 Error: (APC) 'onStart' failed 'KeyError'.
2019-04-09 15:51:14.549 Error: (APC) ----> Line 199 in /home/pi/domoticz/plugins/NUT_UPS/plugin.py, function onStart
2019-04-09 15:51:14.549 Error: (APC) ----> Line 89 in /home/pi/domoticz/plugins/NUT_UPS/plugin.py, function onStart

Can anybody explain me where is the problem?
Seems the plugin was not able to create the devices.
Try changing the domoticz settings to enable device creation. This should solve your issue
Skwi
Posts: 18
Joined: Thursday 10 May 2018 9:37
Target OS: Windows
Domoticz version:
Contact:

Re: Python plugin: UPS Monitor

Post by Skwi »

Hi, I have an eaton protection station 800 but I don't have all the devices created in domoticz, I'd like to see the power but it stays at None.
Domoticz runs on a synology ds218+

2019-04-20 10:23:38.462 (EATON) Variable UPS Status = OL CHRG
2019-04-20 10:23:38.463 (EATON) Variable UPS Backup Time = 1140
2019-04-20 10:23:38.465 (EATON) Variable UPS AC Frequency = None
2019-04-20 10:23:38.465 (EATON) Variable UPS Charge = 100
2019-04-20 10:23:38.466 (EATON) Variable UPS Power = None
2019-04-20 10:23:38.467 (EATON) Variable UPS AC Input = None
2019-04-20 10:23:38.467 (EATON) Variable UPS Load = 13

Is it normal the state is 'OL CHRG' while the charge is 100? (because offline ups?)

Thanks
Logread
Posts: 229
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python plugin: UPS Monitor

Post by Logread »

Skwi wrote: Saturday 20 April 2019 10:29 Hi, I have an eaton protection station 800 but I don't have all the devices created in domoticz, I'd like to see the power but it stays at None.

Is it normal the state is 'OL CHRG' while the charge is 100? (because offline ups?)

Thanks
It is probable that your UPS NUT implementation does not report power usage. The plugin will not create devices for variables that do not have values (as shown by your debug log).

Regarding the status showing CHRG while battery is 100% charged, this has nothing to do with the plugin as it only reads the NUT variables (and I do not see what’s wrong with it... the charge current might be minimal but not zero).
febalci
Posts: 331
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python plugin: UPS Monitor

Post by febalci »

@logread,

I was using UPS Monitor plugin for some time, i have 1 APC UPS on domoticz ubuntu server, and 1 APC UPS on Synology 916+. It was working nicely for some months. All of a sudden the connection for the Synology UPS started "ACCESS_DENIED" error. Could be since i upgraded Synology firmware, it deleted some settings, who knows. Now i try to telnet port 3493 on Synology, it connects well, but "LIST VAR ups" gives Error: Access Denied. If i enter upsd.users details as as USERNAME monuser and PASSWORD xxxxx on telnet, then i can get LIST VAR ups response. Since you mentioned that we should not use username and password on NUT installation, i still couldn't found out how to use NUT without username and password. Any help?

Thanks...
Logread
Posts: 229
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python plugin: UPS Monitor

Post by Logread »

febalci wrote: Tuesday 07 May 2019 18:44 @logread,

I was using UPS Monitor plugin for some time, i have 1 APC UPS on domoticz ubuntu server, and 1 APC UPS on Synology 916+. It was working nicely for some months. All of a sudden the connection for the Synology UPS started "ACCESS_DENIED" error. Could be since i upgraded Synology firmware, it deleted some settings, who knows. Now i try to telnet port 3493 on Synology, it connects well, but "LIST VAR ups" gives Error: Access Denied. If i enter upsd.users details as as USERNAME monuser and PASSWORD xxxxx on telnet, then i can get LIST VAR ups response. Since you mentioned that we should not use username and password on NUT installation, i still couldn't found out how to use NUT without username and password. Any help?

Thanks...
OOPS... I forgot to update the plugin repository with a version I worked on more than one year ago and that implemented access control: Version 0.2.2 is now available from Github and the wiki page has been updated accordingly !

In case this still does not work, you may also want to check your domoticz system's IP is white-listed in the Synology UPS monitor setup ?
Post Reply