Author Topic: Battery Monitor Plugin  (Read 25103 times)

Offline Massalia

  • Full Member
  • ***
  • Posts: 166
  • Karma: +1/-0
Battery Monitor Plugin
« on: September 23, 2012, 09:57:13 am »
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
  • Automatically Find Battery powered device (In progress)
  • UI to select Device to monitor
  • Visual reporting of your battery state on dashboard
  • UI to define levels (Low/Middle/High)- TODO
  • AutoCheck function - TODO

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)

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

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.
Code: [Select]
luup.call_action("urn:upnp-org:serviceId:BatteryMonitor1", "Check",{}, 99 )


« Last Edit: December 30, 2012, 06:02:21 am by Massalia »

Offline Massalia

  • Full Member
  • ***
  • Posts: 166
  • Karma: +1/-0
Re: Battery Monitor Plugin
« Reply #1 on: September 23, 2012, 10:07:52 am »
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
« Last Edit: October 16, 2012, 04:39:56 pm by Massalia »

Offline j0ergensen

  • Sr. Newbie
  • *
  • Posts: 47
  • Karma: +0/-0
Re: Battery Monitor Plugin
« Reply #2 on: September 23, 2012, 10:40:56 am »
Sorry, but where do i get the files?

Offline Massalia

  • Full Member
  • ***
  • Posts: 166
  • Karma: +1/-0
Re: Battery Monitor Plugin
« Reply #3 on: September 23, 2012, 10:42:21 am »
@j0ergensen

You will find it in the zip file attached to the first post (Above Screenshots)
« Last Edit: September 23, 2012, 10:44:58 am by Massalia »

Offline Massalia

  • Full Member
  • ***
  • Posts: 166
  • Karma: +1/-0
Re: Battery Monitor Plugin
« Reply #4 on: September 24, 2012, 03:09:59 pm »
Plugin validated, you can now use automated install.

See first post.

Offline thbodart

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
Re: Battery Monitor Plugin
« Reply #5 on: September 25, 2012, 02:12:51 pm »
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

Offline Massalia

  • Full Member
  • ***
  • Posts: 166
  • Karma: +1/-0
Re: Battery Monitor Plugin
« Reply #6 on: September 25, 2012, 03:42:52 pm »
@thbodart

Essaye de poster en Anglais, pour que le maximum de gens en profitent.  ;-)
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.

« Last Edit: September 25, 2012, 03:48:37 pm by Massalia »

Offline thbodart

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
Re: Battery Monitor Plugin
« Reply #7 on: September 26, 2012, 11:22:31 am »
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


« Last Edit: September 26, 2012, 11:26:33 am by thbodart »

Offline Massalia

  • Full Member
  • ***
  • Posts: 166
  • Karma: +1/-0
Re: Battery Monitor Plugin
« Reply #8 on: September 29, 2012, 04:26:30 am »
@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

Offline thbodart

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
Re: Battery Monitor Plugin
« Reply #9 on: September 29, 2012, 03:55:50 pm »
@Massalia

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

there are the 2 screenshots

Offline Massalia

  • Full Member
  • ***
  • Posts: 166
  • Karma: +1/-0
Re: Battery Monitor Plugin
« Reply #10 on: September 29, 2012, 04:43:20 pm »
@thbodart

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

What Vera model and Software version do you use ?

Offline Massalia

  • Full Member
  • ***
  • Posts: 166
  • Karma: +1/-0
Re: Battery Monitor Plugin
« Reply #11 on: September 29, 2012, 04:55:19 pm »
Do you hit the reload button after installing the plugin ?
 
If not could you do it, then redo the check please.

Offline thbodart

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
Re: Battery Monitor Plugin
« Reply #12 on: September 30, 2012, 03:02:03 am »
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

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

4) 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

5) 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
« Last Edit: September 30, 2012, 03:23:07 am by thbodart »

Offline dksoxfan

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
Re: Battery Monitor Plugin
« Reply #13 on: October 03, 2012, 04:47:10 pm »
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

Offline Massalia

  • Full Member
  • ***
  • Posts: 166
  • Karma: +1/-0
Re: Battery Monitor Plugin
« Reply #14 on: October 03, 2012, 04:49:21 pm »
@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.