back-up domoticz.db to a mysq db

Moderator: leecollings

User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: back-up domoticz.db to a mysq db

Post by Egregius »

You can change the domoticz url to http://user:pass@ip:port etc to add authentication.
Add the curl command to the Syno scheduler and your database will be always up to date.
JoeneH
Posts: 23
Joined: Saturday 24 February 2018 13:43
Target OS: NAS (Synology & others)
Domoticz version: v4.9700
Location: NL
Contact:

Re: back-up domoticz.db to a mysq db

Post by JoeneH »

Adding the ip address or range to the domoticz exclusion list works for the curl command.

I just read up on adding the curl command to the syno scheduler, before I saw your post: also works.

And in the meantime I managed to view graphs of the data stored into the mysql database in Grafana (running the Grafana server on my windows desktop).

All happy today! And another big thank you for your help.


Coming up:
modifying the php script, I don't need the month data, so figuring out which part to //

waiting for my smart meter to be installed
Getting p1 data into domoticz
Understanding the php script in more detail so I can add other devices (non temp)
Backing up history of p1 data into mysql
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: back-up domoticz.db to a mysq db

Post by Egregius »

I would keep the data in the month table. In my test it was less than 16KB for 1 month and 7 thermometers. That won't fill your nas ;)
JoeneH
Posts: 23
Joined: Saturday 24 February 2018 13:43
Target OS: NAS (Synology & others)
Domoticz version: v4.9700
Location: NL
Contact:

Re: back-up domoticz.db to a mysq db

Post by JoeneH »

Update:
waiting for my smart meter to be installed - Done
Getting p1 data into domoticz - Done
Understanding the php script in more detail so I can add other devices (non temp) - Not done
Backing up history of p1 data into mysql - Not done

What I don't understand from your temp2sql script is how does it know which data to read. My tempsensors log temp and humidity, but the temp2sql only puts the temp values into the database. How does it differentiate between temp values and humidity values in the domoticz database?

The p1 data is stored differently from temp data off course.
Electricity has 6 columns of data, called Value1 to Value6, so how do I get the script adjusted so it reads the correct column? The p1 data for electricity use is split in two (low tariff and high tariff), so I need both of them.

Also the p1 data for electricity use is collected (and stored?) every 5 seconds. Does the script store the 5 sec data or just the 5 min data as shown in the log-file from domoticz?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest