Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Join our "Ask Me About" community webinar on May 20th at 9 AM CET and 5 PM CET to explore cybersecurity and monitoring for Data Center and edge IT. Learn about market trends, cutting-edge technologies, and best practices from industry experts.
Register and secure your Critical IT infrastructure

WM_POWERBROADCAST

APC UPS for Home and Office Forum

Support forum to share knowledge about installation and configuration of APC offers including Home Office UPS, Surge Protectors, UTS, software and services.

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • APC UPS, Critical Power, Cooling and Racks
  • APC UPS for Home and Office Forum
  • WM_POWERBROADCAST
Options
  • Subscribe to RSS Feed
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
BillP
Administrator BillP Administrator
2151
Teken
Spock Teken
99
voidstar_apc
Janeway voidstar_apc
83
View All

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Solved Go to Solution
Back to APC UPS for Home and Office Forum
Solved
Anonymous user
Not applicable

Posted: ‎2021-06-29 11:06 PM . Last Modified: ‎2024-03-20 12:54 AM

0 Likes
2
1100
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2021-06-29 11:06 PM . Last Modified: ‎2024-03-20 12:54 AM

WM_POWERBROADCAST

Hi,

I have both a BK350EI and a BE700G-GK.

Windows 7 x64.

I'm trying to make a VC2008 c++ program detect when the UPS is on battery power.

Is there a way to detect "power off line" status via the existing windows APIs for this purpose. If not - Why not?

Is the only benefit of this device some low sounding beeps that goes of 10 minutes before the power is cut?

i.e a delay of the power cut, but if no one hears the alarm no one hears the beeps there are no benefits at all?

There must be a way to write a program that can detect the power problem - I want to do that using WIN32 and c++...

Have tried two different approaches:

1. fails to detect anything when the UPS plug is removed from the wall.

SYSTEM_POWER_STATUS stPS;

GetSystemPowerStatus(&stPS);

- same info returned both when on battery and when on line power.

2. fails to detect anything when the UPS plug is removed from the wall.

WM_POWERBROADCAST via

hPowerSourceNotify = RegisterPowerSettingNotification( hWnd, &GUID_ACDC_POWER_SOURCE, DEVICE_NOTIFY_WINDOW_HANDLE );

hBatteryPowerNotify = RegisterPowerSettingNotification( hWnd, &GUID_BATTERY_PERCENTAGE_REMAINING, DEVICE_NOTIFY_WINDOW_HANDLE );

- no events are sent when on battery.


The USB cable to the computer should add expected benefits, not confined to the PowerChute software.


How do you access useful info from the UPS device using VC2008 c++ in windows?


Regards

/Ronnie


Labels
  • Labels:
  • Universal Transfer Switch
Reply

Link copied. Please paste this link to share this article on your social media post.

  • All forum topics
  • Previous Topic
  • Next Topic

Accepted Solutions
Anonymous user
Not applicable

Posted: ‎2021-06-29 11:06 PM . Last Modified: ‎2024-03-20 12:54 AM

0 Likes
0
1100
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2021-06-29 11:06 PM . Last Modified: ‎2024-03-20 12:54 AM

Thanks for your reply,

I managed to get it working.

First i tried writing for the HID Power Device spec by using hidapi-0.7.0, and probably it can be made working with more effort...

But I abandoned that and installed the alternate drivers from www.apcupsd.org.

The program apcaccess displayed all the info I could want, and i looked in the source and implemented the status-command via sockets and parsed the text to get what i wanted.

One could parse the output of apcaccess instead, to skip the socket handling.

It seems wrong that such facilities are not made available by APC, you have paid for a  product that is crippled by default.

I realize that the registry could be used to monitor (limited) status, but it seems more like a hack.

/Ronnie

See Answer In Context

Reply

Link copied. Please paste this link to share this article on your social media post.

Replies 2
voidstar_apc
Janeway voidstar_apc
Janeway

Posted: ‎2021-06-29 11:06 PM . Last Modified: ‎2024-03-20 12:54 AM

0 Likes
0
1099
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2021-06-29 11:06 PM . Last Modified: ‎2024-03-20 12:54 AM

Hi Ronnie,

I've never tried to use VC2008 to monitor a UPS, but here's two approaches I'd attempt:

1) Since the UPS is a standard USB HID Power Device (spec is here), you could try looking at the PowerSummary ACPresent usage.

2) I've also heard that PowerChute maintains several registry keys with useful information. I haven't investigated this, but you might look to see if there's one that shows AC present.

3) You can replace PowerChute's shutdown program with your own like these guys over here.

I think the windows API functions aren't working for you because PowerChute needs to disable windows' built-in UPS support in order to function correctly. Hopefully you can still get the information you need using the above methods, and if not, you can uninstall PowerChute to re-enable Windows' UPS support.

Let us know how you make out.

Reply

Link copied. Please paste this link to share this article on your social media post.

Anonymous user
Not applicable

Posted: ‎2021-06-29 11:06 PM . Last Modified: ‎2024-03-20 12:54 AM

0 Likes
0
1101
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2021-06-29 11:06 PM . Last Modified: ‎2024-03-20 12:54 AM

Thanks for your reply,

I managed to get it working.

First i tried writing for the HID Power Device spec by using hidapi-0.7.0, and probably it can be made working with more effort...

But I abandoned that and installed the alternate drivers from www.apcupsd.org.

The program apcaccess displayed all the info I could want, and i looked in the source and implemented the status-command via sockets and parsed the text to get what i wanted.

One could parse the output of apcaccess instead, to skip the socket handling.

It seems wrong that such facilities are not made available by APC, you have paid for a  product that is crippled by default.

I realize that the registry could be used to monitor (limited) status, but it seems more like a hack.

/Ronnie

Reply

Link copied. Please paste this link to share this article on your social media post.

Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

 
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of