So… somehow i was able to create a influx database ( am not realy able to get to the CLI with the command influxd…(see last post in The Influx grafana Tutorial )
Anyway somehow i was able to create a openhab_db and grafena is also able to communicate with this DB
Yeah!
Now i want to save some values in that Database.
I have a esp sending temperature values to a MQTT Server and i am able to see the values as a generic MQTT thing.
I have a MQTT Broker, a Generic MQTT Thin (Subscripted to a channel (mqtt:topic:48450fd7:temperature) and i have an item named temperature linked to GenericMQTTThing_Temperature (which i can see in the Control Tab)
what do i have to write in my influxdb.persist-file?
If your item is named temperature the “temperature*” in the .persist file ( which should be a group) is not correct. Remove the “*” and it should work.
at the command line, type “influx”. Then, at the ‘>’ prompt, type in:
auth - will ask for your user name and password
use openhab_db
show measurements
Your measurement should be listed. If it is there, type:
select * from measurement (change name as needed)
You should then see your measurements.
If you don’t see your measurement, then it is not getting into influxdb. By default, influx does write logging to /var/log/syslog. Look there to see if you have any influx log information. You should see one log entry every time your item is persisted.
Also, in Grafana, when you set up your graph, be sure to select the retention policy of ‘autogen’ since that is what you are using. Grafana can be confusing - it will show the measurement as available even if you have the wrong retention policy, but it will show no points on your graph. So make sure to set the retention policy there (assuming that the above works and that you are getting data into influxdb).
$ influx
Connected to http://localhost:8086 version 0.13
InfluxDB shell version: 0.13
> CREATE DATABASE openhab_db
> CREATE USER admin WITH PASSWORD 'SuperSecretPassword123+' WITH ALL PRIVILEGES
> CREATE USER openhab WITH PASSWORD 'AnotherSuperbPassword456-'
> CREATE USER grafana WITH PASSWORD 'PleaseLetMeRead789?'
> GRANT ALL ON openhab_db TO openhab
> GRANT READ ON openhab_db TO grafana
> exit
Hmm ok,
i see that the installation of Influx aborted with
2019-02-10 19:39:44,865: FireMotD: Error: Template folder doesn't exist. Upgrading from an older version? Please run make again or run the install function "FireMotD -I -v".
i did the workaround according this.
removed and reinstall influx. but still the influx command is unknown…
It’s possible that the client isn’t installed. Try this:
sudo apt-install influxdb-client
After this, influx should be there as /usr/bin/influx
It does look like influxdb is running correctly. If you wait a while, do you see any entries for the writes?
sudo apt-get install influxdb-client
E: Type '“deb' is not known on line 1 in source list /etc/apt/sources.list.d/influxdb.list
E: The list of sources could not be read.
E: Type '“deb' is not known on line 1 in source list /etc/apt/sources.list.d/influxdb.list
E: The list of sources could not be read.
Influx seem to work (since the status command is delivering something)
i am able to connect to the influx command line interface via webinterface (localhost.8083),
i can write some data into the influx database using the webinterface.
I can make some graphs via grafana using this manual written data.
But openhab refuses to write the parameter temperature into the influx database.
Look at the /var/log/syslog after a write to InfluxDB should have occurred. You should see something like this indicating a POST write. If you are not getting a POST line, then the issue is with openHAB not writing at all. If you see httpd POST lines from InfluxDB in the syslog, but they are not successful, then that needs to be debugged. The ‘204’ below indicates success.
naa… the latest status is that i do not get any entries that indicates a post , so yes obvious it is somehow related to openhab which is not willing to write the data (probably because i miss some commands)
Your item’s name is temperature? Maybe you want this without the ‘*’. That’s the way I read it here. Also, you have installed the InfluxDB persistence service?