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



  • 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!


  • Plugin Developer

    @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.


Log in to reply
 

Suggested Topics

  • 3
  • 6
  • 6
  • 2
  • 8

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts