MySensor Controller Config - Imperial (false) setting



  • Ok, this driving me nuts: I can't find any doc that shows how to change the default ControllerConfig from Metric (true) to Imperial (false). I'm seeing some years old stuff where there was a setting in an include file but that's not there anymore. How to I set/change the controller config to false in the mysensors gateway so when my sensor code does a getControllerConfig call it returns a 'false'?


  • Mod

    @rmalbers which controller are you using?

    The gateway will return whatever setting your controller is using.



  • Ok, for sensor value display I am using Mozilla WebThings gateway connected to a MySensors 8266 wifi/NRF24 gateway receiving data from MySensors temp/hum sensors.


  • Mod

    Thanks for explaining

    So Mozilla WebThings is your controller. Its MySensors support is very new (it exists thanks to @Sathishkumar-Thangavel and @alowhum )

    I have no experience with this controller, but hopefully someone else has. I moved the thread to the Mozilla WebThings category where it might get noticed by the right people.



  • @mfalkvidd Thank you, I was unsure where to post the question and as you can tell, unsure what code was responsible for the C or F setting.


  • Plugin Developer

    @rmalbers This isn't implemented in the Mozilla Gateway yet. Until it is, the MySensors add-on can't send the proper response (it's probably always saying metric now?), since there is no data to work from.

    I could, for the time being, perhaps implement a setting in the add-on settings instead. I'll have a look.



  • Ya, I think I saw the message with the 'M' at the end in the log file. You know, I was kind of wondering about a setting like that, that would be really slick. One thing that is odd, I have the 'Weather' addon installed using 'Dark Sky' as the weather source and on that 'thing', it shows Temp in degrees 'F' and is shows up as a 'temperature sensor' when I go into 'Edit' for that 'thing' so there must be some kind of support for 'F' for a Temp sensor WebThings somewhere.


  • Plugin Developer

    I've created the setting. It should be in the next version. First I'll do a few tests.

    For now, I've made it so that if you set it to Imperial, temperature sensors will show the data as being in Fahrenheit.

    Once the WebThings Gateway has that preference available (perhaps it already has, although I didn't see anything in the code), I will link it to that. I don't think I've seen a 'metric or imperial' setting in the UX though.



  • @alowhum Wow great, thanks for getting that in there, that should help other users out also as they fire this code up. So many of the mysensors examples use that config setting that I'm sure others would request that addition to the the addon.



  • FYI: I just looked and the 'Weather' addon does have a setting for F or C in the addon config, so that makes more since now.


  • Plugin Developer

    @rmalbers Ah, thanks. Then it makes sense to add it to this add-on too.



  • @alowhum You know, I sort of misspoke, just to be more accurate: it's (the setting is) actually imperial or metric, I guess it's really more than just C and F, I simplified (and I shouldn't have). This is how it's stated on the addon: "Units to use, i.e. imperial for ˚F, metric for ˚C"


  • Plugin Developer

    It works. The new version is getting closer to release.



  • @alowhum Great thanks!


 

205
Online

8.6k
Users

9.4k
Topics

99.0k
Posts