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
141 stars 34 forks source link

KNX Device node TimeofDay datatype #348

Closed ChristBE closed 3 months ago

ChristBE commented 3 months ago

Hello, Thanks for making this very nice node red Palette

Describe the bug I am using a date() object to set a device node to send a Timeofday datatype, but if I look at the Knx-viewer I get a error or knx Date datatype being send with wrong values

To Reproduce Write here the steps to reproduce the behavior, for example:

  1. add a inject node to send a timestamp
  2. add a function node (time) onmessage: return {payload:new Date()}; or (payload:new Date().toTimeString());
  3. add a knx device node with datapoint 10.001 Time of day
  4. deploy and trigger inject node
  5. See error UNKNOWN: ERROR dptlib.fromBuffer:Error: Error converting date buffer to Date object. at Object.exports.fromBuffer (/data/node_modules/node-red-contrib-knx-ultimate/KNXEngine/src/dptlib/dpt11.js:60:13) at Object.dpts.fromBuffer (/data/node_modules/node-red-contrib-knx-ultimate/KNXEngine/src/dptlib/index.js:133:17) at buildInputMessage (/data/node_modules/node-red-contrib-knx-ultimate/nodes/knxUltimate-config.js:1506:30) at /data/node_modules/node-red-contrib-knx-ultimate/nodes/knxUltimate-config.js:920:29 at Array.forEach () at KNXClient.handleBusEvents (/data/node_modules/node-red-contrib-knx-ultimate/nodes/knxUltimate-config.js:819:14) at KNXClient.emit (node:events:513:28) at KNXClient.write (/data/node_modules/node-red-contrib-knx-ultimate/KNXEngine/src/KNXClient.js:348:54) at Timeout.handleTelegramQueue [as _onTimeout] (/data/node_modules/node-red-contrib-knx-ultimate/nodes/knxUltimate-config.js:1352:32) at listOnTimeout (node:internal/timers:559:17)

Expected behavior device node should send a 10.001 time of day value

image .

Knx-Ultimate Version

Are you running node-red behind homematic, docker or anything similar?

Supergiovane commented 3 months ago

Hi please see here https://github.com/Supergiovane/node-red-contrib-knx-ultimate/wiki/-Sample---DateTime-to-BUS

ChristBE commented 3 months ago

Thanks for the very quick reply.

The sample code is what I started with see flow DT_flows.json

this is what I see in Knxviewer as you timeofday 10.001 datatype shows as date 11.001 for 4/0/1 image

Supergiovane commented 3 months ago

Hi Christ. you're right. I'll fix in the upcoming release. Thank you!!

Supergiovane commented 3 months ago

Hi do you have imported the ETS group address list? If yes, you should see the right values.

ChristBE commented 3 months ago

Yes it work with imported group address list [image: image.png]

Thank again for your quick response

On Tue, 16 Apr 2024 at 14:12, Massimo Saccani @.***> wrote:

Hi do you have imported the ETS group address list? If yes, you should see the right values.

— Reply to this email directly, view it on GitHub https://github.com/Supergiovane/node-red-contrib-knx-ultimate/issues/348#issuecomment-2058942592, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJIICGFQ4DQ4JILSDJIG2LY5UISRAVCNFSM6AAAAABGJAGA6WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJYHE2DENJZGI . You are receiving this because you authored the thread.Message ID: @.*** com>