2.0.2 • Published 8 months ago

@redplc/node-red-time v2.0.2

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
8 months ago

@redplc/node-red-time

platform platform

Node-RED nodes for get System-Time or NTP-Time using with redPlc nodes.

Nodes

  • sys-time: Reads System-Time and store in number array.
  • ntp-time: Reads NTP-Time and store in number array.

Usage

  • Install redPlc nodes.
  • For logical operations use redPlc nodes.
  • Data is exchanged with global context variable arrays.
  • The variable is updated cyclically.
  • A very quick query of the NTP server can lead to blocking of the IP.

Time/Date Elements Array-Index

ElementValueIndex
Seconds0 .. 590
Minutes0 .. 591
Hours0 .. 12/232
AM/PM0=AM, 1=PM3
Weekday0 .. 7, 0=Sunday4
Day1 .. 315
Month1 .. 126
YearYYYY7
since epocms8

Example

This example switches on a consumer (e.g. lamp) on days of the week and between hour range. The redPlc module sys-time reads the system time and saves it in the variable IA99. The day of the week is stored in index 4 (0 = sunday, 1 = monday ..) and the hours in index 2. The days of the week are queried with the compare node. After that, the start and end hours are queried with the compare nodes in series. If all queries are fulfilled, the Raspberry Pi output is switched on. Select in module node rpi-gio-out GPIO26 as output.