Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. How do I change the default units for the MQTT gateway?

How do I change the default units for the MQTT gateway?

Scheduled Pinned Locked Moved Troubleshooting
2 Posts 2 Posters 49 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • fixjunkF Offline
    fixjunkF Offline
    fixjunk
    wrote on last edited by
    #1

    I'm using a raspberry pi with onboard MQTT broker and nRF24 connected to the GPIO. Everything works just fine but I can't find anything on the site about how to set a temperature units preference (metric = false) from the gateway side.

    reference this line in the atmospheric pressure sketch:

    bool metric = true;                // Variable that stores if the sensor will output the temperature in Fahrenheit of Celsius. The gateway sends this preference to the node, so you dont need to change it here.
    

    So then... where do I change it? I checked the obvious places (./configure --help, mysensors.conf, the serial API, the MyConfig.h file itself...) but I can't find a clear answer.

    Thanks!

    J 1 Reply Last reply
    0
    • fixjunkF fixjunk

      I'm using a raspberry pi with onboard MQTT broker and nRF24 connected to the GPIO. Everything works just fine but I can't find anything on the site about how to set a temperature units preference (metric = false) from the gateway side.

      reference this line in the atmospheric pressure sketch:

      bool metric = true;                // Variable that stores if the sensor will output the temperature in Fahrenheit of Celsius. The gateway sends this preference to the node, so you dont need to change it here.
      

      So then... where do I change it? I checked the obvious places (./configure --help, mysensors.conf, the serial API, the MyConfig.h file itself...) but I can't find a clear answer.

      Thanks!

      J Offline
      J Offline
      jkandasa
      Plugin Developer
      wrote on last edited by
      #2

      @fixjunk this configuration will be supplied to your gateway from a controller.
      db3d11ac-6464-4684-9c31-76aab64f3d2b-image.png
      Source: https://www.mysensors.org/download/serial_api_20
      When your MySesnors node boots up, sends a I_CONFIG request to your controller, your controller has to respond to this request [response can be either (M)etric or (I)mperal ]

      AFAIK, This metric change will not affect your sensor measurement units. You have to convert yourself in your sketch.
      @mfalkvidd can confirm this.

      1 Reply Last reply
      1
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      24

      Online

      11.7k

      Users

      11.2k

      Topics

      113.1k

      Posts


      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • MySensors
      • OpenHardware.io
      • Categories
      • Recent
      • Tags
      • Popular