From 3e786b679dab5cc91be325e67971aa6c2a07c77c Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Tue, 25 Aug 2026 19:51:48 +0000 Subject: [PATCH] Invert esp8266 soil moisture reading --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index a945e15..53ecead 100644 --- a/main.py +++ b/main.py @@ -534,7 +534,7 @@ async def history(request): q = 'select mean("pm10") as p10, mean("pm25") as p25, mean("co2") as co2, mean("voc_idx") as voc from air where "name" = \'{}\' and time >= {}s and time < {}s group by time({}) fill(linear)'.format(name, start, end, window) elif measurement == 'soil': client = sensors_client - q = 'select mean("soil") as soil, mean("moisture") as moisture from soil where "name" = \'{}\' and time >= {}s and time < {}s group by time({}) fill(linear)'.format(name, start, end, window) + q = 'select 1023-mean("soil") as soil, mean("moisture") as moisture from soil where "name" = \'{}\' and time >= {}s and time < {}s group by time({}) fill(linear)'.format(name, start, end, window) elif measurement == 'lux': client = sensors_client q = 'select mean("lux") as lux from air where "name" = \'{}\' and time >= {}s and time < {}s group by time({}) fill(linear)'.format(name, start, end, window)