Moving inputs and retaining data

I need to swap inputs around between my emonPi and emontx. I want to retain the existing logged data for each input/feed.

Is that easy enough? I am trying to search the Community, but not sure if I am searching with the correct terms, or I am not understanding how I actually need to accomplish it.

I am assuming I can ‘point’ the inputs/feeds to the exiting logged data but I am unsure if that is the approach I take.

Could anyone point me in the right direction of maybe an article to explain?

Welcome, @spmaid, to the OEM forum.

First, a disclaimer: I’ve never had a need to do what you want to do – but I think this will work. To the best of my knowledge, this isn’t written down anywhere, neither is there a tool to do it.

You need to understand the method by which the data from the inputs is processed and recorded.

In the case both of the emonTx and the emonPi, it arrives serially in emonHub. This checks for transmission errors, labels the data with the NodeID of the data’s source, and sends it to the Inputs page of emonCMS. There, as each piece of the data arrives, it’s processed (e.g. scaled, two inputs added, converted, or in the case of (say) kWh accumulators, it’s added to the last stored value). All this is transient.

The data storage mechanism – the database – is a Feed. The data on the Inputs page reaches the Feed either explicitly with a Log to feed process, or implied when you name a Feed in, for example, a kWh Accumulator process.

So what you will need to do, as you physically swap the inputs between your devices, is copy (manually) the process steps for each sensor in the ‘old’ device and Input page to the ‘new’ device and Input, using the same Feed as before. That way although there will be a small break in the data, it will carry on recording data from the same sensor to the same Feed.

I would say no. It’s fiddly, it’s error-prone, I think (I’m certain) there’s no mechanism to get an accurate print-out of all the details of each process step for each input for each sensor node, and I’m equally certain there’s no copy-and-paste method to help you. So I advise a pen and several sheets of paper, and a careful and unhurried approach.

Many thanks for taking the time to respond, very much appreciated, I shall take a look at what you have suggested and see if I can give it a go!