Subqueries, where each of the above is used to pull the respective value in a subquery, and then you do the math in the main query
GROUP BY time(<period>) on each of the subqueries (with an aggregator like mean()), in order to get matching timestamps. The appropriate <period> will depend on the frequency of the respective readings - it should be long enough that each aggregation period contains at least one datapoint. You can also add something like FILL(last), if e.g. one reading is much more frequent than the other.
Thank you! From your comment (2) I understood, that it is nesessary to calculate common time stamps, and then do a calculation of every single of it. I have no idea how to proceed with (1) / how you think it
About the timing, the wetness sensor gives a value quite constant every 2 hours plus/minus some minutes, the temp sensor when the temp changes, generally more frequent about every 20 minutes. So I would like to go back on every temp sensor measurement and subtract it from the “last available” wetness value. Maybe also vice versa to cover also the wetness sensor time stamps.