How do we use Capablity.Power?

In the Documentation section of the IDE there is a Capability Power.

Has anyone found a way for it or seen it used.
Here is information from the site.

Power

Capability Name_________SmartApp Preferences Reference
Power__________________capability.power

Attribute________________Type______________Possible Values
powerSource _________String "unknown""mains" “battery” “dc”

Commands:
None.

2 Likes

Really sad, isn’t it… The lack of deep Capability documentation on this foundational aspect of the platform?

One thing worth doing is a search of the public Community SmartThings GitHub repo to see if any DTH (or SmartApps!) use the Capability.

Also worth tagging @Jim

Perhaps @unixbeast can help answer any questions or find out more info.

2 Likes

This capability is mainly meant to be an indication of when the power source changes for a device. For example, if you device for some reason goes to a backup power source.

That being said, it sounds like the developers are thinking of renaming/reworking that capability a bit. So I would hold off a bit on using it until you see it updated in the docs.

Dave

1 Like

I use it with an original Smartsense motion detector to notify me of a power failure. IIRC the stock DTH for that device supports it (although they broke it for a time).

BTW @unixbeast where in the doc would I find whether ‘delay’ pauses script execution?

I was looking into the capability as more of a notification of power supply changes, like battery to AC and back. Although I do not have the original motions senor, I was wondering if other devices like dual powered thermostat could serve a similar function. I will hold off until things are revised and see we what can be done.

That is exactly what the gen 1 detector provides, and why I was bummed they removed that capability from the new one. And while the Aeon multi-sensor supports both battery and usb power, it does not support this capability.

I don’t know of any other device that does.

Although it doesn’t directly answer your questions, maybe this will help:
http://docs.smartthings.com/en/latest/code-review-guidelines.html?highlight=delay#do-not-use-busy-loops

Thanks. That seems pretty clear it pauses execution. But there is a specific ‘delay’ param…

mySwitch.on([delay: 2000])

where it is not clear if it pauses execution. Does anyone there know?

This is the response I got back from development:

“It’s handled by the platform as an optional Map parameter to device commands. The device handler itself doesn’t need to explicitly support it. It delays execution of the command but does not pause execution of the SmartApp”

1 Like

© 2019 SmartThings, Inc. All Rights Reserved. Terms of Use | Privacy Policy

SmartThings; SmartApps®; Physical Graph; Hello, Home; and Hello, Smart Home are all trademarks of the SmartThings, Inc.