node-red-contrib-knx-ultimate
Version:
Control your KNX and KNX Secure intallation via Node-Red! A bunch of KNX nodes, with integrated Philips HUE control, ETS group address importer, KNX AI for diagnosticsand KNX routing between interfaces. Easy to use and highly configurable.
58 lines (41 loc) • 1.59 kB
HTML
<script type="text/markdown" data-help-name="knxUltimateDateTime">
# KNX DATETIME
Use this node to **set the date/time on the KNX bus**.
It can send:
- **DPT 19.001** to a single *DateTime GA* (recommended).
- **DPT 11.001** to a *Date GA* (optional).
- **DPT 10.001** to a *Time GA* (optional).
You can configure one or more group addresses and the node will write to all configured outputs.
Note about **DPT 19.001**:
- the node starts from a JavaScript `Date` and converts it to KNX DateTime via the KNX engine.
## When it sends
- **On deploy/startup** (optional, with delay).
- **Periodic send** (optional).
- **On input message** (always).
- **Editor button** (send-now).
## Input payload
If `msg.payload` is omitted/empty, the node sends the current system time.
Supported payloads:
- `new Date()` (recommended)
- a timestamp number (milliseconds since epoch)
- a string accepted by `new Date("...")`
- `"now"`
- an object with one of these fields:
- `msg.payload.dateTime`
- `msg.payload.timestamp`
- `msg.payload.epoch`
Example:
```js
msg.payload = new Date();
return msg;
```
## Gateway disconnected
If the KNX gateway is disconnected, the send is queued and sent automatically when the connection comes back.
The node keeps **only one pending request** (the latest one).
## Output
The node emits one message per send:
- `msg.payload`: the `Date` that has been written
- `msg.sent`: array of `{ ga, dpt, name }`
- `msg.reason`: `input`, `startup`, `periodic` or `button`
- `msg.knxUltimateDateTime.date`: date/time in ISO format (`toISOString()`)
</script>