Urban Exploration, PHP and others…

Store temperature data from Domoticz in mySQL for historical analyses

This PHP script will retrieve temperature data from Domoticz and store it in a MySQL database. This way you can keep detailed information for more than 7 days, which is the limit for the short log in Domoticz.

Detailed temperatures are stored in the table temp_day. Daily minimal, average and maximum temperatures in temp_month.
The script automatically adds columns for each thermometer you put in the devices array. Column names are set to the name of the device in Domoticz. This means that if you ever replace a thermometer you only have to give it the same name and change the idx in the script.

All you need to do is create a database and adjust the items for each define line, the script does all the rest.