Supergiovane / node-red-contrib-knx-ultimate

Control your KNX intallation via Node-Red! A bunch of KNX nodes, with integrated Philips HUE control and ETS group address importer.
https://youtu.be/egRbR_KwP9I
MIT License
147 stars 34 forks source link

Temperature Payload Rounding Issue: 0.29C Sent as 0.28C on KNX Bus #377

Open SBliveNL opened 1 week ago

SBliveNL commented 1 week ago

Hello Massimo Saccani,

Describe the bug I am experiencing an issue with the node-red-contrib-knx-ultimate node when trying to send a temperature value of 0.29°C to the KNX bus. The value is automatically rounded to 0.28°C, and it immediately jumps between 0.28°C and 0.30°C, making it impossible to accurately transmit the temperature value of 0.29°C.

To Reproduce

  1. Deploy node-red-contrib-knx-ultimate (version 3.2.7) on a fully updated Raspberry Pi.
  2. Send a payload of 0.29 (temperature) to the KNX bus.
  3. Monitor the KNX bus and observe the transmitted value.
  4. Notice how the value is rounded to 0.28°C or jumps between 0.28°C and 0.30°C.

Expected behavior I expect the temperature value of 0.29°C to be transmitted to the KNX bus accurately without rounding or jumping between other values.

Screenshots Unfortunately, I don't have screenshots available, but the issue can be consistently reproduced by sending the payload 0.29.

Knx-Ultimate Version Version 3.2.7 (latest at the time of writing), but the issue is also present in earlier versions.

Are you running node-red behind homematic, docker or anything similar? Node-Red is running standalone on a fully updated Raspberry Pi.

Additional context This behavior occurs regardless of other configurations, and the rounding of values seems to be an internal issue with how the payload is processed before being sent to the KNX bus.

Supergiovane commented 1 week ago

Hi what DPT are you using ?

SBliveNL commented 1 week ago

Hi Massimo, DPT 9.001 Temperature

Supergiovane commented 1 week ago

Hi I've no issue with DPT9.001. Are you sure not having some actuator sending out a rounded value to the BUS?

Node-RED___Flow_1
SBliveNL commented 1 week ago

Sorry, I meant from Node-RED to KNX. Schermafbeelding 2024-09-25 140938

Supergiovane commented 1 week ago

Hi Float 16 is used as half precision. I've landed on that in the past.... not sure how i handled that, but there was a precision issue with float 16 in javascript... I'll try to find the referenced issue in the closed issues...