I'm sorry if this has been answered already but I can't seem to find my specific case.
I fetch values from an SQL database and want to use these in graphs and charts of the dashboard module. For some values I sum various fields in a single SQL statement and want to use that combined output.
I know you can transfer values using a function or change node with a payload statement like "msg.payload.item"
However with complex SQL statements it tells me the node is invalid.
The SQL statement is something like:
msg.topic ='select (`Solar_zuid`+`Solar_west`+`Solar_oost`+`Solar_center`+`Solar_new`) from power order by Timestamp desc limit 1'
return msg;
What I would get is something like:
(
Solar_zuid+
Solar_west+
Solar_oost+
Solar_center+
Solar_new): 1234 }
Obviously I just need that value "1234".
Thanks for your help!