From 3faffa986bc20144ab34cda92190244807b3cdd3 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Wed, 4 Oct 2023 22:31:09 +0200 Subject: JSON: encode co2_ppm as number, not string --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 75197c6..1e81673 100644 --- a/init.lua +++ b/init.lua @@ -63,7 +63,7 @@ function uart_callback(data) return end - local json_str = string.format('{"rssi_dbm":%d,"co2_ppm":"%d","temperature_celsius":%d}', wifi.sta.getrssi(), mh_z19.co2, mh_z19.temp) + local json_str = string.format('{"rssi_dbm":%d,"co2_ppm":%d,"temperature_celsius":%d}', wifi.sta.getrssi(), mh_z19.co2, mh_z19.temp) local influx_str = string.format("co2_ppm=%d,temperature_celsius=%d,abc_ticks=%d,abc_count=%d", mh_z19.co2, mh_z19.temp, mh_z19.abc_ticks, mh_z19.abc_count) if not publishing_mqtt then -- cgit v1.2.3