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

  • 15
  • 7
  • 5
  • 11
  • 2
  • 11
  • 9
  • 2

116
Online

10.2k
Users

10.6k
Topics

109.2k
Posts