Coder Social home page Coder Social logo

Comments (6)

jmceara avatar jmceara commented on July 18, 2024

Forgot to say: using version 2.1.0

from weewx-mqttsubscribe.

bellrichm avatar bellrichm commented on July 18, 2024

Your json payload is

{
  "battery":71,
  "humidity":43.77,
  "last_seen":"2022-05-18T14:25:08-03:00",
  "linkquality":98,
  "temperature":21.13,
  "voltage":2900
}

MQTTSubscribe attempts to convert all incoming data to float. The easisest, if you don't care about last_seen is to ignore it.

        [[[zigbee2mqtt/Escritorio_-_Temperatura]]]
            [[[[message]]]]
                type = json
            [[[[temperature]]]]
                name = inTemp
            [[[[last_seen]]]]
                ignore = true

Alternately you could keep it as a string

        [[[zigbee2mqtt/Escritorio_-_Temperatura]]]
            [[[[message]]]]
                type = json
            [[[[temperature]]]]
                name = inTemp
            [[[[last_seen]]]]
                conversion_type = none

from weewx-mqttsubscribe.

jmceara avatar jmceara commented on July 18, 2024

Tks! I will try this tonorrow.

One sugestion is to parse only specified fields from condifuration. I mean, default state would be ignore and just include fields from condiguration.

from weewx-mqttsubscribe.

bellrichm avatar bellrichm commented on July 18, 2024

Agree that if I was starting from scratch, 'opt in' woukd make sense. When I started I wanted everyting in the json and now with MQTTSubscribe 3 years old, I am hesitate to make that kind of breaking change.
If one wants to 'opt in', you could do something like this.

        [[[zigbee2mqtt/Escritorio_-_Temperatura]]]
            ignore = true
            [[[[message]]]]
                type = json
            [[[[temperature]]]]
                name = inTemp
                ignore = false

from weewx-mqttsubscribe.

bellrichm avatar bellrichm commented on July 18, 2024

Are you all set?

from weewx-mqttsubscribe.

bellrichm avatar bellrichm commented on July 18, 2024

Closing due to inactivity. Feel free to reopen if necessary.

from weewx-mqttsubscribe.

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.