I have struggled all afternoon with something which shouldn't be hard.
Have had a look around and seen some similar queries but not quite the same.
My problem is I am trying to add two variables together but the answer seems to be like concatenating the two values.
I am on a RasPi
Node-Red is version 1.2.9
Node.js is version 12.21.0
My code is this...
var temp_vala = msg.payload.rows[0].daily_v;
var temp_valb = msg.payload.rows[0].another_v;
var total = temp_vala + temp_valb;
I have tried wrapping the msg.payload with {} and {} and () and '{}' plus more combinations, equally I have tried wrapping the addition with a bunch of possibilities like ([temp_vala] + [temp_valb]) and a whole bunch of combinations of {} and [] and () with and without and I just can't see how to get to the value instead of the string value.
Several of the attempts gave me the concatenated answer instead of an addition of the two raw values.
My values in msg.payload are whole numbers, so I thought it would be really easy.
Sorry this is again a really basic question. Google and YouTube have not been my friend so far.
Cheers
Richard