Skip to content
Discussion options

You must be logged in to vote

You can use an MQTT integration and add your own custom bindings. Below assumes that the incoming values are in C and converts them to whatever units you have set on njsPC. It is assuming you have a topic myRoot/temps/airSensor with a floating point value in degrees C. The topic format can be whatever you like and njsPC will translate it to json. So you could post {"temp":89, "units": "F"} if you like. Then you would replace value with value.temp and value.units respectively. The convert.temperature method will normalize the units for you.

{
  "context": {
    "name": "MyMQTTBindings",
    "options": {
      "clientId": "@bind=`mymqtt_njsPC_${webApp.mac().replace(/:/g, '_'}-${webApp.httpP…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@orrious
Comment options

@orrious
Comment options

Answer selected by orrious
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants