Page 5 of 6

Re: Python plugin: UPS Monitor

Posted: Friday 24 May 2019 13:00
by Logread
Kender wrote: Friday 24 May 2019 11:15 I can't update :shock:
git command give me: error: "cannot open .git/FETCH_HEAD: Permission denied"
You may want to delete the plugin folder and reinstall from scratch ?

Re: Python plugin: UPS Monitor

Posted: Friday 24 May 2019 13:43
by Kender
I solved downlading only the plugin.py from the web page of Git.
I can tell you that the versione 2.3 work prefectly !!
Thank you very much ! :) :)

Re: Python plugin: UPS Monitor

Posted: Wednesday 19 June 2019 0:36
by Dim33
Hello,

I use version 0.2.3 of UPS monitor plugin with Domoticz 4.9701.
My UPS server is on NAS DS214+ DSM 6.2.2-24922.

Without user/mdp, I read in domoticz logs : "Error: (Onduleur) Error reading UPS variables: ERR ACCESS-DENIED"
With user/mdp (monuser/secret or xxxxx), I read in domoticz logs "Error: (Onduleur) Authentication error: ('ERR ACCESS-DENIED')"

An idea ? I don't see the problem.

Re: Python plugin: UPS Monitor

Posted: Wednesday 19 June 2019 7:39
by Logread
Dim33 wrote: Wednesday 19 June 2019 0:36 Hello,

I use version 0.2.3 of UPS monitor plugin with Domoticz 4.9701.
My UPS server is on NAS DS214+ DSM 6.2.2-24922.

Without user/mdp, I read in domoticz logs : "Error: (Onduleur) Error reading UPS variables: ERR ACCESS-DENIED"
With user/mdp (monuser/secret or xxxxx), I read in domoticz logs "Error: (Onduleur) Authentication error: ('ERR ACCESS-DENIED')"

An idea ? I don't see the problem.
Did you add the IP address of the domoticz host to the whitelist in DSM (UPS tab in config) ?

Re: Python plugin: UPS Monitor

Posted: Wednesday 19 June 2019 8:02
by Dim33
Logread wrote: Wednesday 19 June 2019 7:39
Dim33 wrote: Wednesday 19 June 2019 0:36 Hello,

I use version 0.2.3 of UPS monitor plugin with Domoticz 4.9701.
My UPS server is on NAS DS214+ DSM 6.2.2-24922.

Without user/mdp, I read in domoticz logs : "Error: (Onduleur) Error reading UPS variables: ERR ACCESS-DENIED"
With user/mdp (monuser/secret or xxxxx), I read in domoticz logs "Error: (Onduleur) Authentication error: ('ERR ACCESS-DENIED')"

An idea ? I don't see the problem.
Did you add the IP address of the domoticz host to the whitelist in DSM (UPS tab in config) ?
Yes

Re: Python plugin: UPS Monitor

Posted: Wednesday 19 June 2019 17:24
by Logread
@Dim33,

I cannot replicate the error you are seeing (I am running same version of DSM than yours, version 0.2.3 of the plugin and domoticz 4.10717 - the latest stable - on a Raspberry Pi). You may want to test using CLI NUT tools (upsc client if you are on linux) and see if you can connect ?

Re: Python plugin: UPS Monitor

Posted: Saturday 22 June 2019 23:41
by Dim33
Thanks Logread.

NUT Client is installed on my NUC (with Domoticz) and can't connect to UPS server.

Output of sudo upsc [email protected]

Code: Select all

Init SSL without certificate database
Error: Access denied
WinNUT is also installed on my PC and no problem !

:shock: :shock: :shock: :shock:

Re: Python plugin: UPS Monitor

Posted: Tuesday 15 September 2020 15:26
by blackie
Hi,
I consider to use this plugin, I have a local NUT installation on RPi->USB->APC UPS.
In my home the UPS comes onbattery maybe 2xday for 1-2s - short outages.
Can I use this plugin to get long-term statistics of such short outages or the plugin just reads the actual NUT data every 60s?
If not, I would like to use the local NUT server script triggered when outage occurres to update the UPS sensors. Can this be done somehow with the plugin sensors?

Re: Python plugin: UPS Monitor

Posted: Sunday 15 November 2020 21:31
by xavbzh
Hello,

I try to use this plugin, but I don't manage.
Fresh installation of pi 3, latest raspios :
root@raspberrypi:/# cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
Latest domoticz stable release :
Version: 2020.2
Build Hash: b63341bc0
Compile Date: 2020-04-26 13:47:55
dzVents Version: 3.0.2
Python Version: 3.7.3 (default, Jul 25 2020, 13:03:44) [GCC 8.3.0]
The plugin is in the plugin directory, I restart domoticz, everything is OK. I add the hardware, UPS Monitor type, correct credentials, then the user interface crash. When I check the service :
root@raspberrypi:/usr/domoticz/plugins/NUT_UPS# /etc/init.d/domoticz.sh status
● domoticz.service - LSB: Home Automation System
Loaded: loaded (/etc/init.d/domoticz.sh; generated)
Active: active (exited) since Sun 2020-11-15 20:56:53 CET; 6s ago
Docs: man:systemd-sysv-generator(8)
Process: 25177 ExecStart=/etc/init.d/domoticz.sh start (code=exited, status=0/SUCCESS)

