No Datapoints i Grafana - InfluxDB - OH2

I am pretty new to this Universe.
I have installed InfluxDB 1.1.1 and Grafana 4.0.2. I am using Persistence in OpenHAB2 to log data from my temperature loggers.
Data is updated into my “openhab_db” database in InfluxDB, I can query data from InfluxDB by using select * from… in Grafana I get no erros but a message saying “No datapoints”.

I have in the same time interval, the script running (from this excellent tutorial: InfluxDB+Grafana persistence and graphing) and that data I can access and see in Grafana.

In Grafana I have made this configuration, It’s the second Query that fails:

I am no expert in OH and databases, but the one thing that looks different is the “timestamp”, where the logdata from OH ends on a lot of Zero’s and timestamps from the script is filled out with numbers.

I am running the installation on a Raspberry Pi 3, OH, InfluxDB and Grafana.

It’s probably a beginner’s mistake, I hope there is someone who can get me closer to a sloution.

Any news on your side? After reading through your error description I’m not sure what’s wrong here…

I have been looking more into this, and the problem was, I think, that I have made a string item and wanted to show that in Grafana.
I’ve changed it to a number and it still did’nt work until I deleted the series in influxdb (probably because of a mix of data stored as string and numbers.
But It is working now :slight_smile:


Hope you won’t mind me jumping in on this thread.
I have been trying to get Grafana (4.0.2) and InfluxDB (1.1.1 working with OpenHAB 2 (openhabian) on a Raspberry Pi 3. I can get data into InfluxDB, and out to Grafana (input direct from keyboard into influx via Putty). But I cant (yet) get data from Openhab into InfluxDB.
I’ve installed the InfluxDB (V1.0) Persistence (snapshot 1.9.0)) using PaperUI and (I think) set up the necessary config files, but no joy.
I’m new to all this, and unsure how to proceed, but I’d be interested to know please what version of InfluxDB Persistence you used, as that one obviously can work.Any other suggestions would be welcome?

I had that problem until I gave the .persistence file the Right name. First I gave it the same name as my project, but the persistence file follows the database and should be named “influxdb.persistence”.

Ken, Thanks for the quick reply.
My file is called influxdb.persist (not .persistence) so maybe that is the problem. I’m about to go out for the rest of the evening, so I’ll try changing it (probably tomorrow).
Thanks for the tip.

My fault, it should be named influxdb.persist.
How does Your configuration look like? .persist file, items file

Here is my influxdb.persist file, just very basic to try to get it working…
(working through the samba share which is set up by openhabian, the file is in the directory openHAB-conf/persistence)

Strategies {
    everyHour : "0 0 * * * ?"
	everyMinute : "0 * * * * ?"
	default = everyChange, everyMinute

Items {
    * : strategy = everyChange, everyMinute

and here is my items file ( in openHAB-conf/items directory)

Group All
Group gGF 		(All)
Group gFF 		(All)
Group gGar		(All)
Group gOut	 	(All)
Group gUtil		(All)

Group Weather 	(All)
Group Status 	(All)

Group GF_Lounge 	"Lounge" 				<television>		(gGF)
Group GF_Kitchen 	"Kitchen/Dining room" 	<kitchen> 			(gGF)
Group GF_Study 		"Study" 				<office>			(gGF)
Group GF_Porch 		"Front Porch" 			<corridor>		 	(gGF)
Group GF_Utility	"Utility room" 			<washingmachine> 	(gGF)
Group GF_Back_Porch	"Back Porch" 			<corridor>		 	(gGF)
Group GF_Toilet 	"Outside Loo" 			<toilet> 			(gGF)

Group FF_Bath 		"Bathroom" 				<bath> 				(gFF)
Group FF_Sewing 	"Sewing Room" 			<bedroom> 			(gFF)
Group FF_Bed1 		"Main Bedroom" 			<bedroom> 			(gFF)
Group FF_Bed2 		"Guest Bedroom" 		<bedroom> 			(gFF)
Group FF_Landing 	"Landing" 				<corridor> 			(gFF)
Group FF_Stairs 	"Stairs" 				<corridor> 			(gFF)

/*Group Out_Garage 		"Garage & Loft" 			<garage_detached> 	(gGar)*/

Group Out_Greenhouse 	"Greenhouse" 			<greenhouse> 		(gOut)
Group Out_Polytunnel 	"Polytunnel" 			<greenhouse> 		(gOut)
Group Out_Stables 		"Stables" 		<garage_detached_selected>	(gOut)

/*Group Electric			"Electricity"			<energy>			(gUtil)
Group Oil				"Heating Oil"			<oil>				(gUtil)

/* ============= */
/* Active Groups */
/* ============= */

Group:Switch:OR(ON, OFF) 		Lights 		"All Lights [(%d)]" 							(All)
Group:Switch:OR(ON, OFF) 		Heating 	"No. of Active Heatings [(%d)]" 	<heating> 	(All)
Group:Number:AVG Temperature	"Avg. Room Temperature [%.1f °C]" 	<temperature>	(Status)
Group:Contact:OR(OPEN, CLOSED) 	Windows 	"Open windows [(%d)]"				<contact>	(All)

/* ====== */
/* Lights */
/* ====== */

Dimmer Light_GF_Lounge_Wall_lights	"Wall lights" 	(GF_Lounge, Lights)
Switch Light_GF_Lounge_Lamp1		"Large lamp" 	(GF_Lounge, Lights)
Switch Light_GF_Lounge_Lamp2		"Small lamp" 	(GF_Lounge, Lights)

Switch Light_GF_Porch_Ceiling 		"Ceiling light" (GF_Corridor, Lights)

Switch Light_GF_Study_Ceiling 		"Ceiling light"	(GF_Study, Lights)
Switch Light_GF_Study_Lamp 			"Standard Lamp"	(GF_Study, Lights)
Switch Light_GF_Desk_Lamp 			"Desk Lamp"		(GF_Study, Lights)
Switch Light_GF_Computer 			"Computer"		(GF_Study, Computer)

Switch Light_GF_Kitchen_Ceiling 	"Ceiling light" (GF_Kitchen, Lights)
Switch Light_GF_Kitchen_Table 		"Table light" 	(GF_Kitchen, Lights)

Switch Light_GF_Toilet_Ceiling 		"Ceiling light"	(GF_Toilet, Lights)

Switch Light_GF_Utility_Ceiling 	"Utility Ceiling light"		(GF_Utility, Lights)
Switch GF_Washing_Machine 			"Washing machine"			(GF_Utility, washingmachine)
Switch GF_Utility_Fridge_Freezer 	"Fridge/Freezer"			(GF_Utility, washingmachine)

Switch Light_GF_Pantry_Ceiling 		"Pantry Ceiling light"		(GF_Utility, Lights)

Switch Light_FF_Bath_Ceiling 		"Ceiling lights"(FF_Bath, Lights)
Switch Light_FF_Bath_Mirror 		"Mirror light" 	(FF_Bath, Lights)

Switch Light_FF_Sewing_Ceiling 		"Ceiling light" (FF_Sewing, Lights)

Switch Light_FF_Landing_Ceiling 	"Landing light" (FF_Landing, Lights)

Switch Light_FF_Main_Bed_Ceiling 	"Ceiling light" (FF_Bed1, Lights)

Switch Light_FF_Guest_Bed_Ceiling 	"Ceiling light" (FF_Bed2, Lights)

Switch Light_Outdoor_Garage_Main		"Garage main lights" 		(gGar, Lights)
Switch Light_Outdoor_Garage_Loft_Main 	"Garage Loft main lights" 	(gGar, Lights)
Switch Light_Outdoor_Garage_Loft_Spots 	"Garage Loft spotlights" 	(gGar, Lights)

Switch Light_Outdoor_Frontdoor 			"Frontdoor"					(gOut, Lights)

/* ======= */
/* Heating */
/* ======= */
Switch Heater_Outdoor_Garage_Loft 	"Garage Loft heater" 	<fan>	(gGar, heating)	{ mqtt=">[mqttbroker:cmnd/sonoff/1/POWER:command:ON:1],>[mqttbroker:cmnd/sonoff/1/POWER:command:OFF:0],<[mqttbroker:stat/sonoff/1/POWER:state:MAP(]", autoupdate="false"}

/* stat/sonoff/1/POWER */
/* cmnd/sonoff/1/POWER */

/* ========= */
/* Utilities */
/* ========= */

Number Electric_Meter_Watts			"Main Electric Meter Watts" 		<energy>		(gUtil) { mqtt="<[mqttbroker:sensor/1/electric_meter/watts:state:default]" }

/* itemtype itemname ["labeltext"] [<iconname>] [(group1, group2, ...)] [{bindingconfig}] */
/* mqttbroker */

Number Oil_tank_level				"Oil Tank Level"				<line-decline>		(gUtil)
Number Boiler_output				"Boiler heat Output"			<fire>				(gUtil)
Number Boiler_flow_temp				"Boiler Flow Temperature"		<flowpipe>			(gUtil, gBoiler) { mqtt="<[mqttbroker:/ESPeasy2/DS18B203/Temperature:state:default]" }
Number Boiler_return_temp			"Boiler Return Temperature"		<returnpipe>		(gUtil, gBoiler) { mqtt="<[mqttbroker:/ESPeasy2/DS18B202/Temperature:state:default]" }
Number Boiler_exhaust_temp			"Boiler Exhaust Temperature"	<smoke>				(gUtil, gBoiler) { mqtt="<[mqttbroker:/ESPeasy2/DS18B201/Temperature:state:default]" }

/*Number Boiler_Electric_Watts		"Boiler system electric Watts" 		<energy>		(gUtil, gElectric) { mqtt="<[mqttbroker:sensor/1/electric_meter/watts:state:default]" }*/

/* =============== */
/* Outdoor Sensors */
/* =============== */

Number Greenhouse_temp			"Greenhouse Temperature"	<temperature>			(Out_Greenhouse) { mqtt="<[mqttbroker:/ESPeasy1/DHT22/Temperature:state:default]" }
Number Greenhouse_hum			"Greenhouse Humidity"		<humidity>				(Out_Greenhouse) { mqtt="<[mqttbroker:/ESPeasy1/DHT22/Humidity:state:default]" }

I hope you can see something I’m doing wrong so I can improve it.
One other question: I’m confused about whether I need any configuration for the influxdb connection in the file openhab.cfg - some of the pages I found seemed to say yes, but that might be only for the original openHAB, not openHAB2?

Wishing everyone here all the best for a peaceful Christmas,

Edit: code fences added

Hello @AndrewJ,

first a more general note regarding your persist file, you should not just persist * everything and on top of that every minute. Persist the groups and/or items you are actually interested in with the strategy “everyChange, everyHour”, which should be more than enough for all use cases.

Secondly make sure to configure your service correctly. See InfluxDB+Grafana persistence and graphing
All configurable details are important to get right.

Lastly, please check your log for influxdb related information. If needed increase the loglevel. See:

Hello @ThomDietrich,
Many thanks for your reply (and especially on Christmas Day!!). That gives me some good leads to work on. That will be later in the week now, so I’ll see how I get on, and come back on the forum if that throws up any more questions.
One other thing. I’ve found elsewhere in the forum there is a thread about the change from “default” to “autogen” and an issue about correct use of quotes. ( Influxdb persistence policy change). Would this be related to my problem, and where should I find a file to download with the fix of this issue?
Best wishes,

Hey, these problems should not happen on your system. They occurred on systems with older and then upgraded influxdb installations. Just stay with autogen.

It’s working now. Great!
I went through the tutorial again, step by step, and found a few mistakes I’d made. Corrected those and made the changes that you suggested, @ThomDietrich. Many thanks for your support.

1 Like