# How to use Low Byte Temp for VMB1TS?

**URL:** <https://forum.velbus.eu/t/how-to-use-low-byte-temp-for-vmb1ts/8078>\
**Category:** For developers\
**Created:** [December 1, 2013, 8:15pm UTC](https://forum.velbus.eu/t/how-to-use-low-byte-temp-for-vmb1ts/8078 "2013-12-01T20:15:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Golfy](https://forum.velbus.eu/user_avatar/forum.velbus.eu/golfy/32/4985_2.png) [@Golfy](https://forum.velbus.eu/u/Golfy)\
**Post date:** [December 1, 2013, 8:15pm UTC](https://forum.velbus.eu/t/how-to-use-low-byte-temp-for-vmb1ts/8078/1 "2013-12-01T20:15:26Z")

</div>

I know how to find temperature by dividing High Byte by two (-63 to 63°C with step 0.5)  
I would to know how to use Low Byte (4 bits at left) : 0.0625° x Value… but should I add it to first Value (High byte) ???

Thanks  
David

---

<div class="post-metadata">

**Author:** ![VEL448](https://forum.velbus.eu/user_avatar/forum.velbus.eu/vel448/32/4186_2.png) [@VEL448](https://forum.velbus.eu/u/VEL448)\
**Post date:** [December 2, 2013, 3:28pm UTC](https://forum.velbus.eu/t/how-to-use-low-byte-temp-for-vmb1ts/8078/2 "2013-12-02T15:28:36Z")

</div>

Forget the low byte

If you receive command E6, take the first data byte after the command and run it through this code:

```auto
function ParseTemperature(Value: Byte): Double;
begin
  Result := Value;

  if Result >= $80 then
    Result := ($FF - Result + 1) * -1;

  Result := Result / 2;
end;
```

Numbers prefixed by the dollar sign “$” are hexadecimal numbers.

The “Result \> $80” condition is for negative temperatures

Temperature precision is 0.5°C

---

<div class="post-metadata">

**Author:** ![Golfy](https://forum.velbus.eu/user_avatar/forum.velbus.eu/golfy/32/4985_2.png) [@Golfy](https://forum.velbus.eu/u/Golfy)\
**Post date:** [July 29, 2023, 4:41pm UTC](https://forum.velbus.eu/t/how-to-use-low-byte-temp-for-vmb1ts/8078/3 "2023-07-29T16:41:18Z")

</div>

After many tests and some help, here is a JavaScript code, to calculate temperature with decimal :

```auto
// Function to calculate temperature with high precision
function TempCurrentCalculation(msg) {
	// E6 (Transmit Temp) or EA (Sensor status)
	switch (msg[4]) {
		case 0xE6:
			return msg[5] / 2 - Math.round(((4 - msg[6]) >> 5) * 0.0625 * 10) / 10
		case 0xEA:
			return msg[8] / 2 - Math.round(((4 - msg[9]) >> 5) * 0.0625 * 10) / 10
		default:
			console.error("ERROR with TempCalculation", msg)
			return undefined
	}
}

```

Hope this will help other coders.