nov. 15 20:56:53 raspberrypi systemd[1]: Starting LSB: Home Automation System...
nov. 15 20:56:53 raspberrypi domoticz.sh[25177]: 2020-11-15 20:56:53.754 Status: Domoticz V2020.2 (c)2012-20…izMoCuz
nov. 15 20:56:53 raspberrypi domoticz.sh[25177]: 2020-11-15 20:56:53.754 Status: Build Hash: b63341bc0, Date…3:47:55
nov. 15 20:56:53 raspberrypi domoticz.sh[25177]: 2020-11-15 20:56:53.754 Status: Startup Path: /usr/domoticz/
nov. 15 20:56:53 raspberrypi domoticz.sh[25177]: domoticz: Domoticz is starting up....
nov. 15 20:56:53 raspberrypi domoticz[25183]: Domoticz is starting up....
nov. 15 20:56:53 raspberrypi domoticz[25184]: Domoticz running...
nov. 15 20:56:53 raspberrypi systemd[1]: Started LSB: Home Automation System.
Hint: Some lines were ellipsized, use -l to show in full.
I delete the NUT plugin directory then restart domoticz, it's OK. In the log :
2020-11-15 20:57:38.198 Error: (NUT_UPS) failed to load 'plugin.py', Python Path used was ':/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2020-11-15 20:57:38.198 Error: (onduleur) Module Import failed, exception: 'ModuleNotFoundError'
2020-11-15 20:57:38.198 Error: (onduleur) Module Import failed: ' Name: plugin'
2020-11-15 20:57:38.198 Error: (onduleur) Error Line details not available.
After an alternative python3.4 install, I tried to modify this path adding in the plugin.py :
import sys
sys.path.append('/usr/lib/python3.4')
No success... same error in log.

If anyone could help...

Re: Python plugin: UPS Monitor

Posted: Tuesday 24 November 2020 8:45
by Logread
@xavbzh,

Did you try other python plugins ? This looks to me as a python issue rather than a plugin issue... some search might help you as I think there are many posts on similar issues on the forum

Re: Python plugin: UPS Monitor

Posted: Wednesday 23 December 2020 16:59
by ikkezelf
I had to install the python-dev for the hardware tot popup in the pull-down list.
I'm using a APC-UPS

it's working fine now, If I want to show more variables, I just have to edit the .py script ?

Re: Python plugin: UPS Monitor

Posted: Wednesday 23 December 2020 18:43
by ikkezelf
expanding the plugin script succeeded.
However I have installed all on my slave pi. Now as I want to make the devices visible on the master pi, they don't seem to be adde as new devices on the master.
Any idea why these are not recognised as devices from the slave? (and yes I included them as available for the logged in user).

Re: Python plugin: UPS Monitor

Posted: Wednesday 23 December 2020 19:21
by Antori91
ikkezelf wrote: Wednesday 23 December 2020 18:43 Any idea why these are not recognised as devices from the slave? (and yes I included them as available for the logged in user).
Hi,
It's a known issue. Domoticz feature for synchronization (Domoticz remote server) doesn't work for devices created and updated by a plugin. As you, I've installed this plugin on my backup server. To synchronize my main server, I use my own replication system (see viewtopic.php?f=38&t=24088)

Re: Python plugin: UPS Monitor

Posted: Monday 10 May 2021 13:04
by ilex
Hi to All,

I succefully use UPS Monitor Plugin but there is one thing I would like to change which is the UPS runtime information from seconds to minutes.

Can anyone give ma a hint what to change in plugin.py file ?

BR.

Re: Python plugin: UPS Monitor

Posted: Monday 10 May 2021 13:39
by FireWizard
Hi, @ilex

You can change line 49, in plugin.py
(self.pollinterval = 60 #Time in seconds between two polls)
Currently the pollinterval = 60 seconds.
You can change that to another value, but it has to be in seconds.

Regards

Re: Python plugin: UPS Monitor

Posted: Monday 10 May 2021 13:48
by ilex
I am not sure if I have made myself clear.

I want in Domoticz the UPS runtime to be displayed in minutes (not in seconds as it is now) :)

Re: Python plugin: UPS Monitor

