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!



  • I didn't know for sure which thread to put this update under but I'll put it here: I updated to the new add-on version. I rebooted everything and I can confirm this the 'imperial' setting is working with my sensors. I had one sensor that has the code in it to check that setting and before I was getting the reading in C and the C label. Now with that sensor I am getting a F reading and a F label. GREAT! I did have to reboot a couple of things more than once! At this point I'm wondering that the boot order should be. Also I'm thinking that I need to unplug everything in the chain and plug things back in the right order, like Mozzilla gatewat first, then the MySensors gateway, the plug the MySensor sensors back in to get it all to work right. Anyway, this is really looking good!


  • Plugin Developer

    Glad to hear it 🙂

    it shouldn't matter much, but in theory the order is:

    • plug in serial MySensors Gateway
    • reboot Mozilla Gateway
    • reboot your nodes


  • Looks like I got the V0.9 Mozilla Gateway update last night, everything seems to be working fine. I now have a decimal digit on my temp readings that was not there prior to the upgrade. (73.4 F now, 73 F previous version)


  • Plugin Developer

    @rmalbers Thanks for reporting!


Log in to reply
 

Suggested Topics

  • 6
  • 3
  • 3
  • 3
  • 4
  • 4

15
Online

11.4k
Users

11.1k
Topics

112.7k
Posts