Page 4 of 4

Re: Grafana Dashboard now working... very quick

Posted: Tue Sep 10, 2019 4:09 pm
by scyto
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...

Re: Grafana Dashboard now working... very quick

Posted: Thu Sep 12, 2019 10:04 am
by ben
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).