Posted: Tuesday 26 October 2021 11:23
by blackie
Hello,
I have installed this plugin to my RPi with Domoticz and local NUT installation.
In my home the UPS comes onbattery cca 2x per day for 1-2 seconds.
Seems the plugin is unable to detect these short power outages because plugin reads the actual UPS data every 60s.
I have an idea to use local NUT server script /usr/bin/upssched-cmd triggered after power status change to catch these short outages.
Can this python plugin be called somehow from upssched-cmd script to update Domoticz UPS sensors every time UPS status changes?

If i try to execute plugin manually from a shell i get an error:
root@OMV:/home/domoticz/plugins/NUT_UPS# python3 plugin.py
Traceback (most recent call last):
File "plugin.py", line 36, in <module>
import Domoticz
ModuleNotFoundError: No module named 'Domoticz'

Thanks in advance for help

Re: Python plugin: UPS Monitor

Posted: Monday 01 November 2021 12:18
by Kyrille
Hello,

The plugin is working fine in my environment but I can't succeed in creating a notification for the Status.

When I set a condition for the value "ONBATTERY DISCHARGING" in order for Pushover to warn me about a power shutdown, nothing happen.

I noticed that when I come back to the corresponding notification, the field for Value is empty. It seems that my chain of characters was not accepted when creating it. I tried to put the text between " " but same (no) effect.

Any clue ?

Thank you in advance.Image

Envoyé de mon Pixel 4a en utilisant Tapatalk


Re: Python plugin: UPS Monitor

Posted: Monday 01 November 2021 19:37
by nico21311
Hello

I have installed a fresh installation of Domoticz on the news debian bulleyes with python 3.9.2.

Domoticz works well. However when I installed the plugin NUT UPS or UPS monitor, Domoticz do not start.

According my investigation, the issue come form new python 3.9.2 and the script.

I am not enough skill to solved the issue.

I really appreciate if someone could help me.

Thanks in advance for your support

Re: Python plugin: UPS Monitor

