I have MQTT data being pushed into Influx. Building out a query to get two values (volts and current (amps)), looks like this so far…
SELECT "value" FROM "mqtt_consumer" WHERE ("topic"::tag = 'N/e8eb11e512f4/solarcharger/258/Dc/0/Voltage' OR "topic"::tag = 'N/e8eb11e512f4/solarcharger/258/Dc/0/Current') AND time >= now() - 6h and time <= now()
However, I really need a third value, but that value is computed. I need to show “Watts”, which would be volts * amps. I have ZERO idea how to even start on this, to get a computed field out. I see, too, that I can create separate queries in this InfluxQL query builder. I’ve set up the query above with the OR, but also two separate queries. Works about the same either way.
Can someone assist me in an example of how to create the calculated value? If this were regular SQL (like MSSQL) and these were fields, I would know how to do it. SELECT voltage, current, voltage*current AS 'watts'
But the “structure” of InfluxDB seems different and I don’t have a grasp of what looks like what… Is a topic a table? Seems like a bucket is a database…
Hey, hadn’t seen that feature. That’s pretty good. I ended up routing everything through Influx after all, for the historical aspects. So, now that the suns down I’m still able to see the data! I’ll added it into the same graph, but the values are so different in scale, I’ll likely have to break it out like you did. (Unless there’s some…adjustment to apply that has disparate graph lines make sense.)