btmon + influx + grafana help

Post any 3rd party software here.
Post Reply
thesalcedo
Posts: 17
Joined: Wed Dec 12, 2018 9:02 pm

btmon + influx + grafana help

Post by thesalcedo » Mon Dec 17, 2018 9:19 pm

Hi all,

I received my GEM last week and I have been playing with trying to capture the data output into Influxdb and graphing it with grafana.

I have btmon.py successfully sending data to a local influxdb instance; here's what btmon.cfg looks like:

Code: Select all

[source]
device_type = gem
ip_read = true
ip_host = 192.168.86.35
ip_port = 80
ip_mode = client
include_current = true
reverse_polarity = true
[influxdb]
influxdb_out = true
influxdb_host = localhost
influxdb_port = 8086
influxdb_upload_period = 10
influxdb_database = energyMeter
influxdb_measurement = energy
influxdb_mode = row
influxdb_db_schema = ecmreadext
I can query influxdb and I see data coming in ch32 are my Main CTs:
influxdb_data.png
influxdb_data.png (16.75 KiB) Viewed 16129 times
Questions:
- Does my btmon.cfg configuration look ok? What does everyone else use in their config to make things easier to work with in Influxdb (maps? Keys?)
- If I understand "influxdb_map" correctly, I should add this line to rename the GEM naming of channel 32 Amps to "Main Amps"?:
influxdb_map = serialnumber_ch32_a, MainAmps
- What is "influxdb_tags" used for exactly? How do you use them?

Thanks for the help!
Cheers.
ben
Site Admin
Posts: 4262
Joined: Fri Jun 04, 2010 9:39 am

Re: btmon + influx + grafana help

Post by ben » Wed Dec 19, 2018 11:07 am

thesalcedo wrote: - Does my btmon.cfg configuration look ok? What does everyone else use in their config to make things easier to work with in Influxdb (maps? Keys?)
- If I understand "influxdb_map" correctly, I should add this line to rename the GEM naming of channel 32 Amps to "Main Amps"?:
influxdb_map = serialnumber_ch32_a, MainAmps
- What is "influxdb_tags" used for exactly? How do you use them?

Thanks for the help!
Cheers.
1. IMO, looks fine.

2.

Code: Select all

influxdb_map = 1234567_ch1_aws,a,1234567_ch2_aws,b  # renames channels
Looking at the above, you'd use map to bind those fields to names.

3. From what I've read, tags are used for indexed fields. So if you have a field that's going to be queried constantly, you'd want that to be a tag. If the database was built differently, such as:

timestamp, watts, amps, volts, kwh, channel

You'd want channel to be a tag as your query would likely be like:

SELECT * FROM energy WHERE channel = 5;
Ben
Brultech Research Inc.
E: ben(at)brultech.com
thesalcedo
Posts: 17
Joined: Wed Dec 12, 2018 9:02 pm

Re: btmon + influx + grafana help

Post by thesalcedo » Wed Jan 02, 2019 8:23 am

Thanks Ben!

I think I understand what the different values are, but I need clarification on one specifically:

ch32_a --> Amps
ch32_dwh --> ???
ch32_w --> Watts
ch32_wh --> Watts/Hour

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

Re: btmon + influx + grafana help

Post by ben » Wed Jan 02, 2019 10:42 am

thesalcedo wrote:Thanks Ben!

I think I understand what the different values are, but I need clarification on one specifically:

ch32_a --> Amps
ch32_dwh --> ???
ch32_w --> Watts
ch32_wh --> Watts/Hour

Thanks!
That should be your watt hours used between packets.
Ben
Brultech Research Inc.
E: ben(at)brultech.com
ben
Site Admin
Posts: 4262
Joined: Fri Jun 04, 2010 9:39 am

Re: btmon + influx + grafana help

Post by ben » Fri Jul 12, 2019 3:26 pm

jerryt wrote:I had this working great, then something broke. Cmd window now states, "InfluxDBClient not loaded".

Anyone help me load the InfluxDBClient ??
Did you re-install Python or switch to a new PC?

Try:

pip install influxdb

In console.
Ben
Brultech Research Inc.
E: ben(at)brultech.com
Post Reply