Giter Club home page Giter Club logo

Comments (7)

setevik00 avatar setevik00 commented on May 7, 2024

Try to remove dash from the variable name, e.g. rename humidity-1 to humidity1 .

from thingsboard.

soupim avatar soupim commented on May 7, 2024

It's same result. I got result as { "humidity1":$humidity1.valueAsString}.

from thingsboard.

setevik00 avatar setevik00 commented on May 7, 2024

Strange that it happens just from time to time. Here is my Kafka plugin template:
{"geoZone" : "TEMP-001", "windSpeed" : "$temperature.valueAsString"}
The only difference with your case is that I have "$temperature.valueAsString" in double quotation marks. Hopefully that helps!

from thingsboard.

ashvayka avatar ashvayka commented on May 7, 2024

@soupim Is it possible that sometimes you are sending message from device that does not have humidity, and in this case we don't know how to map the value to the expression?

from thingsboard.

soupim avatar soupim commented on May 7, 2024

@ashvayka @setevik00 Thank you! I found my problem. My device sends temperature as well as humidity. Two values ​​are sent in each message. When sending temperature, the humidity value is not included. The device send humidity once every 3 seconds and temperature once every minute. This seems to have caused problems. How do I set a rule to check if telemetry contains humidity?

from thingsboard.

setevik00 avatar setevik00 commented on May 7, 2024

I think you have to create two rules. First rule will check that both temperature and humidity are present and send them out via kafka plugin. Second rule will check that only temperature is present.
First rule:
typeof temperature != 'undefined' && typeof humidity != 'undefined'

Second rule
typeof temperature != 'undefined' && typeof humidity == 'undefined'

I'm not sure, but think that in second rule you have to check specifically that humidity is undefined, otherwise you will have duplicated data as both rules will apply for the same telemetry data.

from thingsboard.

soupim avatar soupim commented on May 7, 2024

@setevik00 Thank you!

from thingsboard.

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.