OpenHab on Redbrick_InfluxDB

tinkerforge
influxdb
Tags: #<Tag:0x00007f2128960320> #<Tag:0x00007f21289601b8>

(Federico) #1

Hi everyone! it’s exciting being part of this community. I have recently started playing with Openhab on a Tinkerforge RedBrick (default setup). As a first experiment I wanted to stream some live temperature data on a Influx database I have setup on a remote sever.

It all looks great if it wasn’t that I cannot read the temperature data on the database. When I query the DB I can only see the items names but not the actual value.

This is the openhab settings I am using:

Influx binding:
org.openhab.persistence.influxdb-1.9.0-SNAPSHOT.jar

openhab.config

folder:items=10,items
folder:sitemaps=10,sitemap
folder:rules=10,rules
folder:scripts=10,script
folder:persistence=10,persist

persistence:default=influxdb

chart:provider=default

logging:pattern=%date{ISO8601} - %-25logger: %msg%n

tcp:refreshinterval=250

tinkerforge:hosts=localhost

tinkerforge:temperature.uid=zuG
tinkerforge:temperature.type=bricklet_temperature
tinkerforge:temperature.slowI2C=False

tinkerforge:relay_heating.uid=rzB
tinkerforge:relay_heating.type=dual_relay
tinkerforge:relay_heating.subid=relay1

influxdb:url=http://databaseip:8086
influxdb:user=openhab
influxdb:password=tf
influxdb:db=openhab
influxdb:retentionPolicy=autogen

influxdb.persist

Strategies {
everySecond : "0/1 * * * * ?"
everyFiveSeconds : "0/5 * * * * ?"
everyMinute : "0 * * * * ?"
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
default = everyChange
}

Items {
temperature : strategy = everyChange
}

opensensor.items

Number temperature “Room Temperature [%.2f]” { tinkerforge=“uid=zuG” }
Number Thermostat “Setpoint [%.1f °C]”
Switch DualRelay1 “Heating” { tinkerforge=“name=relay_heating” }
Switch Heating “Heating On/Off”

When I query the database this is what I can read:

{“results”:[{“series”:[{“name”:“measurements”,“columns”:[“name”],“values”:[[“DualRelay1”],[“Thermostat”],[“temperature”]]}]}]}

Which are the actual items but not the value (i.e. temperature value)

I am sure is something stupid but I couldn’t really find a solution this this. Any ideas?

Thanks a lot!


(Rich Koshak) #2

What you have appears OK. See this for some detailed instructions for working with InfluxDB. They are OH 2 specific but should work for OH 1.x.


(SiHui) #3

To read the values perform:

on a console to get into influxCLI:

influx

point to the database (in my case “openhab_db”):

use openhab_db

show all stored values for an item (my item name is “Temperature”)

select * from Temperature

then you get a list with all temperature values and timestamps


(Federico) #4

Hi both! Thanks for your support.

Rich, I have been following the link you gave me however I wasn’t able to log data properly.

I see the items but not the data at all, I have tried sihui suggestion as well but the database looks empty.

On the Openhab log everything looks good:

2017-01-29 22:18:00.003 [TRACE] [o.c.p.internal.PersistItemsJob] - Storing item ‘temperature’ with persistence service ‘influxdb’ took 1ms
2017-01-29 22:18:01.006 [DEBUG] [i.i.InfluxDBPersistenceService] - got DecimalType value 22.31
2017-01-29 22:18:01.010 [TRACE] [o.c.p.internal.PersistItemsJob] - Storing item ‘temperature’ with persistence service ‘influxdb’ took 5ms
2017-01-29 22:18:02.002 [DEBUG] [i.i.InfluxDBPersistenceService] - got DecimalType value 22.31
2017-01-29 22:18:02.003 [TRACE] [o.c.p.internal.PersistItemsJob] - Storing item ‘temperature’ with persistence service ‘influxdb’ took 1ms
2017-01-29 22:18:03.002 [DEBUG] [i.i.InfluxDBPersistenceService] - got DecimalType value 22.31
2017-01-29 22:18:03.006 [TRACE] [o.c.p.internal.PersistItemsJob] - Storing item ‘temperature’ with persistence service ‘influxdb’ took 4ms

but no signs of data on the DB.

Really not sure what to try next.