[SOLVED] Openhab dont want push data to influxdb

  • Platform information:
    • Hardware: VM 2 CPU/2 GB RAM / 50GB HDD
    • OS: fedora 29 ( 4.18.18-300.fc29.x86_64)
    • Java Runtime Environment:

java-11-openjdk-headless-11.0.ea.28-2.fc29.x86_64
java-1.8.0-openjdk-headless-1.8.0.191.b12-8.fc29.x86_64
java-1.8.0-openjdk-1.8.0.191.b12-8.fc29.x86_64
javapackages-filesystem-5.3.0-1.fc29.noarch
java-11-openjdk-11.0.ea.28-2.fc29.x86_64
java-1.8.0-openjdk-devel-1.8.0.191.b12-8.fc29.x86_64

  • openHAB version:

openhab2-2.3.0-1.noarch
openhab2-addons-2.3.0-1.noarch

  • Issue of the topic: Openhab2 dont send data to influxdb
  • Please post configurations (if applicable):

Good day!
Today i installed openhab2+influxdb and configured it (use this instruction InfluxDB+Grafana persistence and graphing)

What works on my installation:

  1. Openhab2 works and collecting data from xiaomi gateway (sensors, door sensor)

tail -f /var/log/openhab2/events.log

2018-11-18 17:41:33.399 [vent.ItemStateChangedEvent] - mihome_sensor_weather_v1_158d00027435dc_temperature changed from 28.84000015258789 to 28.34000015258789
2018-11-18 17:41:33.405 [vent.ItemStateChangedEvent] - mihome_sensor_weather_v1_158d00027435dc_humidity changed from 28.280000686645508 to 29.059999465942383
2018-11-18 17:41:33.433 [vent.ItemStateChangedEvent] - mihome_sensor_weather_v1_158d00027435dc_pressure changed from 99.01000213623047 to 99.0199966430664
  1. Influxdb work as service. I used this script for check my installation Pump a sine wave signal as data points into a influxdb database · GitHub . It works and i can use data in grafana

  2. Grafana already worked because i used it for zabbix

My configs:

part http /etc/influxdb/influxdb.conf

[http]
enabled = true
bind-address = “:8086”
auth-enabled = true

/etc/openhab2/persistence/influxdb.persist

Strategies {
everyHour : “0 0 * * * ?” //self defined strategies
everyDay : “0 0 0 * * ?”

     // if no strategy is specified for an Item entry below, the default list will be used
    default = everyChange

}

Items {
group* : strategy = everyChange, restoreOnStartup //persist all direct members of the group ‘group’
item : strategy = everyChange, everyHour // persist the item ‘item’
otherItem // no strategy set, so use default strategy for item ‘otherItem’
* : strategy = everyChange // persist every item
}

/etc/openhab2/services/influxdb.cfg

url=http://127.0.0.1:8086
user=openhab
password=***
db=openhab_db
retentionPolicy=autogen

Also i change default persistence to influxdb Configuration->System->Persistence and check cli access with this commands

influx -username openhab -password *** -host localhost

Why openhab dont want push data to influxdb?

Try changing your persist file to use everyHour as a strategy for all items.

Example persist file:

Strategies {
    everyHour : "0 0 * * * ?"
    everyDay  : "0 0 0 * * ?"

    default = everyChange
}

Items {
    * : strategy = everyChange, everyHour, everyDay
}

Also if using a group the correct syntax is gNameOfGroup, note the lowercase g then the groups name.

Thanks. now i see data in grafana!

Please mark the post as solved by clicking the square box on the post that provided the solution.

Thanks.