JSON bulk data import (history values) with auto overwrite

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
ben53252642
Posts: 543
Joined: Saturday 02 July 2016 5:17
Target OS: Linux
Domoticz version: Beta
Contact:

JSON bulk data import (history values) with auto overwrite

Post 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-)
Unless otherwise stated, all my code is released under GPL 3 license: https://www.gnu.org/licenses/gpl-3.0.en.html
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

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

Post by Egregius »

Why not write it in the database directly?
ben53252642
Posts: 543
Joined: Saturday 02 July 2016 5:17
Target OS: Linux
Domoticz version: Beta
Contact:

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

Post 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.
Unless otherwise stated, all my code is released under GPL 3 license: https://www.gnu.org/licenses/gpl-3.0.en.html
ben53252642
Posts: 543
Joined: Saturday 02 July 2016 5:17
Target OS: Linux
Domoticz version: Beta
Contact:

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

Post 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.
Unless otherwise stated, all my code is released under GPL 3 license: https://www.gnu.org/licenses/gpl-3.0.en.html
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest