Python plugin: UPS Monitor

Python and python framework

Moderator: leecollings

manuloup
Posts: 51
Joined: Sunday 23 November 2014 16:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python plugin: UPS monitoring

Post by manuloup »

I tried the new version of file plugin.py but I don't see anything in the log file if I check for UPS.

Not sure it is working though.
Rapberry PI B+ (RaspBian), RFXtrx433E USB 433.92MHz Transceiver, AEON LABS Controler Z-Wave, Aeon Labs Z-Stick S2, Everspring ST814 Temperature Sensor, Everspring SF812 Smoke Detector, 2x Fibaro Wallplug, Aeon Zwave Miniremote , Xbee Teleinfo USB
manuloup
Posts: 51
Joined: Sunday 23 November 2014 16:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python plugin: UPS monitoring

Post by manuloup »

Devices look up to date, so I guess this is good.

Thanks for your help, madpatrick.
UPS devices.jpg
UPS devices.jpg (146.26 KiB) Viewed 3741 times
Rapberry PI B+ (RaspBian), RFXtrx433E USB 433.92MHz Transceiver, AEON LABS Controler Z-Wave, Aeon Labs Z-Stick S2, Everspring ST814 Temperature Sensor, Everspring SF812 Smoke Detector, 2x Fibaro Wallplug, Aeon Zwave Miniremote , Xbee Teleinfo USB
eddieb
Posts: 430
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Python plugin: UPS monitoring

Post by eddieb »

I noticed this error on my rpi running under docker...

Code: Select all

2026-06-02 10:31:43.121  Error: UPS Meterkast: (NUT_UPS) failed to load 'plugin.py'.
2026-06-02 10:31:43.258  Error: UPS Meterkast: Traceback (most recent call last):
2026-06-02 10:31:43.258  Error: UPS Meterkast:   File "/opt/domoticz/userdata/plugins/NUT_UPS/plugin.py", line 37, in <module>
2026-06-02 10:31:43.258  Error: UPS Meterkast:     import telnetlib
2026-06-02 10:31:43.258  Error: UPS Meterkast: ModuleNotFoundError: No module named 'telnetlib'
this did work for a couple of months, is there some recent change that removed telnetlib ?

suggestions how to fix ?
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC MQTTmapper / SolarEdge SE3500H modbus_tcp / IndeVolt SF3000 / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
User avatar
waltervl
Posts: 7019
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: Python plugin: UPS monitoring

Post by waltervl »

eddieb wrote: Tuesday 02 June 2026 11:19 I noticed this error on my rpi running under docker...

Code: Select all

2026-06-02 10:31:43.121  Error: UPS Meterkast: (NUT_UPS) failed to load 'plugin.py'.
2026-06-02 10:31:43.258  Error: UPS Meterkast: Traceback (most recent call last):
2026-06-02 10:31:43.258  Error: UPS Meterkast:   File "/opt/domoticz/userdata/plugins/NUT_UPS/plugin.py", line 37, in <module>
2026-06-02 10:31:43.258  Error: UPS Meterkast:     import telnetlib
2026-06-02 10:31:43.258  Error: UPS Meterkast: ModuleNotFoundError: No module named 'telnetlib'
this did work for a couple of months, is there some recent change that removed telnetlib ?

suggestions how to fix ?
For docker and installations of Python modules see https://wiki.domoticz.com/Docker#Python_Plugins

Also docker image has moved to Python 13 so perhaps the module is not compliant.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
madpatrick
Posts: 885
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2026.1
Location: Netherlands
Contact:

Re: Python plugin: UPS monitoring

Post by madpatrick »

See a few post earlier

Replace: import telnetlib

viewtopic.php?p=332146#p332146
-= HP server GEN11 =- ZwaveJS-=- Domoticz v2026.2 -=- Dashticz =-
-= Checkout https://github.com/MadPatrick for the plugins =-
eddieb
Posts: 430
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Python plugin: UPS monitoring

Post by eddieb »

I used your adjusted plugin.py and now it works.
Are you pushing that changes to the plugin developer ?
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC MQTTmapper / SolarEdge SE3500H modbus_tcp / IndeVolt SF3000 / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
User avatar
waltervl
Posts: 7019
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: Python plugin: UPS Monitor

Post by waltervl »

I merged the UPS Monitor sub discussion with the original discussion. Probably something went wrong while creating the question.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
rini52
Posts: 47
Joined: Friday 10 June 2022 23:19
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: NL
Contact:

Re: Python plugin: UPS Monitor

Post by rini52 »

Guys many thanks.
I got nut running on trixi with domoticz in docker. I can confirm that updating the plugin.py with the pluging.py.txt and in stalling telnetlib3 works. Just changing the original plugin.py with "import telnetlib3 as telnetlib" didn't work. Also make sure that you have the config files set with root:nut credetials.
Gr.
Domoticz running on Pi-4, Ubuntu(amd64), Synology Nas and VM
Hardware: RFXCOM, RFLINK, P1-smartmeter-HomeWizard, Z2M Sonoff dongle(20+ devices), Esp8266 (counters), Eaton_3S ups
Post Reply