emoncms / device

Emoncms device module
GNU Affero General Public License v3.0
2 stars 17 forks source link

Reinitializing device duplicates inputs #26

Closed pb66 closed 5 years ago

pb66 commented 6 years ago

I had some devices posting to emoncms before making up the device template files, since devices are now created for all new inputs, there were new devices already listed on the device page so rather than deleting, I "edited" the device(s) and selected my new template and "reinitialized" the device.

The first time I did this it duplicated the inputs and I put that down to it not recognizing each existing input by it's index+1 temporary name given to it.

However when I fixed a typo to a feed name and added another input to the template and then reinitialized the same device a second time, it created a third set of inputs, see below.

image

It should have only created a single addition input as input "8" aka "frequency" was omitted in the draft template.

This creation of a third set of inputs is definitely a bug, but the second set although it could be the same error, I sort of expected it to happen as it couldn't map the old temp names to the new names, but now we have indexedinputs there should be no problem with mapping.

adminde commented 6 years ago

Oh my^^

I'm confused. How can it have multiple feeds with the same index? Did I miss some latest changes to emoncms? And it creating inputs with the same name and node again is definitly a very bad thing... I hope I can find some time to look into this soon. I fear its a stupid caching issue though...

pb66 commented 6 years ago

I'm confused. How can it have multiple feeds with the same index? Did I miss some latest changes to emoncms?

I assume you mean "inputs" not "feeds" ?

Have you seen the indexed inputs branches of emoncms and device?

See this forum thread for info https://community.openenergymonitor.org/t/development-indexed-inputs/8354

TrystanLea commented 5 years ago

To my knowledge this has been fixed in more recent versions