Battery Monitor Plugin

Current Version : 0.6

Hi, All
This is plugin is designed for checking battery level status for all of your battery powered device. The plugin also fire events depending on
state.

Note : You must schedule a scene that call the plugin check action to update values.

General Functions

[ul][li]Automatically Find Battery powered device (In progress)[/li]
[li]UI to select Device to monitor[/li]
[li]Visual reporting of your battery state on dashboard[/li]
[li]UI to define levels (Low/Middle/High)- TODO[/li]
[li]AutoCheck function - TODO[/li][/ul]

Tested only with UI5 (1.5.408)

VERSION HISTORY

0.5 Initial public release
0.6 Correct BatteryLevel display problem

INSTALLATION
Automatic Installation version may be older due to validation Delay

Automatic
https://apps.mios.com/plugin.php?id=2678

Manual
Upload the plugin files (From the Zip file located at the end of this Post):

  • In the Toolbox section open MiOS Developers >> Luup Files and upload all the files you downloaded. check the Restart Luup after upload checkbox and click GO.

Create the IOS Notification Device:

  • Open Create Device.
  • In the UpnpDevFilename input box enter D_BatteryMonitor.xml
  • In the Upnp Implementation Filename input box enter I_BatteryMonitor.xml
  • In the Description input box enter a name for the panel device, e.g. My Battery Check.
  • Click Create device.
  • Close this window and Save.

Configuration
Go to the Devices tab, choose device to monitor by moving them to the Monitored List then save.

Advanced Configuration

  • In the device advanced control tab, you can find the following parameters (See screenshot)

[ul][li]General Status (0=Low,1=Middle,2=High) [/li]
[li]Last Error message with readable time[/li]
[li]Configured (Not yet Used)[/li]
[li]Define LowLevel in %, 33% by default[/li]
[li]Define MidLevel in %, 66% by default[/li]
[li]HighLevel (To be removed)[/li]
[li]LowDeviceList : List of device with low level battery[/li]
[li]MidDeviceList : List of device with battery beetween low and middle[/li]
[li]HighDeviceList : List of device with level battery above middle[/li]
[li]MonitoredDeviceList : List off monitored device[/li]
[li]UnMonitoredDeviceList : List off unmonitored device[/li]
[li]TimeLastCheck : Timestamp of lastcheck[/li][/ul]

USAGE IN SCENE

Check action
Launch a check for all monitored devices.

Events
When one or more devices reach Middle Level or Low Level an event is fired so, you can use it in Automation/Triggers to launch a script or Luup Code.
See screenshot below.

High Level Event => All devices are above Mid Level
Midlle Level Event => One or more devices are above Mid Level and Below High Level
Low Level Event => One or more devices are below Mid Level

USAGE IN CODE
Assuming that the Plugin was installed as Device 99, the following tests should work. Your installation will have a different Device number, please adjust accordingly.

luup.call_action("urn:upnp-org:serviceId:BatteryMonitor1", "Check",{}, 99 )

Depending of the state of your devices you will have the following feedback on the dashboard

Red Batttery Icon : There is at least one device below the low level
Yellow Batttery Icon : There is at least one device above Mid Level and Below High Level
Green Batttery Icon : All your device are above the middle level

Blue Batttery Icon : Unknown state or not yet checked

Sorry, but where do i get the files?

@j0ergensen

You will find it in the zip file attached to the first post (Above Screenshots)

Plugin validated, you can now use automated install.

See first post.

Bonjour Massalia.

J’ai installé le plug-in, pas de problème pour sélectionner les sondes avec batteries mais c’est tout.

Il n’en n’affiche aucune dans les catégories Low,Mid, High ni ne change l’icône principale.

D’où vient le 99 dans la ligne de programme. Si c’est le numéro du module créé, le l’ai changé dans mon cas par le mien

Et l’icône principale change bien de couleur mais je n’ai rien dans les différentes colonnes.

Merci

Thierry

@thbodart

Essaye de poster en Anglais, pour que le maximum de gens en profitent. :wink:
Si ma réponse en anglais n’est pas claire, envoi moi un MP.

  1. To avoid problems, start using the module by creating a scene, then go to the advanced tab, select batterymonitor then select check action (See screenshot).
  2. Then execute the scene, and check the dasboard, if it works you must have something like CHK:HH:MM (See Screenshot)

