EMONCMS multiple Publish to MQTT issue

Hi all,

I’m trying to have multiple “Publish to MQTT”, but all of them takes the line 1 value always…

  1. Log to Feed value 946
  2. Publish to MQTT value 946. Correct!
  3. Power to kWh value 3.65
  4. Publish to MQTT value 946. WRONG! Should be 3.65
  5. Power to kWh/D value 2.93
  6. Publish to MQTT value 946. WRONG! Should be 2.93

Can you please help?

Thanks

It is doing exactly as it says. From the ‘help’ pop-up text on the Inputs page:

Power to kWh: Convert a power value in Watts to a cumulative kWh feed.

Visualisation tip: Feeds created with this input processor can be used to generate daily kWh data using the BarGraph visualisation with the delta property set to 1.
See forum thread here for an example Creating kWh per day bar graphs from Accumulating kWh

Output: Does NOT modify value passed onto next process step.

and for Power to kWh/d

Convert a power value in Watts to a feed that contains an entry for the total energy used each day (kWh/d)

Output: Does NOT modify value passed onto next process step.

The pertinent part that explains what you are seeing is “Does NOT modify value passed onto next process step.” So, you need a separate Feed to accept the kWh values. You set that when you add Power to kWh & Power to kWh/d

I’m not an emonCMS expert so I can’t help you any more.

That I think is what I have…

Please check the screenshot.

What you have is the value (496 or 377.00) being passed down in steps 1, 2, 3, 4, 5 & 6 UNCHANGED, as it says in the help. So your ‘Publish to MQTT’ should be publishing 496 each time. And it is. Clearly, that’s not what you wanted nor what you anticipated. What you need to do (apparently), and I don’t know how but I suspect virtual feeds might be involved, is send to MQTT the value of the feeds AC-Solar:AC-SOLAR-KWH and AC-Solar:AC-SOLAR-KWHD

Sorry, but I really can’t help any more.

[Edit: See my next post for how.]

@Robert.Wall thanks for your prompt answer. Let’s see if someone can help, your logic seems right, but the steps to do it, I don’t know neither.

I tried searching for “Publish feed to MQTT” and found:

So now I do know. It’s a bit tortuous - at the end of your list (after step 13) you need to add the reset, +feed & publish twice (once per feed). And obviously you don’t publish the wrong values in the old steps 4 & 6 but move those down the list.
(Whether I remember the next time is a moot point.)

1 Like

Hi @Robert.Wall

You gave me the solution.

Here is the screenshot with the input!

Thanks

1 Like