Python plugin: UPS Monitor
Moderator: leecollings
-
- Posts: 12
- Joined: Wednesday 09 January 2019 23:32
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: UPS Monitor
Hi,
Thank you for this plugin.
It works perfectly.
But i have a problem with blocky.
What is the parameters i have to use for Status mode in a condition ?
I try "OL", "OB", "ONBATTERY DISCHARGING", panic, alarm...
Nothing works
Thank you for this plugin.
It works perfectly.
But i have a problem with blocky.
What is the parameters i have to use for Status mode in a condition ?
I try "OL", "OB", "ONBATTERY DISCHARGING", panic, alarm...
Nothing works
- Attachments
-
- Capture.PNG (52.25 KiB) Viewed 1362 times
- madpatrick
- Posts: 662
- Joined: Monday 26 December 2016 12:17
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Python plugin: UPS Monitor
On my APC UPS the status is "ONLINE"
-= HP server GEN11 =- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.14b on Tab8" =-
-
- Posts: 12
- Joined: Wednesday 09 January 2019 23:32
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: UPS Monitor
I d'ont understand why it doesn't work.
I try with everything in my blocky :
I try with everything in my blocky :
- ONLINE CHARGING
- ONLINE
- OL
- 0
- 1
- 2
- 3
- 4...
- ON
- OFF
- OPEN
- CLOSE
- ALARM
- PANIC...
- Attachments
-
- Capture1.PNG (21.36 KiB) Viewed 1335 times
-
- Capture2.PNG (7.43 KiB) Viewed 1335 times
- madpatrick
- Posts: 662
- Joined: Monday 26 December 2016 12:17
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Python plugin: UPS Monitor
It appears that a text input is not working in Blocky
See also:
viewtopic.php?f=62&t=28388&p=217446&hil ... ly#p217438
You can better use a Dzvents script.
I've tried a simplte test script and this is working
I think for your example it looks like this
You need to change the ID number of your devices (290 and 300) in this script
See also:
viewtopic.php?f=62&t=28388&p=217446&hil ... ly#p217438
You can better use a Dzvents script.
I've tried a simplte test script and this is working
Code: Select all
local scriptVar = '-=# TEST #=-'
local testswitch = 290
return
{
on = {
devices = {testswitch,},
},
logging = {
level = domoticz.LOG_ERROR,
marker = scriptVar,
},
execute = function(dz, item)
local UPS_status = dz.devices(560)
if UPS_status.text == 'ONLINE' then
dz.log('APS UPS is : ' ..UPS_status.text, dz.LOG_FORCE)
end
end
}
I think for your example it looks like this
You need to change the ID number of your devices (290 and 300) in this script
Code: Select all
local scriptVar = '-=# TEST #=-'
local UPS_status = 290 -- fill in your device ID of the EATON
local Light = 300 -- fill in your device ID of the Le Bureau
return
{
on = {
devices = {UPS_status,},
},
logging = {
level = domoticz.LOG_ERROR,
marker = scriptVar,
},
execute = function(dz, item)
local UPS_status = dz.devices(UPS_status)
local Light = dz.devices(Light)
if UPS_status.text == 'ONLINE CHARGING' or UPS_status.text == 'ONBATTERY DISCHARGING' then
Light.switchOn().checkFirst()
dz.log('APS UPS is : ' ..UPS_status.text, dz.LOG_FORCE)
end
end
}
-= HP server GEN11 =- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.14b on Tab8" =-
-
- Posts: 95
- Joined: Wednesday 30 October 2019 14:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Great Britain
- Contact:
Re: Python plugin: UPS Monitor
Notifications
Well I've only just bought a UPS (Tecnoware) and installed this plugin so let's start by saying a big thanks to the author!
But, as others have reported here, I could not get notifications to work when power was lost/restored with the "NUT - UPS Status Mode" changing between ONLINE and ONBATTERY.
One of the recent comments mentioned using blockly so I started out by looking in there and I noticed (when you look at the current values of devices) that there is a column for the "State" and another for the "Value" for each device.
For my UPS the status mode shows the following:
State as "ONLINE" and Value as "1/ONLINE" when there is AC power (top line below):
or
State as "ONBATTERY" and Value as "4/ONBATTERY" when running on battery: So, under the Domoticz "Utility" tab I went into the Notifications for the "UPS Status Mode" and tried using the numeric "Value" instead of the text status. I powered off my UPS and a minute or so later I powered it back on and both times I received a notification (Pushbullet and Telegram in my case). See screenshot and note below: Important - Make sure you change the "Ignore Interval" to on (green) so that the status change will always send out a notification. (I forgot to show this in the above screenshot)
For testing purposes I lowered the polling interval by editing the plugin.py to 20 seconds but will now increase it back to 1 minute.
Just need to decide now whether to set this to ring the (battery) doorbell when power is lost and risk waking the household at night!
Hope this helps people like me who were struggling with notifications.
Well I've only just bought a UPS (Tecnoware) and installed this plugin so let's start by saying a big thanks to the author!
But, as others have reported here, I could not get notifications to work when power was lost/restored with the "NUT - UPS Status Mode" changing between ONLINE and ONBATTERY.
One of the recent comments mentioned using blockly so I started out by looking in there and I noticed (when you look at the current values of devices) that there is a column for the "State" and another for the "Value" for each device.
For my UPS the status mode shows the following:
State as "ONLINE" and Value as "1/ONLINE" when there is AC power (top line below):
or
State as "ONBATTERY" and Value as "4/ONBATTERY" when running on battery: So, under the Domoticz "Utility" tab I went into the Notifications for the "UPS Status Mode" and tried using the numeric "Value" instead of the text status. I powered off my UPS and a minute or so later I powered it back on and both times I received a notification (Pushbullet and Telegram in my case). See screenshot and note below: Important - Make sure you change the "Ignore Interval" to on (green) so that the status change will always send out a notification. (I forgot to show this in the above screenshot)
For testing purposes I lowered the polling interval by editing the plugin.py to 20 seconds but will now increase it back to 1 minute.
Just need to decide now whether to set this to ring the (battery) doorbell when power is lost and risk waking the household at night!
Hope this helps people like me who were struggling with notifications.
Running Domoticz and Dashticz beta on Raspberry Pi OS 32 bit - has anyone had success with 64 bit?
Desktop access from Ubuntu Linux
Desktop access from Ubuntu Linux
-
- Posts: 6
- Joined: Saturday 10 December 2022 23:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: UPS Monitor
Sorry for the question, where can I see that?tarmacalastair wrote: ↑Thursday 01 December 2022 12:54 Notifications
Well I've only just bought a UPS (Tecnoware) and installed this plugin so let's start by saying a big thanks to the author!
But, as others have reported here, I could not get notifications to work when power was lost/restored with the "NUT - UPS Status Mode" changing between ONLINE and ONBATTERY.
One of the recent comments mentioned using blockly so I started out by looking in there and I noticed (when you look at the current values of devices) that there is a column for the "State" and another for the "Value" for each device.
For my UPS the status mode shows the following:
State as "ONLINE" and Value as "1/ONLINE" when there is AC power (top line below):
Screenshot 2022-12-01 at 11-32-19 Domoticz.png
or
State as "ONBATTERY" and Value as "4/ONBATTERY" when running on battery:
Screenshot 2022-12-01 at 11-39-47 Domoticz.png
So, under the Domoticz "Utility" tab I went into the Notifications for the "UPS Status Mode" and tried using the numeric "Value" instead of the text status. I powered off my UPS and a minute or so later I powered it back on and both times I received a notification (Pushbullet and Telegram in my case). See screenshot and note below:
Screenshot 2022-12-01 at 11-41-32 Domoticz.png
Important - Make sure you change the "Ignore Interval" to on (green) so that the status change will always send out a notification. (I forgot to show this in the above screenshot)
For testing purposes I lowered the polling interval by editing the plugin.py to 20 seconds but will now increase it back to 1 minute.
Just need to decide now whether to set this to ring the (battery) doorbell when power is lost and risk waking the household at night!
Hope this helps people like me who were struggling with notifications.
- Attachments
-
- Screenshot 2022-12-01 at 11-32-19 Domoticz.png (36.54 KiB) Viewed 1227 times
-
- Posts: 95
- Joined: Wednesday 30 October 2019 14:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Great Britain
- Contact:
Re: Python plugin: UPS Monitor
You get to it by clicking on Setup, More Options, Events. This takes you to the automation scripts page where you can see device statuses.
You can also get there with http or https://ipaddress:8080/#/Events (substitute your IP address and change the port if you don't use 8080).
Good luck. I found the device statuses by accident. I'd seen them before but completely forgotten.
You can also get there with http or https://ipaddress:8080/#/Events (substitute your IP address and change the port if you don't use 8080).
Good luck. I found the device statuses by accident. I'd seen them before but completely forgotten.
Running Domoticz and Dashticz beta on Raspberry Pi OS 32 bit - has anyone had success with 64 bit?
Desktop access from Ubuntu Linux
Desktop access from Ubuntu Linux
-
- Posts: 6
- Joined: Saturday 10 December 2022 23:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: UPS Monitor
tarmacalastair wrote: ↑Sunday 11 December 2022 0:37 You get to it by clicking on Setup, More Options, Events. This takes you to the automation scripts page where you can see device statuses.
You can also get there with http or https://ipaddress:8080/#/Events (substitute your IP address and change the port if you don't use 8080).
Good luck. I found the device statuses by accident. I'd seen them before but completely forgotten.
oh i see, thanxs

