Grafana Dashboard now working... very quick

Working on a home project? Post it here.
scyto
Posts: 258
Joined: Sun Apr 06, 2014 7:24 pm

Re: Grafana Dashboard now working... very quick

Post by scyto » Tue Sep 10, 2019 4:09 pm

i haven't been around in a long while. so hi.

I just setup influxdb and grafana for the first time for a different project (unifi stats).

Is there a way for grafana to pull data directly from my dashbox? (i haven't been using emoncms)

If not is there anyway to get my historical data set from my dashbox into influxdb.

Or do i have to just accept it is a fresh dataset?

I do have data up in SEG too.... would love to kick that to the kerb...
ben
Site Admin
Posts: 4262
Joined: Fri Jun 04, 2010 9:39 am

Re: Grafana Dashboard now working... very quick

Post by ben » Thu Sep 12, 2019 10:04 am

scyto wrote:i haven't been around in a long while. so hi.

I just setup influxdb and grafana for the first time for a different project (unifi stats).

Is there a way for grafana to pull data directly from my dashbox? (i haven't been using emoncms)

If not is there anyway to get my historical data set from my dashbox into influxdb.

Or do i have to just accept it is a fresh dataset?

I do have data up in SEG too.... would love to kick that to the kerb...
There's a user for backup under Settings->System->Backup Settings that can be setup. That user will also be able to pull data from the database.

Grafana can be setup to pull from PostgreSQL.

https://grafana.com/docs/features/datasources/postgres/

Then it's just a matter of understanding the mappings.

Devices->Channel->"minutedataYYYY-MM-DD",hourdata,daydata

You can do something like:

Code: Select all

SELECT channel_name, kwh
FROM hourdata
INNER JOIN channel ON channel.channel_id = hourdata.channel_id
INNER JOIN devices ON devices.device_id = channel.device_id 
WHERE serial = '01000010'
AND date BETWEEN '2019-09-01 05:00:00' AND '2019-09-02 05:00:00';
ORDER BY date DESC
Time is adjusted for timezone (everything is stored as UTC).
Ben
Brultech Research Inc.
E: ben(at)brultech.com
Post Reply