the old NTP binding could be configured to automatically send time updates to KNX using:
DateTime Date "Date and Time: [%1$tA, %1$td.%1$tm.%1$tY %1$tT]" (Status) { ntp="Europe/Berlin:de_DE", knx="11.001:15/7/2, 10.001:15/7/1" }
Since there is no KNX2 binding yet and the new clearer concept of thing configuration would not easily permit such a config, how can I achieve the same result in OpenHAB2 using NTP2 and KNX1 bindings?
So far I tried different rule approaches similar to
rule "Time to KNX"
when
Time_Local received update
then
logDebug("toby", Time_Local.state as string)
sendCommand(KNX_Time_Date, Time_Local.state)
end
This puts the time received from NTP onto the date / time knx group adresses. You need to adjust the channel (copy id from paper ui) and group addresses to fit to your needs.
Well, sometimes you just needs someone looking over your shoulder to spot obvious bugs. Thanks! (This did not fix the actual problem but made the rule run at all)
i am returning to OpenHAB2 after a few month - now with Version 2.2 i cant find the channel-ID in the paper-ui, i am sure it was there the in the past? Where do i find it now?
Hi!
With the new KNX2 Binding, you could just do everything in PaperUI:
Create a KNX Dummy Device, add a channel with your Date and Time GA’s (for example 10.001:1/1/1 for Time,and 11.001:2/2/2 for date) and link it to your NTP DateTime item.
NTP Thing and Channel:
Item:
DateTime Date "Datum und Zeit: [%1$tA, %1$td.%1$tm.%1$tY %1$tT]" { channel="ntp:ntp:local:dateTime,knx:device:c52e1fea:knx_date,knx:device:c52e1fea:knx_time" }
thinkerd about this for a long time, but as you see the solution is way to easy
I cannot help you with DateTime on KNX as I am using separate Date and Time GAs on my KNX bus (which are both linked to an DateTime item). For everyone who does that as well, here’s my setup:
Thing:
Thing device knx_virtual "KNX-virtual" {
Type datetime-control : date [ ga="11.001:0/7/11" ]
Type datetime-control : time [ ga="10.001:0/7/10" ]
}
Item:
DateTime Date { ntp="Europe/Berlin:de_DE", channel="knx:device:ip:knx_virtual:date,knx:device:ip:knx_virtual:time" }
I have restarted openhab in hope of that time is pushed to KNX bus when it is received first time- didn’t help.
How often is ntp time pulled from server?
I don’t understand why time is not pushed to KNX bus.
What am I missing?
Swap the ntp and the knx channel in your item definition, knx should be first.
And use the datetime-control. Use DP 10.001 for the time.
This works for me.
I Try this, but allways the Date is not written to the bus (BJ PowerNet)
The other part from, 7.15.240 is what the powernet controller sent, if open send it right i can dissable this.
I try with knx first and ntp first in the items, nothing will be send to 0/0/23, or will this happend only on 0:0 clock ?
items
DateTime Date "Datum und Zeit: [%1$tA, %1$td.%1$tm.%1$tY %1$tT]" { channel="knx:device:ip:knx_virtual:date, knx:device:ip:knx_virtual:time, ntp:ntp:local:dateTime" }
LPDU: BC 10 00 00 16 D4 00 80 92 3A 38 81 :L_Data low from 1.0.0 to 0/0/22 hops: 05 T_DATA_XXX_REQ A_GroupValue_Write 92 3A 38
LPDU: BC 7F F0 00 16 E4 00 80 92 05 00 29 :L_Data low from 7.15.240 to 0/0/22 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write 92 05 00
LPDU: BC 10 00 00 16 D4 00 80 92 05 00 86 :L_Data low from 1.0.0 to 0/0/22 hops: 05 T_DATA_XXX_REQ A_GroupValue_Write 92 05 00
LPDU: BC 10 00 00 16 D4 00 80 92 3B 06 BE :L_Data low from 1.0.0 to 0/0/22 hops: 05 T_DATA_XXX_REQ A_GroupValue_Write 92 3B 06
LPDU: BC 7F F0 00 17 E4 00 80 0E 02 13 A0 :L_Data low from 7.15.240 to 0/0/23 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write 0E 02 13
LPDU: BC 10 00 00 16 D4 00 80 92 3B 38 80 :L_Data low from 1.0.0 to 0/0/22 hops: 05 T_DATA_XXX_REQ A_GroupValue_Write 92 3B 38
LPDU: BC 7F F0 00 16 E4 00 80 92 06 00 2A :L_Data low from 7.15.240 to 0/0/22 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write 92 06 00
LPDU: BC 10 00 00 16 D4 00 80 92 06 00 85 :L_Data low from 1.0.0 to 0/0/22 hops: 05 T_DATA_XXX_REQ A_GroupValue_Write 92 06 00
LPDU: BC 10 00 00 16 D4 00 80 93 00 06 84 :L_Data low from 1.0.0 to 0/0/22 hops: 05 T_DATA_XXX_REQ A_GroupValue_Write 93 00 06
LPDU: BC 7F F0 00 17 E4 00 80 0E 02 13 A0 :L_Data low from 7.15.240 to 0/0/23 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write 0E 02 13
LPDU: BC 10 00 00 16 D4 00 80 93 00 38 BA :L_Data low from 1.0.0 to 0/0/22 hops: 05 T_DATA_XXX_REQ A_GroupValue_Write 93 00 38
LPDU: BC 7F F0 00 16 E4 00 80 92 07 00 2B :L_Data low from 7.15.240 to 0/0/22 hops: 06 T_DATA_XXX_REQ A_GroupValue_Write 92 07 00
LPDU: BC 10 00 00 16 D4 00 80 92 07 00 84 :L_Data low from 1.0.0 to 0/0/22 hops: 05 T_DATA_XXX_REQ A_GroupValue_Write 92 07 00
LPDU: BC 10 00 00 16 D4 00 80 93 01 06 85 :L_Data low from 1.0.0 to 0/0/22 hops: 05 T_DATA_XXX_REQ A_GroupValue_Write 93 01 06
openhab log
2019-02-14 18:58:06.633 [vent.ItemStateChangedEvent] - Date changed from 2019-02-14T18:57:56.827+0100 to 1970-01-01T18:04:00.000+0100
2019-02-14 18:58:06.674 [vent.ItemStateChangedEvent] - Date changed from 1970-01-01T18:04:00.000+0100 to 2019-02-14T18:58:06.653+0100
2019-02-14 18:58:56.856 [vent.ItemStateChangedEvent] - Date changed from 2019-02-14T18:58:06.653+0100 to 2019-02-14T18:58:56.831+0100
2019-02-14 18:59:06.409 [ome.event.ItemCommandEvent] - Item 'Date' received command 1970-01-01T18:05:00.000+0100
2019-02-14 18:59:06.423 [nt.ItemStatePredictedEvent] - Date predicted to become 1970-01-01T18:05:00.000+0100
2019-02-14 18:59:06.451 [vent.ItemStateChangedEvent] - Date changed from 2019-02-14T18:58:56.831+0100 to 1970-01-01T18:05:00.000+0100
2019-02-14 18:59:06.483 [vent.ItemStateChangedEvent] - Date changed from 1970-01-01T18:05:00.000+0100 to 2019-02-14T18:59:06.459+0100
2019-02-14 18:59:56.872 [vent.ItemStateChangedEvent] - Date changed from 2019-02-14T18:59:06.459+0100 to 2019-02-14T18:59:56.842+0100
2019-02-14 19:00:06.301 [ome.event.ItemCommandEvent] - Item 'Date' received command 1970-01-01T18:06:00.000+0100
2019-02-14 19:00:06.322 [nt.ItemStatePredictedEvent] - Date predicted to become 1970-01-01T18:06:00.000+0100
2019-02-14 19:00:06.339 [vent.ItemStateChangedEvent] - Date changed from 2019-02-14T18:59:56.842+0100 to 1970-01-01T18:06:00.000+0100
2019-02-14 19:00:06.372 [vent.ItemStateChangedEvent] - Date changed from 1970-01-01T18:06:00.000+0100 to 2019-02-14T19:00:06.351+0100
2019-02-14 19:00:56.875 [vent.ItemStateChangedEvent] - Date changed from 2019-02-14T19:00:06.351+0100 to 2019-02-14T19:00:56.850+0100
2019-02-14 19:01:06.786 [ome.event.ItemCommandEvent] - Item 'Date' received command 1970-01-01T18:07:00.000+0100
2019-02-14 19:01:06.804 [nt.ItemStatePredictedEvent] - Date predicted to become 1970-01-01T18:07:00.000+0100
2019-02-14 19:01:06.829 [vent.ItemStateChangedEvent] - Date changed from 2019-02-14T19:00:56.850+0100 to 1970-01-01T18:07:00.000+0100
2019-02-14 19:01:06.870 [vent.ItemStateChangedEvent] - Date changed from 1970-01-01T18:07:00.000+0100 to 2019-02-14T19:01:06.840+0100