NodeRed - Create 1 sensor out of 2 MQTT topics fails

Hi,

i have 2 Power inputs from my roof, that I want to combine to 1 sensor in nodered.
Data are delivered via MQTT:

PV1 Power: evcc/site/pv/1/power
PV2 Power: evcc/site/pv/2/power

image

As you can see, the merged sensor only takes the values from PV2 Power.

What do I have to set so that the values from PV1 are also transferred to the “PV1+PV2 sensor”?

Maybe this is of help?


https://cookbook.nodered.org/basic/join-streams

This is what I created now:

Cannot merge non-object types

I know, I am doing something wrong…

Are you sure you get a msg.topic from mqtt?

You probably have to play a bit with the join settings:

I played around…this is the only setting, where I get no error…but still only the value of PV2


Can you show the full message debug from PV1 and PV2 ?
(so msg.payload + msg.topic)

Use an event state to do the addition of the 2 sensors.

image

In the output section for payload use.

$entities('sensor.PV1').state + $entities('sensor.PV2').state

1 Like