Code Monkey home page Code Monkey logo

Comments (5)

sfromis avatar sfromis commented on May 26, 2024

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().

from tasmota.

rp2019433 avatar rp2019433 commented on May 26, 2024

Hi.
I forgot to mention that. tasmota.read_sensors() without json.load() works properly.

import json
var sensors=tasmota.read_sensors()
print(sensors)

image

from tasmota.

rp2019433 avatar rp2019433 commented on May 26, 2024

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"}

from tasmota.

sfromis avatar sfromis commented on May 26, 2024

Yeah, there was an error in the driver, producing too many commas. Fixed a month ago in #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.

from tasmota.

Jason2866 avatar Jason2866 commented on May 26, 2024

Closing since already fixed in development branch

from tasmota.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.