Posted: Wednesday 13 July 2022 15:44
by PieterS
For a while (maybe since running Domoticz in Docker??) I am not able to monitor my APC UPS which is connected by USB to my Synology. The error in the logfile: Error reading UPS variables: ERR ACCESS-DENIED
This is the (filtered) logfile:
Spoiler: show
2022-07-13 14:52:20.500 APC UPS: Worker thread started.
2022-07-13 14:52:20.611 APC UPS: Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE ALL
2022-07-13 14:52:20.611 APC UPS: 'HardwareID':'39'
2022-07-13 14:52:20.611 APC UPS: 'HomeFolder':'/opt/domoticz/userdata/plugins/NUT_UPS/'
2022-07-13 14:52:20.611 APC UPS: 'StartupFolder':'/opt/domoticz/'
2022-07-13 14:52:20.611 APC UPS: 'UserDataFolder':'/opt/domoticz/userdata/'
2022-07-13 14:52:20.611 APC UPS: 'Database':'/opt/domoticz/userdata/domoticz.db'
2022-07-13 14:52:20.611 APC UPS: 'Language':'nl'
2022-07-13 14:52:20.611 APC UPS: 'Version':'0.2.1'
2022-07-13 14:52:20.611 APC UPS: 'Author':'logread'
2022-07-13 14:52:20.611 APC UPS: 'Name':'APC UPS'
2022-07-13 14:52:20.611 APC UPS: 'Address':'192.168.1.18'
2022-07-13 14:52:20.611 APC UPS: 'Port':'3493'
2022-07-13 14:52:20.611 APC UPS: 'Key':'NUT_UPS'
2022-07-13 14:52:20.611 APC UPS: 'Mode1':'ups'
2022-07-13 14:52:20.611 APC UPS: 'Mode6':'Debug'
2022-07-13 14:52:20.611 APC UPS: 'DomoticzVersion':'2022.1 (build 14369)'
2022-07-13 14:52:20.611 APC UPS: 'DomoticzHash':'00c5d7861'
2022-07-13 14:52:20.611 APC UPS: 'DomoticzBuildTime':'2022-06-27 10:39:10'
2022-07-13 14:52:20.611 APC UPS: Device count: 5
2022-07-13 14:52:20.611 APC UPS: Device: 1 - ID: 961, Name: 'APC UPS - UPS Status Mode', nValue: 0, sValue: 'COMMUNICATION ERROR'
2022-07-13 14:52:20.611 APC UPS: Device ID: '961'
2022-07-13 14:52:20.611 APC UPS: Device Name: 'APC UPS - UPS Status Mode'
2022-07-13 14:52:20.611 APC UPS: Device nValue: 0
2022-07-13 14:52:20.611 APC UPS: Device sValue: 'COMMUNICATION ERROR'
2022-07-13 14:52:20.611 APC UPS: Device LastLevel: 0
2022-07-13 14:52:20.612 APC UPS: Device: 2 - ID: 867, Name: 'APC UPS - UPS Charge', nValue: 0, sValue: '100'
2022-07-13 14:52:20.612 APC UPS: Device ID: '867'
2022-07-13 14:52:20.612 APC UPS: Device Name: 'APC UPS - UPS Charge'
2022-07-13 14:52:20.612 APC UPS: Device nValue: 0
2022-07-13 14:52:20.612 APC UPS: Device sValue: '100'
2022-07-13 14:52:20.612 APC UPS: Device LastLevel: 0
2022-07-13 14:52:20.612 APC UPS: Device: 3 - ID: 868, Name: 'APC UPS - UPS Backup Time', nValue: 0, sValue: '2670'
2022-07-13 14:52:20.612 APC UPS: Device ID: '868'
2022-07-13 14:52:20.612 APC UPS: Device Name: 'APC UPS - UPS Backup Time'
2022-07-13 14:52:20.612 APC UPS: Device nValue: 0
2022-07-13 14:52:20.612 APC UPS: Device sValue: '2670'
2022-07-13 14:52:20.612 APC UPS: Device LastLevel: 0
2022-07-13 14:52:20.612 APC UPS: Device: 4 - ID: 866, Name: 'APC UPS - UPS AC Input', nValue: 0, sValue: '226.0'
2022-07-13 14:52:20.612 APC UPS: Device ID: '866'
2022-07-13 14:52:20.612 APC UPS: Device Name: 'APC UPS - UPS AC Input'
2022-07-13 14:52:20.612 APC UPS: Device nValue: 0
2022-07-13 14:52:20.612 APC UPS: Device sValue: '226.0'
2022-07-13 14:52:20.612 APC UPS: Device LastLevel: 0
2022-07-13 14:52:20.612 APC UPS: Device: 5 - ID: 865, Name: 'APC UPS - UPS Load', nValue: 0, sValue: '21'
2022-07-13 14:52:20.612 APC UPS: Device ID: '865'
2022-07-13 14:52:20.612 APC UPS: Device Name: 'APC UPS - UPS Load'
2022-07-13 14:52:20.612 APC UPS: Device nValue: 0
2022-07-13 14:52:20.612 APC UPS: Device sValue: '21'
2022-07-13 14:52:20.612 APC UPS: Device LastLevel: 0
2022-07-13 14:52:20.612 APC UPS: Acquiring GIL for 'onStartCallback'
2022-07-13 14:52:20.501 Status: APC UPS: Started.
2022-07-13 14:52:20.500 Status: APC UPS: Entering work loop.
2022-07-13 14:52:20.607 Status: APC UPS: Initialized version 0.2.1, author 'logread'
2022-07-13 14:52:30.034 APC UPS: Pushing 'onHeartbeatCallback' on to queue
2022-07-13 14:52:30.084 APC UPS: Processing 'onHeartbeatCallback' message
2022-07-13 14:52:30.085 APC UPS: Acquiring GIL for 'onHeartbeatCallback'
2022-07-13 14:52:30.085 APC UPS: Calling message handler 'onHeartbeat' on 'module' type object.
2022-07-13 14:52:30.100 APC UPS: Variable UPS Status = 0
2022-07-13 14:52:30.100 APC UPS: Variable UPS Charge = None
2022-07-13 14:52:30.100 APC UPS: Variable UPS Backup Time = None
2022-07-13 14:52:30.100 APC UPS: Variable UPS AC Input = None
2022-07-13 14:52:30.100 APC UPS: Variable UPS Load = None
2022-07-13 14:52:30.100 APC UPS: Variable UPS Power = None
2022-07-13 14:52:30.100 APC UPS: Variable UPS AC Frequency = None
2022-07-13 14:52:30.100 APC UPS: Acquiring GIL for 'onHeartbeatCallback'
2022-07-13 14:52:30.100 Error: APC UPS: Error reading UPS variables: ERR ACCESS-DENIED
2022-07-13 14:52:40.013 APC UPS: Pushing 'onHeartbeatCallback' on to queue
2022-07-13 14:52:40.090 APC UPS: Processing 'onHeartbeatCallback' message
2022-07-13 14:52:40.090 APC UPS: Acquiring GIL for 'onHeartbeatCallback'
2022-07-13 14:52:40.090 APC UPS: Calling message handler 'onHeartbeat' on 'module' type object.
2022-07-13 14:52:40.090 APC UPS: Acquiring GIL for 'onHeartbeatCallback'
The services for UPS are up and running on my Synology and use port 3493...
In Docker I have installed the plugin as described in https://www.domoticz.com/wiki/Plugins/NUT_UPS.html
In the configuration of the container of Domoticz (V14369) I have a problem I cannot solve:

When I fill in port 3493 for the host I get an error because that port is in use by the host...

Image

This is a part of the portsettings of the container of Domoticz in Docker:

Image

So how to configure the software of Docker that port 3493 (which is used by the host) can talk to the plugin in Domoticz??