I am trying to create a synthetic time series query that looks are two other time series and if those values meet a certain condition, is outputs a 1 or 0 as the synthetic time series but I keep getting a syntax error that I can’t solve. Below is a code sample.
temp_id_list = t3308928194658464]
flow_id_list = t1256034258207391, 3564715377369546]
for temperature in temp_id_list:
temp_expression = f"TS{{id:{temperature}}} < 200"
flow_expression = " + ".join( f"(TS{{id:{flowrate}}})" for flowrate in flow_id_list])
final_expression = f"if({temp_expression} and {flow_expression} > 0, 1, 0)"
cv_query = client.time_series.data.synthetic.query(expressions=final_expression, start="1d-ago", end="now")