-
- Posts: 112
- Joined: Thursday 08 December 2022 22:15
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2023.2
- Location: ROMANIA
- Contact:
Re: Python plugin: UPS Monitor
Hi,
so, this plugin is working whit any UPS ?
i see that the plugin is for EATON, but another forum member use this for a UPS Tecnoware.
can i use any USB cable to monitor the UPS ?
thx
so, this plugin is working whit any UPS ?
i see that the plugin is for EATON, but another forum member use this for a UPS Tecnoware.
can i use any USB cable to monitor the UPS ?
thx
- Attachments
-
- AJ7W_1_201910101336456077.jpg (54.76 KiB) Viewed 1157 times
-
- Posts: 2
- Joined: Thursday 27 February 2025 0:45
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: UPS Monitor
The plugin works well using simple notifications sent out on Pushover, however I'm trying to write a Blocky script to report the UPS Backup Time whenever the UPS status mode is offline. When constructing an if statement, only the Backup Time device shows up when clicking Devices>Utility and not Status Mode. Both these devices as well as the UPS Charge device show up when I click the current states icon. Is this a bug or am I doing something wrong? I am using Domoticz 2024/7 on a Raspberry Pi 4B. The UPS is a Cyberpower 1500AVR.
- waltervl
- Posts: 5738
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Python plugin: UPS Monitor
That UPS status device is probably a selector switch and can be found under light/switches.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 2
- Joined: Thursday 27 February 2025 0:45
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: UPS Monitor
Thanks for the quick reply. Nothing was found under switches but ironically it was under Zwave Alarms even though it is not a Zwave device. Sorry for the tunnel vision.
Who is online
Users browsing this forum: No registered users and 1 guest