are sensor values stored in the database ?

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.
Post Reply
Stef
Posts: 3
Joined: Thursday 02 August 2018 16:55
Target OS: Raspberry Pi
Domoticz version:
Contact:

are sensor values stored in the database ?

Post by Stef » Thursday 02 August 2018 17:52

hello,

I've just started to see if Domoticz is the right tool for me.
My first impression is very good.
I've connected a BME280 sensor with an ESP8266 through a LAN connection with Domoticz and it seems to work well.
The device is setup as a Temperature/Pressure/Humidity sensor and these values are nicely split by Domoticz.
Now I want to see the history of yesterday of this sensor but I can not find them in the database.
Are these values not stored in the database or am I looking at the wrong place ?

best regards,
Stef

User avatar
waaren
Posts: 812
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: are sensor values stored in the database ?

Post by waaren » Thursday 02 August 2018 20:47

Stef wrote:
Thursday 02 August 2018 17:52
...
The device is setup as a Temperature/Pressure/Humidity sensor and these values are nicely split by Domoticz.
Now I want to see the history of yesterday of this sensor but I can not find them in the database.
Are these values not stored in the database or am I looking at the wrong place ?

best regards,
Stef
Using the GUI you can just press the log button on the device to look at the history graphs.
In the domoticz.db you will find the device with current values in table DeviceStatus.
The history is stored in table Temperature with a granularity of 1 sample per 5 minutes (1-7 days definable in [SETUP][SETTINGS][LOG HISTORY])
and in table Temperature_Calendar where you will find the history with a granularity of 1 sample per day.
the ID in table DeviceStatus links to the DeviceRowID in the history tables.
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

Stef
Posts: 3
Joined: Thursday 02 August 2018 16:55
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: are sensor values stored in the database ?

Post by Stef » Thursday 02 August 2018 21:16

thanks for the fast response.

ok one step further.

Yes I know the graph view from the GUI.
And yes I've seen the temperature table (but in that table the temperature value from Wunderground is shown.
I guess my problem is that I've 5 different temperature sensors, and I guess that Domoticz only stores the history of just one.
No, no, looking in detail indeed all temperatures of all sensors are in the Temperature table.

But I still can't find Humidity and Barometric pressure, while I can see the last day graphs, last month graph of these parameters, so they must be somewhere in the database.
It's not really an issue, because the values are also send to an MQTT broker/logger.

Is there anywhere some documentation of how values in the database are stored ?

best regards,
Stef

User avatar
waaren
Posts: 812
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: are sensor values stored in the database ?

Post by waaren » Thursday 02 August 2018 21:26

Stef wrote:
Thursday 02 August 2018 21:16
...
But I still can't find Humidity and Barometric pressure, while I can see the last day graphs, last month graph of these parameters, so they must be somewhere in the database.
...
Hi Stef in my domoticz database I see this for a combined device.

.headers on
select * from temperature where deviceRowId = 1014;

DeviceRowID|Temperature|Chill|Humidity|Barometer|DewPoint|SetPoint|Date
1014|0.0|0.0|50|1010|-9.2|0.0|2018-08-02 20:40:00
Is there anywhere some documentation of how values in the database are stored ?
Not that I know. I made a copy of the database and transferred it to my PC and peeked around using SQLiteExport personal edition (freeware)
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

Stef
Posts: 3
Joined: Thursday 02 August 2018 16:55
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: are sensor values stored in the database ?

Post by Stef » Thursday 02 August 2018 21:54

thanks again Waaren,

they are indeed in the temperature table

(I used DBbrowser to view it,
SQLtiteStudio before, but that was far too slow, maybe therefore I missed it :) )

best regards,
Stef

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests