Page 2 of 2

btmon patch for MQTT Publication

Posted: Tue Dec 06, 2016 4:09 pm
by AllanMar
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

Re: btmon patch for MQTT Publication

Posted: Tue Dec 06, 2016 11:14 pm
by guessed
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.

Re: btmon patch for MQTT Publication

Posted: Wed Dec 07, 2016 10:41 am
by ben
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.

Re: btmon patch for MQTT Publication

Posted: Sat Apr 11, 2020 7:59 am
by bmwilson55
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

Re: btmon patch for MQTT Publication

Posted: Wed Apr 15, 2020 3:07 pm
by ben
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)

Re: btmon patch for MQTT Publication

Posted: Wed Apr 15, 2020 3:56 pm
by guessed
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.

Re: btmon patch for MQTT Publication

Posted: Wed May 06, 2020 7:20 am
by bmwilson55
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,

Re: btmon patch for MQTT Publication

Posted: Wed May 06, 2020 11:49 am
by guessed
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.