If you want to use Luup code, the las parameters is the ModuleID (See Screenshot)

Could you please Post a screenshot of the Advanded Tab of your BatteryMonitor Module.

Ce n’est comprendre qui m’est difficile mais m’exprimer.

I start using the module by creating a scene, then go to the advanced tab, select batterymonitor then select check action
I execute the scene, and check the dasboard, and I have RST:HH:MM and a blue battery icon

If I use the Luup code, with the parameter of the ModuleID (78 for me) the icon battery become yellow (ST814 50%, ST812 100%) I have CHK but nothing in the column of battery level

Thanks for help

@thbodart

Did you make your screenshot after or before calling the check function of plugin ?
Because your screenshot show RST : xxxx in your LastError variable not a CHK:xxxxx

@Massalia

I don’t remember but after a “luup.call_action(“urn:upnp-org:serviceId:BatteryMonitor1”, “Check”,{}, 78 )”

there are the 2 screenshots

@thbodart

Ok i finaly have the same problem, so i can debug it.

What Vera model and Software version do you use ?

Do you hit the reload button after installing the plugin ?

If not could you do it, then redo the check please.

Hello Massalia

VeraLite - UI5 - 1.5.408

  1. Uninstall - New install from Mios - Reload -> Summary(blue battery) RST - XXXX ; Advanced RST - XXXX ; Battery level empty

2 ) Selection of devices : ST814 50% + ST812 100% - reload -> Summary(blue battery) RST - XXXX ; Advanced RST - XXXX ; Battery level empty

  1. Automation - new scene - advanced - device 78 check - confirm change - save -> Summary(blue battery) RST - XXXX ; Advanced RST - XXXX ; Battery level empty

  2. Apps - develop apps - Test Luup code (Lua) : luup.call_action(“urn:upnp-org:serviceId:BatteryMonitor1”, “Check”,{}, 78 ) -> Summary(YELLOW battery) CHK-XXXX ; Advanced RST - XXXX ; Battery level empty

  3. Reload -> Summary(YELLOW battery) RST-XXXX ; Advanced RST - XXXX ; Battery level empty

If I open a new browser window after 4 -> Summary(YELLOW battery) CHK-XXXX ; Advanced CHK-XXXX ; Battery level empty

Un bon dimanche
Thierry

Hello Massalia,

I have installed your app. It looks very cool, but isn’t working quite as expected. After a battery check runs the battery meter icon does change to the color of the range with the lowest checked device. However, it doesn’t populate the list on the “Battery Level” tab. I only have 1 device monitored (a Kwikset deadbolt), though I plan to get more battery devices. The deadbolt has 60% battery. The app icon does show up as orange (for a mid level battery), but doesn’t show the deadbolt in the mid level list. It also isn’t adding the device number (3) to the “MidDeviceList” section on the Advanced tab of the app. Attached are some screenshots.

Any ideas? This is no big deal at the moment, however. I just wanted to give you some feedback.

Thanks,
Dave

@dksoxfan @thbodart

My job is taking all of my free time for this week, i’ll have a look at this bug probably this WE.

Hello Massalia

If, with Rfxtrx plugin, I add some Oregon probes (100% battery) with the ST812 (100%) and the ST814 (50%), the summery icon is Yellow and in battery monitor all the 100% probes are shown in the green column even ST812 but not the ST814 in yellow column.

I will publish a new version that normally correct this soon.

New version 0.6 just published

Normally this version fix BatteryLevel Tab problem
@thbodart, @dksoxfan could you update and see if it’s working for you now ?

See first post for details, and roadmap.

Hello Massalia,

Just downloaded 0.6 from apps.mios.com and tested, the BatteryLevel Tab, did not display the any details.
I manually added all monitored device to High, to see if this then corrected device that did not meet the criteria, but there was not changes and it did update the BatteryLevel Tab.

I also notice the in the first post, you have added Push 0.9…

Thanks for the good work, it is a very good idea and very great solution!

@Brientim

What Vera Model/Software version do you have ?