Page 1 of 1

JSON bulk data import (history values) with auto overwrite

Posted: Tuesday 05 December 2017 6:01
by ben53252642
Looking to import a year of previous utility usage data at 30 minute intervals into a Domoticz device from a CSV file.

As far as I am aware Domoticz does not currently have the ability to set a device value for a previous time.

Therefore the feature request is to allow the setting of a time and date in the JSON input (possibly using unix time)?

I think there is great potential for being able to import existing data sets into Domoticz.

I can write the code to do the import, I just need Domoticz to support setting the time via JSON.

Cheers 8-)

Re: JSON bulk data import (history values) with auto overwrite

Posted: Tuesday 05 December 2017 12:04
by Egregius
Why not write it in the database directly?

Re: JSON bulk data import (history values) with auto overwrite

Posted: Tuesday 05 December 2017 13:12
by ben53252642
Egregius wrote: Tuesday 05 December 2017 12:04 Why not write it in the database directly?
That may be what I end up having to do but I'd like to avoid it if possible.

Having the functionality in the JSON interface would allow people to easily write scripts for bulk data importation for things like water usage, utility etc... as long as it can be mapped from the source eg CSV file via other code.

Really all it is is set value x but at certain defined time instead of current time.

Re: JSON bulk data import (history values) with auto overwrite

Posted: Tuesday 05 December 2017 14:09
by ben53252642
I just realised writing directly to the DB is not possible with this application.

The data is received up to the previous day in CSV format (not current).

To make use of it specifying the time via JSON is necessary as the data would not be for the correct time / date with the current implementation.