Platform information:
- Hardware: Raspberry Pi 4 Model B Rev 1.2
- OS: Raspbian GNU/Linux 10 (buster)
- Java Runtime Environment: openjdk version “1.8.0_252”
- openHAB version: 2.5.6-2
Issue of the topic:
After an apparently successful install of InfluxDB and Grafana via the openhabian-config utility, followed by installing the Influx Add-on in Paper UI and configuring my persist file, I can’t get OpenHAB to write to the database.
Here is a group if items, grouped under gFlood, that I’ll use to test it. Changes to the alarm states are confirmed to be recorded in the log.
Number:Temperature Sensor_Temp_Aeotec "Sensor Temperature" <temperature> (gFlood) { channel="zwave:device:a5f14603:node3:sensor_temperature" }
Number Battery_Level_Aeotec "Battery Level" <battery> (gFlood) { channel="zwave:device:a5f14603:node3:battery-level" }
Number Alarm_Flood_Aeotec_Num1 "Aeotek flood alarm" <alarm> (gFlood) { channel="zwave:device:a5f14603:node3:alarm_flood1" }
Switch Alarm_Flood_Aeotec "Sump pump flood sensor" <alarm> (gFlood) ["Switchable"] { channel="zwave:device:a5f14603:node3:alarm_flood1" }
Switch Alarm_Burglar_Aeotec "Aeotec burglar alarm" <alarm> (gFlood) ["Switchable"] { channel="zwave:device:a5f14603:node3:alarm_burglar" }
Number Alarm_Flood_Dome_Num "Dome flood alarm" <alarm> (gFlood) { channel="zwave:device:a5f14603:node4:alarm_flood" }
Switch Alarm_Flood_Dome "Water heater leak sensor" <alarm> (gFlood) ["Switchable"] { channel="zwave:device:a5f14603:node4:alarm_flood" }
Number Battery_Level_Dome "Battery Level" <battery> (gFlood) { channel="zwave:device:a5f14603:node4:battery-level" }
Here is my persist file. Right now I have it set to record every minute just for testing purposes.
Strategies {
everyMinute : "0 * * ? * *"
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
}
Items {
gFlood* : strategy = everyMinute
}
The contents of thsi config file look right, except for something curious – the automatic installation asked me for a password for the “openhab” user account. The password that appears in this config file is NOT the one I entered during set up. Apparently it defaults to “openhabian” as the password no matter what you type. So should I edit this file? Which password is correct?
/etc/openhab2/services/influxdb.cfg:
user=openhab
password=openhabian
db=openhab_db
retentionPolicy=autogen
url=http://localhost:8086
/var/log/syslog and /var/log/openhab2/openhab.log have no influxdb entries for writes to the database. /var/lib/influxdb/data/ is empty and /var/lib/influxdb/meta/ has meta.db in it.
I went into influx to check further but couldn’t find any data:
Connected to http://localhost:8086 version 1.8.1
InfluxDB shell version: 1.8.1
> auth
username: admin
password:
> use openhab_db
Using database openhab_db
> select * from Alarm_Flood_Aeotec
>
I checked to see if influx is actually running:
openhabian@openhab:~ $ ps -ef | grep -i influx
influxdb 6043 1 0 06:26 ? 00:00:00 /usr/bin/influxd -config /etc/influxdb/influxdb.conf
openhab+ 6385 5471 0 06:33 pts/0 00:00:00 grep --color=auto -i influx
I’m at a loss right now. There are several other questions like mine in the forum but I couldn’t find my answer in them. Thanks.