Re: [Apcupsd-users] APCUPSD: Windows Task Scheduler Stop on Switch to Battery Power
Brought to you by:
adk0212
|
From: Glenn F. <gfo...@ou...> - 2022-06-30 13:22:16
|
Hi Pete, You can react to running on batteries in the batch file onbattery.bat located in C:\apcupsd\etc\apcupsd In that folder you'll also see the config, offbattery.bat , etc. On Thu, Jun 30, 2022 at 6:21 AM Pete Berry <Pet...@gr...> wrote: > Hello - I am new to APC UPS and APCUPSD! > > I have an APC BR1500GI (Backup Pro) device, connected via USB to a PC > running Windows 10 x64. All configured, tested and working fine. I also > have slave W10x64 devices powered from the same UPS and talking correctly > to the Master APCUPSD. So everything working fine! > > The issue I need help with is getting the Windows Task Scheduler to react > to 'running on batteries' with the apcusbd battery device driver. > > The PCs are running CPU intensive tasks triggered by the Windows Task > Scheduler. Each task monitors a directory and processes a workload when a > new file is detected - they fire repeatedly looking for work. If the UPS > switches to battery, I want all running tasks to end immediately until > mains power returns. > > The task power options are correctly set on the tasks - 'Start the task > only if the computer is on AC power' and 'Stop if the computer switches to > battery power'. > > If I plug in the APC UPS and let the standard Windows drivers load, the > Task Scheduler behaves as expected. > > When I install APCUPSD and the battery driver is replaced with the > "American Power Conversion USB UPS (Apcupsd)" driver (v1.0.0.1 Jemej > Simoncic 19 Jan 2015), Windows Task Scheduler no longer detects this switch > to battery power. > > Everything is working as expected with APCUPSD - the APC tray icon > changes, the correct events are detected etc. It seems that this driver > does not fully emulate the 'battery' role to the OS - or have I missed a > configuration option? > > I could develop a workaround using scripts triggered via apccontrol, but > this would required something like powershell to 'end' and 'disable' named > tasks and to reenable them. > > From my internet search, I have not found a method to signal 'on battery' > to the Windows OS - this seems to have to come from ACPI/BIOS? As such > there does not seem to be a way to manually set the power mode from a > script. > > Is there a configuration option I have missed, or a more obvious solution? > Or is this an enhancement? > > APCUPSD does exactly what I want from a Master/Slave and Device Management > perspective - Thank You to the developers - and documentation writers! > > Your guidance appreciated > Pete > _______________________________________________ > Apcupsd-users mailing list > Apc...@li... > https://lists.sourceforge.net/lists/listinfo/apcupsd-users > |