TEMPERATURE in celsius?

Discussion in 'C-Gate Developers' started by zx9, Jun 18, 2014.

  1. zx9

    zx9

    Joined:
    Jun 8, 2009
    Messages:
    49
    Likes Received:
    0
    Location:
    Melbourne
    Hi,

    How do I convert the raw temp returned from AIRCON ZONE_TEMPERATURE into celsius?

    Thanks
     
    zx9, Jun 18, 2014
    #1
    1. Advertisements

  2. zx9

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    900
    Likes Received:
    54
    Location:
    Adelaide, Australia
    Temperatures are expressed in units of 1/256 of a degree Celsius. So just convert it to real and divide it by 256.

    It's all described in the Air Conditioning Application protocol document on the CIS web-site.
     
    Ashley, Jun 18, 2014
    #2
    1. Advertisements

  3. zx9

    zx9

    Joined:
    Jun 8, 2009
    Messages:
    49
    Likes Received:
    0
    Location:
    Melbourne
    thanks Ashley, I must be blind as I read that doc twice over looking for the answer.
     
    zx9, Jun 19, 2014
    #3
  4. zx9

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,346
    Likes Received:
    3
    Location:
    Adelaide, South Australia
    If its in 1/256 of a degree, then multiply by 256 (not divide).

    You can probably also imagine a few other fiddles that could be done using a couple of bytes (eg a byte for the part before the decimal point and a byte for the part after).
     
    ashleigh, Jun 20, 2014
    #4
  5. zx9

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    900
    Likes Received:
    54
    Location:
    Adelaide, Australia
    Divide is correct. If the units are 1/256 of a degree, then a value of say 512 is 2 degrees, which is 512 divided by 256.
     
    Ashley, Jun 23, 2014
    #5
  6. zx9

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,346
    Likes Received:
    3
    Location:
    Adelaide, South Australia
    Oops, yes, you are right. Sorry bout that!
     
    ashleigh, Jun 24, 2014
    #6
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.