My guide to grafana / influxdb: Difference between revisions

From Edgar BV Wiki
Jump to navigation Jump to search
No edit summary
Line 19: Line 19:
</pre>
</pre>


==Filling influxdb using evologger==
==Filling influxdb using evologger For Honeywell Evohome==
[https://evohome-client.readthedocs.io/en/latest/index.html Evohome client readme]
[https://evohome-client.readthedocs.io/en/latest/index.html Evohome client readme]
[https://github.com/watchforstock/evohome-client Evohome client github]
[https://github.com/watchforstock/evohome-client Evohome client github]
Line 93: Line 93:


==Filling influxdb using domoticz==
==Filling influxdb using domoticz==
===For Honeywell Evohome===
Under Setup -> More Options -> InfluxDB
Under Setup -> More Options -> InfluxDB



Revision as of 06:40, 22 May 2019

adapted from SmartThings Data Visualisation using InfluxDB and Grafana

Influxdb

apt-get install influxdb influxdb-cli influxdb-client
service influxdb start
systemctl enable influxdb
influx

you can also surf to http://db-01.edgarbv.int:8083/ to check if it works

Back in the cli (influx) enter

Visit https://enterprise.influxdata.com to register for updates, InfluxDB server management, and monitoring.
Connected to http://localhost:8086 version 1.0.2
InfluxDB shell version: 1.0.2
> create database "honeywell"
> create user "grafana" with password 'password'

Filling influxdb using evologger For Honeywell Evohome

Evohome client readme Evohome client github Freeranger evologger

apt install git
apt-get install python-pip
cd /opt/
git clone https://github.com/freeranger/evologger.git
get clone https://github.com/watchforstock/evohome-client.git
pip install ./evohome-client
pip install influxdb

now cd /evologger

vi config.ini and fill in the usernames and influxdb stuff (port 8806)

To check if the data is being entered, use the influx cli

use honeywell
> show measurements

name: measurements
------------------
name
zone_temp.actual
zone_temp.delta
zone_temp.target

select * from "zone_temp.actual"

should give you some results.

NB this method takes all the data at the time of polling from the honeywell API instead of incrementally adding to it as Domoticz does.

To get it to run as a service

  vi /opt/evologger.sh
#!/bin/bash

pushd /opt/evologger
./evologger.py
  chmod 744 /opt/evologger.sh
  touch /var/log/evologger
  vi /usr/lib/systemd/system/evologger.service
[Unit]
After=grafana.service

[Service]
ExecStart=/opt/evologger/evologger.sh >& /var/log/evologger

[Install]
WantedBy=default.target
  systemctl enable evologger
  systemctl start evologger
  vi /etc/logrotate.d/evologger
/var/log/evologger {
        daily
        missingok
        rotate 7
        compress
        delaycompress
        notifempty
}

Filling influxdb using domoticz

For Honeywell Evohome

Under Setup -> More Options -> InfluxDB

Under Edit Link select the Device Name, value (Status / Temperature / Set Point), target type (direct: it sends everything it knows periodically / On value change: only when the value changes it will be sent)

Note for target type: for Set Point and Status you will need to set direct, to populate the database with the first data points. Once influxdb has been populated, you can change it to on value change) and click Add. It will appear in the table above.

Under general settings fill in database name and port 8086 :)

Under database in the format: honeywell-domoticz&u=USERNAME&p=PASSWORD

Also fill in username and password

Turn on Debug to test if data is being sent. You can find the log in Setup -> log. It will show entries like

  InfluxLink: value Temperature,idx=1,name=Huisje:-Living-room value=21.0

Save.

Now let it run for a (long) while. Then you can use the influx cli to

> show measurements
name: measurements
------------------
name
Set-point
Status
Temperature

>select * from "Set-point"

Grafana

The Grafana download page debian installation page for grafana Configuration page for grafana

apt-get install libfontconfig1 apt-transport-https

vi /etc/apt/sources.list

deb https://packages.grafana.com/oss/deb stable main

now you can install

dselect update
apt-get install grafana
systemctl daemon-reload
systemctl enable grafana-server
mv /var/lib/grafana/ /home/
ln -s /home/grafana /var/lib/grafana
systemctl start grafana-server

Verify it works by visiting

http://monitor.edgarbv.int:3000

admin / admin

change password

vi /etc/grafana/grafana.ini

;allow_sign_up = false

Now you can add a data source, which is an influxdb, with name set to Honeywell, URL set to http://db-01.edgarbv.int:8086/ and Influxdb database name, user and password filled in. You can then save and test.

NOTE the URL for data access is port 8086!

Getting started with Grafana guide