Another option is to calculate the difference in the query from the totals stored in InfluxdB.
I do something very similar with NodeRed and Influx. There is no need to save daily totals in the database, instead you calculate them using the difference() function available in Flux.