Page 1 of 1

DC Power Meter for Battery Monitoring using BT-DCPM and Rpi 3

Posted: Sunday 20 May 2018 8:57
by MobileDomUser
I've been working on integrating a DC power meter for monitoring my battery into a Domoticz install for our RV which runs on an Rpi 3. Attached is the LUA script I've developed. Here's some information on how to use it:
You can purchase a BT-DCPM from https://www.thornwave.com/products-btdcpm.
After you install it with an appropriate shunt on your battery-based power system, configure the monitor using Thornwave's app for your particular battery type and size. Then follow the instructions at the top of the script to get Bluetooth running and add your sensors to Domoticz.

I've updated my script as the original did not give me notifications. Turns out the UpdateDevice method I was using updated the Domoticz database itself and did not allow it to process the value and decide to send the notification. I changed the method to "OpenURL" and used JSON to update the values and I now get notifications!

Here is the updated script, note the additional variable of the IP address:
BT-DCPMLuaScript.lua.txt
(11.08 KiB) Downloaded 10 times
Here's a screenshot of the Utility sensors:

Re: DC Power Meter for Battery Monitoring using BT-DCPM and Rpi 3

Posted: Sunday 20 May 2018 11:04
by EdddieN
Nice!

The connection is via Bluetooth to the RPI?

Re: DC Power Meter for Battery Monitoring using BT-DCPM and Rpi 3

Posted: Wednesday 23 May 2018 6:09
by MobileDomUser
Sorry for the late reply, evidently I don't have my notifications correct. Yes, it is Bluetooth.

Re: DC Power Meter for Battery Monitoring using BT-DCPM and Rpi 3

Posted: Friday 22 June 2018 4:42
by MobileDomUser
I've updated my script as the original did not give me notifications. Turns out the UpdateDevice method I was using updated the Domoticz database itself and did not allow it to process the value and decide to send the notification. I changed the method to "OpenURL" and used JSON to update the values and I now get notifications!

Updated script is available in the first post.

Re: DC Power Meter for Battery Monitoring using BT-DCPM and Rpi 3

Posted: Sunday 26 August 2018 4:33
by MartHale
That is very sweet! I built a voltage monitor to run off wifi but I am still working out the bugs, this looks like a well built solution.