Its not possible to reference another Custom Node poller as a variable. You will need to use an SQL macro here. In advanced alert manager, go to the Trigger Action tab, choose 'custom node poller' for the property to alert on, add 2 simple conditions
- custom poller status is not equal to OK (or whatever makes sense here)
- custom poller name is equal to onbattery/orpowerok
now change the property to monitor drop down to 'custom SQL alert'
type out the full SQL query that is displayed (both the top gray and bottom half)
repeat the step as if you want to create an alert on the battery Capacity poller.
I can then advise how exactly to use the SQL macro