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. Dallas temp sensor in Fahrenheit, must be celsius

Dallas temp sensor in Fahrenheit, must be celsius

Scheduled Pinned Locked Moved Troubleshooting
11 Posts 3 Posters 3.9k 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.
  • PetjepetP Offline
    PetjepetP Offline
    Petjepet
    wrote on last edited by
    #1

    Hi,

    I'm a bit confused on the temperatures my DST is sending.

    send: 0-0-0-0 s=255,c=3,t=15,pt=2,l=2,sg=0,st=ok:0
    send: 0-0-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,st=ok:1.5.3
    send: 0-0-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0
    sensor started, id=0, parent=0, distance=0
    send: 0-0-0-0 s=255,c=3,t=11,pt=0,l=18,sg=0,st=ok:Temperature Sensor
    send: 0-0-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=ok:1.1
    send: 0-0-0-0 s=0,c=0,t=6,pt=0,l=0,sg=0,st=ok:
    send: 0-0-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:75.8
    send: 0-0-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:73.7
    send: 0-0-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:72.8
    send: 0-0-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:72.1
    send: 0-0-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:71.7
    

    I used the standard sketch where I see this 'boolean metric' setting (I guess for arranging this):

    float lastTemperature[MAX_ATTACHED_DS18B20];
    int numSensors=0;
    boolean receivedConfig = false;
    boolean metric = true; 
    // Initialize temperature message
    MyMessage msg(0,V_TEMP);
    

    My Pimatic shows the temp as 70 C.
    I think it is a Fahrenheit vs Celsius mix-up since 70 F is about 21 C which would be correct.

    1 Reply Last reply
    0
    • sundberg84S Offline
      sundberg84S Offline
      sundberg84
      Hardware Contributor
      wrote on last edited by
      #2

      If i read the log correctly: send: 0-0-0-0 s=0,c=0,t=6,pt=0,l=0,sg=0,st=ok: is a request for Metric/Farenheit but the controller does not seem to respond.

      You should have something like:

      read: 0-0-2 s=255,c=3,t=6,pt=0,l=1,sg=0:M
      

      Controller: Proxmox VM - Home Assistant
      MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
      MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
      RFLink GW - Arduino Mega + RFLink Shield, 433mhz

      1 Reply Last reply
      0
      • PetjepetP Offline
        PetjepetP Offline
        Petjepet
        wrote on last edited by
        #3

        Strange. I can not see what goes wrong.

        I updated the sketch to just use Celsius.

        Replace this (for the Temperature sketch) from:

         float temperature = static_cast<float(static_cast<int((gw.getConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.;
        

        With this

         float temperature = static_cast<float>(static_cast<int>((sensors.getTempCByIndex(i)) * 10.)) / 10.;
        

        Related to this topic and the fact I used CodeBender I guess somewhere there is the problem.

        The IsMetric function doesn't seem to work.

        1 Reply Last reply
        0
        • PetjepetP Offline
          PetjepetP Offline
          Petjepet
          wrote on last edited by
          #4

          I tried again to get it to work with the original sketch.

          1. send: 0-0-0-0 s=255,c=3,t=15,pt=2,l=2,sg=0,st=ok:0
          2. send: 0-0-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,st=ok:1.5.3
          3. send: 0-0-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0
          4. sensor started, id=0, parent=0, distance=0
          5. send: 0-0-0-0 s=255,c=3,t=11,pt=0,l=18,sg=0,st=ok:Temperature Sensor
          6. send: 0-0-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=ok:1.1
          7. send: 0-0-0-0 s=0,c=0,t=6,pt=0,l=0,sg=0,st=ok:
          8. send: 0-0-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:66.6
          

          Should the M appear in line 7?
          What is deciding in going for Imperial or Metric?
          Can anyone help me out?

          1 Reply Last reply
          0
          • hekH Offline
            hekH Offline
            hek
            Admin
            wrote on last edited by
            #5

            You should get a in INTERNAL/I_CONFIG message from controller. With a payload of "M".

            Line 7 is the presentation message from your sensor (c=0=PRESENT).

            I cannot see any incoming traffic from your gateway.. Do you have some kind of communication problems? You should have a look in the gateway log.

            PetjepetP 1 Reply Last reply
            0
            • PetjepetP Offline
              PetjepetP Offline
              Petjepet
              wrote on last edited by
              #6

              Line 8 is giving the temperature and will keep doing this.
              It is also accepted by my controller (Pimatic on a RasPi) and therefore I did not think of a communication problem.

              Where can I find this gateway log?
              I'm pretty new to this so still learning :smiley:

              1 Reply Last reply
              0
              • hekH Offline
                hekH Offline
                hek
                Admin
                wrote on last edited by
                #7

                You might wanna check with the Pimatic plugin developer here (in the Pimatic sub forum) or in the Pimatics community.

                1 Reply Last reply
                0
                • hekH hek

                  You should get a in INTERNAL/I_CONFIG message from controller. With a payload of "M".

                  Line 7 is the presentation message from your sensor (c=0=PRESENT).

                  I cannot see any incoming traffic from your gateway.. Do you have some kind of communication problems? You should have a look in the gateway log.

                  PetjepetP Offline
                  PetjepetP Offline
                  Petjepet
                  wrote on last edited by Petjepet
                  #8

                  @hek said:

                  You should have a look in the gateway log.

                  Is this the gateway log?

                  debug [pimatic-mysensors]: <- MySensorDST  { sender: 0, sensor: 0, type: 0, value: '72.2' }
                  
                  15:47:17
                  debug [pimatic-mysensors]: <- I_LOG_MESSAGE  0;0;3;0;9;read: 0-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0:72.2
                  
                  15:45:02
                  debug [pimatic-mysensors]: <- MySensorDST  { sender: 0, sensor: 0, type: 0, value: '72.1' }
                  
                  15:45:02
                  debug [pimatic-mysensors]: <- I_LOG_MESSAGE  0;0;3;0;9;read: 0-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0:72.1
                  
                  15:45:01
                  debug [pimatic-mysensors]: <- Presented Node  [ '0', '0', '0', '0', '6', '' ]
                  
                  15:45:01
                  debug [pimatic-mysensors]: <- I_LOG_MESSAGE  0;0;3;0;9;read: 0-0-0 s=0,c=0,t=6,pt=0,l=0,sg=0:
                  
                  15:45:01
                  debug [pimatic-mysensors]: <- I_LOG_MESSAGE  0;0;3;0;9;read: 0-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0:1.1
                  
                  15:45:01
                  debug [pimatic-mysensors]: <- I_LOG_MESSAGE  0;0;3;0;9;read: 0-0-0 s=255,c=3,t=11,pt=0,l=18,sg=0:Temperature Senso
                  
                  15:44:59
                  debug [pimatic-mysensors]: <- I_LOG_MESSAGE  0;0;3;0;9;read: 0-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0:0
                  
                  15:44:59
                  debug [pimatic-mysensors]: <- Presented Node  [ '0', '255', '0', '0', '17', '1.5.3' ]
                  
                  15:44:59
                  debug [pimatic-mysensors]: <- I_LOG_MESSAGE  0;0;3;0;9;read: 0-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0:1.5.3
                  
                  15:44:59
                  debug [pimatic-mysensors]: <- I_LOG_MESSAGE  0;0;3;0;9;read: 0-0-0 s=255,c=3,t=15,pt=2,l=2,sg=0:0
                  
                  15:44:53
                  debug [pimatic-mysensors]: <- I_LOG_MESSAGE  0;0;3;0;9;read: 0-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0:0
                  
                  15:44:53
                  debug [pimatic-mysensors]: <- Presented Node  [ '0', '255', '0', '0', '17', '1.5.3' ]
                  
                  15:44:53
                  debug [pimatic-mysensors]: <- I_LOG_MESSAGE  0;0;3;0;9;read: 0-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0:1.5.3
                  
                  15:44:53
                  debug [pimatic-mysensors]: <- I_LOG_MESSAGE  0;0;3;0;9;read: 0-0-0 s=255,c=3,t=15,pt=2,l=2,sg=0:0'
                  

                  I do not see a INTERNAL/I_CONFIG message.

                  1 Reply Last reply
                  0
                  • PetjepetP Offline
                    PetjepetP Offline
                    Petjepet
                    wrote on last edited by
                    #9

                    Got it working now :smiley:

                    I installed Arduino software and mysensors api again.
                    Reloaded my gateway from this install.
                    On the node ran the EEPROM sketch from mysensors library and reloaded the DST sketch from also the mysensors library.

                    I think something went wrong in library updated Arduino suggested.

                    @hek Is it essential to work from the mysensors library (as distributed in the api) and keep that as a stable set and ignoring library updated suggested by the Arduino software?
                    And when updating libraries they will updated in a My Documents folder causing Arduino software to generate issues on compiling of having libraries twice. What is the way to work on this?

                    1 Reply Last reply
                    0
                    • hekH Offline
                      hekH Offline
                      hek
                      Admin
                      wrote on last edited by
                      #10

                      @Petjepet said:

                      Is it essential to work from the mysensors library (as distributed in the api) and keep that as a stable set and ignoring library updated suggested by the Arduino software?

                      You got a bigger chance of getting help if you keep the versions in the distribution.
                      But it's not optimal in any way. Would've been nice if the IDE would have some sort package manager like Node where version could be specifed.

                      1 Reply Last reply
                      0
                      • PetjepetP Offline
                        PetjepetP Offline
                        Petjepet
                        wrote on last edited by
                        #11

                        I agree.
                        It is very hard/difficult to keep a consistent set of libraries operational in a broader scope of elements to be managed.

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


                        25

                        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