btmon patch for MQTT Publication

Post any 3rd party software here.
AllanMar
Posts: 9
Joined: Thu Feb 02, 2012 7:27 pm

btmon patch for MQTT Publication

Post by AllanMar » Tue Dec 06, 2016 4:09 pm

gosmond wrote:Another OpenHAB user here, adding +1 to request for native MQTT formatted data from the GEM.
Any status or ETA on
I use node-red for this. I posted details in another thread here
guessed
Posts: 25
Joined: Thu Feb 10, 2011 1:17 pm
Location: California

Re: btmon patch for MQTT Publication

Post by guessed » Tue Dec 06, 2016 11:14 pm

I considered building a daughter-board, with a Pi Zero, that would go inside the GEM and connect to the extra (serial) header from there, along with power.

Basically it'd be a Pi Zero + USB Wifi + BTMon (MQTT config).

I have an early model GEM and there appear to be changes since then so unsure if that would work for others with the newer boards. Mine has the removable/socketed XBee, where I currently have a RN-171 "Xvee" board for Wifi.

Eventually I bailed on that plan as the current deployment (RPi B running it all, serial-attached to my ECM-1240, and Wifi to the GEM) is working fine, so no need to mod it just yet.
ben
Site Admin
Posts: 4254
Joined: Fri Jun 04, 2010 9:39 am

Re: btmon patch for MQTT Publication

Post by ben » Wed Dec 07, 2016 10:41 am

guessed wrote:I considered building a daughter-board, with a Pi Zero, that would go inside the GEM and connect to the extra (serial) header from there, along with power.

Basically it'd be a Pi Zero + USB Wifi + BTMon (MQTT config).

I have an early model GEM and there appear to be changes since then so unsure if that would work for others with the newer boards. Mine has the removable/socketed XBee, where I currently have a RN-171 "Xvee" board for Wifi.

Eventually I bailed on that plan as the current deployment (RPi B running it all, serial-attached to my ECM-1240, and Wifi to the GEM) is working fine, so no need to mod it just yet.
The comms section of the board is pretty much identical minus the added Ethernet jack.
Ben
Brultech Research Inc.
E: ben(at)brultech.com
bmwilson55
Posts: 5
Joined: Fri Sep 21, 2018 1:10 pm

Re: btmon patch for MQTT Publication

Post by bmwilson55 » Sat Apr 11, 2020 7:59 am

Hello. Looking for help with mapping a GEM using btmon with MQTT. I see how to get w, wh, but was wondering what else i can get. Amps? Can someone tell me what the mapping should look like to get all the available data from my gem. Here is an example of a map, but does it have all available data?

mqtt_map=399999_ch1_w,solar,399999_ch1_wh,solar_wh,399999_t1,garage

39999_ch1_a for amps??

Thanks
ben
Site Admin
Posts: 4254
Joined: Fri Jun 04, 2010 9:39 am

Re: btmon patch for MQTT Publication

Post by ben » Wed Apr 15, 2020 3:07 pm

bmwilson55 wrote:
Sat Apr 11, 2020 7:59 am
Hello. Looking for help with mapping a GEM using btmon with MQTT. I see how to get w, wh, but was wondering what else i can get. Amps? Can someone tell me what the mapping should look like to get all the available data from my gem. Here is an example of a map, but does it have all available data?

mqtt_map=399999_ch1_w,solar,399999_ch1_wh,solar_wh,399999_t1,garage

39999_ch1_a for amps??

Thanks
Looking at line 4209, it looks like amps might not be included.

You might try changing:

for f in [FILTER_POWER, FILTER_ENERGY, FILTER_PULSE, FILTER_SENSOR]:

to

for f in [FILTER_POWER, FILTER_CURRENT, FILTER_ENERGY, FILTER_PULSE, FILTER_SENSOR]:

or (if you want to try to get delta watt hours going)

for f in [FILTER_DB_SCHEMA_ECMREADEXT]

but it looks like everything but amps are included by default. I think it should be:

t = temp
p = pulse
w = watt
wh = watt
a = amp (if the mod works)
dwh = delta watt hours (if last mod works)
Ben
Brultech Research Inc.
E: ben(at)brultech.com
guessed
Posts: 25
Joined: Thu Feb 10, 2011 1:17 pm
Location: California

Re: btmon patch for MQTT Publication

Post by guessed » Wed Apr 15, 2020 3:56 pm

There was a PR for this in the backlog, but it never got merged so it's now stale and cannot be directly applied anymore.
bmwilson55
Posts: 5
Joined: Fri Sep 21, 2018 1:10 pm

Re: btmon patch for MQTT Publication

Post by bmwilson55 » Wed May 06, 2020 7:20 am

Thanks ben and guessed. When you say it never got merged, do you mean the amps data is not available as a datapoint from the GEM? I can calculate it, but would rather grab it at the source if possible. I have not tried Ben's suggestion yet, but was hoping to get clarification if it is possible to get the amps out or not. Thanks,
guessed
Posts: 25
Joined: Thu Feb 10, 2011 1:17 pm
Location: California

Re: btmon patch for MQTT Publication

Post by guessed » Wed May 06, 2020 11:49 am

At some point after my PR was filed (https://github.com/matthewwall/mtools/pull/9) something was merged in a conflict formed. I run this version at my house, as it has the extra attributes.

Looks like I'd need to repair the PR in order to avoid the conflicts. Since they're not actively being merged it's probably not worthwhile, and you should proceed with the manual adjustments that @ben mentions.
Post Reply