I have a big problem. I am a newbie and would like to compare the total meter reading from the influxdb with the electricity meter. If the value of the electricity meter is 0 (because of a power failure, for example), all newly collected values of the electricity meter should be added to the value from the InfluxDB.
In order to do what you ask it is necessary to get the data from the query and that from the meter into one message. See this article in the cookbook for an example of how to join messages into one object.
However, there may be a better way of solving the problem. Can I ask a question? Why do you need to know the total consumption (since some arbitrary time in past, presumably)? Is it in fact the case that you don't need to know the absolute running total, but what you want to know is how much has been used today, or last year, or similar?