Giter Site home page Giter Site logo

Comments (3)

quirosaur avatar quirosaur commented on May 20, 2024

i have same kind of problem in tb-gateway 1.4.1, where my second filter expression seems to be ignored, and only first is applied to incoming data.

i try to test this on 1.4.0, but that branch is impossible to build. gateway needs thingsboard 1.4 to be built, and thingsboard 1.4 build gets stuck with these:

2018-05-17 15:39:53,253 [Akka-akka.actor.default-dispatcher-5] INFO  akka.event.slf4j.Slf4jLogger - Slf4jLogger started
2018-05-17 15:39:53,258 [main] ERROR o.t.s.s.c.rpc.ClusterGrpcService - Failed to start RPC server!

i'll let you know if i get this working

from thingsboard-gateway.

rof20004 avatar rof20004 commented on May 20, 2024

I am with same problem.

from thingsboard-gateway.

rof20004 avatar rof20004 commented on May 20, 2024

@quirosaur I resolved like this:

I created only one entrie for the two values: humidity and temperature, like this:

{
          "topicFilter": "v1/usr/openhouse/down",
          "converter": {
            "type": "json",
            "filterExpression": "",
            "deviceNameJsonExpression": "${$.cmdId}",
            "deviceTypeJsonExpression": "SF_TempHumi",
            "timeseries": [
              {
                "type": "double",
                "key": "humidity",
                "value": "${$.humidity[1]}"
              },
              {
                "type": "double",
                "key": "temperature",
                "value": "${$.temperature[1]}"
              }
            ]
          }
        }

Then I modified the source code in this class BasicJsonConverter in method getTsKvEntries:

String key = eval(document, mapping.getKey());
String strVal = eval(document, mapping.getValue());

if (strVal.contains("${")) {
    continue;
}

With this, when humidity has value but temperature not, temperature will be ignored and will not send the literal value to thingsboard(${$.temperature[1]}), only humidity will be send.

For me works, I know this is not the best solution, but for now helped me :)

from thingsboard-gateway.

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.