# DCF time form KNX to adjust time in Node Red

**URL:** <https://discourse.nodered.org/t/dcf-time-form-knx-to-adjust-time-in-node-red/66419>\
**Category:** General\
**Created:** [14 August 2022 11:52 UTC](https://discourse.nodered.org/t/dcf-time-form-knx-to-adjust-time-in-node-red/66419 "2022-08-14T11:52:44Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nilpferd](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@Nilpferd](https://discourse.nodered.org/u/Nilpferd)\
**Post date:** [14 August 2022 11:52 UTC](https://discourse.nodered.org/t/dcf-time-form-knx-to-adjust-time-in-node-red/66419/1 "2022-08-14T11:52:45Z")

</div>

In KNX I get the date/time from a DCF Receiver . This date/time I want to use in Node Red to adjust both sysem to exactly the same time.  
How to impement the time in the Node Red system time?

Erwin

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [14 August 2022 12:12 UTC](https://discourse.nodered.org/t/dcf-time-form-knx-to-adjust-time-in-node-red/66419/2 "2022-08-14T12:12:42Z")

</div>

What hardware is Node-Red running on?

And what precision do you require for "exactly the same time"?

---

<div class="post-metadata">

**Author:** ![Nilpferd](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@Nilpferd](https://discourse.nodered.org/u/Nilpferd)\
**Post date:** [15 August 2022 06:51 UTC](https://discourse.nodered.org/t/dcf-time-form-knx-to-adjust-time-in-node-red/66419/3 "2022-08-15T06:51:15Z")

</div>

the hardware is a Raspi 3B. The reason for the exact same time: Node Red switches some minutes delayed to the KNX switch. So i never know if the nodes are working or not. That is boring.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 August 2022 08:13 UTC](https://discourse.nodered.org/t/dcf-time-form-knx-to-adjust-time-in-node-red/66419/4 "2022-08-15T08:13:32Z")

</div>

Is the pi connected to the internet?  
Which device has the wrong time?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 August 2022 08:42 UTC](https://discourse.nodered.org/t/dcf-time-form-knx-to-adjust-time-in-node-red/66419/5 "2022-08-15T08:42:01Z")

</div>

> [@Nilpferd](#):
>
> Node Red switches some minutes delayed to the KNX switch

Can you clarify exactly what you mean by that?

---

<div class="post-metadata">

**Author:** ![Nilpferd](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@Nilpferd](https://discourse.nodered.org/u/Nilpferd)\
**Post date:** [15 August 2022 15:22 UTC](https://discourse.nodered.org/t/dcf-time-form-knx-to-adjust-time-in-node-red/66419/6 "2022-08-15T15:22:02Z")

</div>

The PI switches the nodes some minutes after KNX when the same time is fixed in both system.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 August 2022 15:28 UTC](https://discourse.nodered.org/t/dcf-time-form-knx-to-adjust-time-in-node-red/66419/7 "2022-08-15T15:28:39Z")

</div>

> [@Nilpferd](#):
>
> same time is fixed in both system

Do you mean that when you look at the system time in the two systems they show the same time? If they are different then which one is correct?

If you don't mean that then explain what you mean and explain how the you have setup the pi to switch and how you have setup the KNX to switch.

Please try and explain exactly what is happening so we can understand.

---

<div class="post-metadata">

**Author:** ![Nilpferd](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@Nilpferd](https://discourse.nodered.org/u/Nilpferd)\
**Post date:** [16 August 2022 10:05 UTC](https://discourse.nodered.org/t/dcf-time-form-knx-to-adjust-time-in-node-red/66419/8 "2022-08-16T10:05:33Z")

</div>

an example:  
KNX turn of the a certain appliance at i.e. 10 hrs, also the node red shall switch on this appliance also at 10 hrs to another status (i.e. room heating standy to night). but in reality node red switches on at 10:03 (accordingly to knx time) but 10:00 to node red time.  
I now want to adjust node red (raspi) time to knx time.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [16 August 2022 10:40 UTC](https://discourse.nodered.org/t/dcf-time-form-knx-to-adjust-time-in-node-red/66419/9 "2022-08-16T10:40:55Z")

</div>

> [@Nilpferd](#):
>
> in reality node red switches on at 10:03 (accordingly to knx time) but 10:00 to node red time.

So your devices are adrift by roughly 3 minutes. That suggests one of them has a problem acquiring an accurate time.

> [@Nilpferd](#):
>
> In KNX I get the date/time from a DCF Receiver

**Have you checked that this device is successfully setting the system time?**

A Raspberry Pi has no real time clock, so it has to connect to the internet to access an NTP server.  
**As Colin asked you, is the Pi connected to the internet?**

Can you **show us the part of your Node-red flow which switches this appliance on** at 10:00 / 10:03?

Can you give us a bit more info about your set up: what is this "appliance" and **why do you switch it on with both KNX and Node-red?**

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [16 August 2022 10:43 UTC](https://discourse.nodered.org/t/dcf-time-form-knx-to-adjust-time-in-node-red/66419/10 "2022-08-16T10:43:54Z")

</div>

Also answer the question, if the two system times are different, which one is wrong?

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [16 August 2022 10:53 UTC](https://discourse.nodered.org/t/dcf-time-form-knx-to-adjust-time-in-node-red/66419/11 "2022-08-16T10:53:14Z")

</div>

> [@Nilpferd](#):
>
> I now want to adjust node red (raspi) time to knx time.

Perhaps you can run an ntp server on your KNX system?  
I have no idea if that is possible but it seems a reasonable extension to a DCF time sync setup.

If so, you could configure the Raspberry Pi to obtain time from it.  
That would be at the operating system level, not in Node-red.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [17 August 2022 09:44 UTC](https://discourse.nodered.org/t/dcf-time-form-knx-to-adjust-time-in-node-red/66419/12 "2022-08-17T09:44:37Z")

</div>

If the pi is not connected to the internet, so will not be automatically syncing its time, and you only need approximate syncing (ie within seconds rather than milliseconds) then you could just call the linux `date` command in an exec node.

---

<div class="post-metadata">

**Author:** ![Nilpferd](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@Nilpferd](https://discourse.nodered.org/u/Nilpferd)\
**Post date:** [18 August 2022 09:04 UTC](https://discourse.nodered.org/t/dcf-time-form-knx-to-adjust-time-in-node-red/66419/13 "2022-08-18T09:04:01Z")

</div>

thanks. thats working.  
regards Erwin

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [17 October 2022 09:04 UTC](https://discourse.nodered.org/t/dcf-time-form-knx-to-adjust-time-in-node-red/66419/14 "2022-10-17T09:04:56Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
