Closed rp2019433 closed 5 months ago
That nil
could be a symptom of invalid JSON, but you did not show the output from tasmota.read_sensors()
without also doing the json.load()
.
Hi.
I forgot to mention that. tasmota.read_sensors()
without json.load()
works properly.
import json
var sensors=tasmota.read_sensors()
print(sensors)
Indeed. There is an invalid JSON output.
This is the output generated for the code below:
var sensors=tasmota.read_sensors()
print(sensors)
{"Time":"2024-05-01T16:20:04","ANALOG":{"A1":2536,"A2":974},"BME680":{"Temperature":31.5,"Humidity":100.0,"DewPoint":31.5,"Pressure":967.6,"Gas":46.99},"SGP40":{"VOC_Raw":28304,,"TVOC":235,},"Custom":{"Battery Voltage":4.10},"PressureUnit":"hPa","TempUnit":"C"}
Yeah, there was an error in the driver, producing too many commas. Fixed a month ago in https://github.com/arendst/Tasmota/issues/21084
If you upgrade to the development build, the fix is included.
Beware that your "Custom" sensor produces a JSON key with a space. While this is not technically invalid, it can cause trouble with some tools. Hence, this style is generally avoided.
Closing since already fixed in development branch
PROBLEM DESCRIPTION
Board: ESP32
Sensors attached to ESP32:
When running the Berry script below in version 13.4.0, Tasmota does not return information for any sensor.
If I downgrade version to 13.0.0, Tasmota returns some information, but without SGP sensor:
If I remove BME680 and SGP40, and run Berry script in version 13.4.0, Analog sensors values are returned:
REQUESTED INFORMATION
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Backlog Template; Module; GPIO 255
:Status 0
:TO REPRODUCE
Steps to reproduce the behavior:
Described above.
EXPECTED BEHAVIOUR
A clear and concise description of what you expected to happen.
When running commands below, all sensors values should be returned.
SCREENSHOTS
If applicable, add screenshots to help explain your problem.
Screenshots inserted above.
ADDITIONAL CONTEXT
Add any other context about the problem here.
(Please, remember to close the issue when the problem has been addressed)