Configuration Node - jensrossbach/node-red-contrib-chronos GitHub Wiki

The configuration node holds the geographical location in form of latitude and longitude coordinates. That is required for the calculation of times based on sun and moon position. For privacy protection reasons, the coordinates are stored as credentials and therefore are not exported with the flows. If a time zone that differs from the time zone of the Node-RED host is required, this can also be specified. Additionally custom sun positions can be defined in this node. They can be used in the other nodes in a similar way as the predefined sun positions.

General & Location Configuration

Location

Name

The name is optional and can be used to better distinguish different configurations. If omitted, the location coordinates are used as name instead.

Latitude

The latitude denotes the northern or southern distance to the Equator in degrees and is expressed as floating point value between -90° and 90°. When selecting the environment or global context store input, it is also possible to specify the name of an environment or a global context variable containing the latitude. Environment variables are evaluated when the flow is started while global context variables are evaluated at the time when the latitude is used. This means, using global context variables, it is possible to change the latitude on-the-fly (however, some nodes require a trigger to recalculate the time).

Longitude

The longitude denotes the western or eastern distance to the prime meridian near Greenwich, England in degrees and is expressed as floating point value between -180° and 180°. When selecting the environment or global context store input, it is also possible to specify the name of an environment or a global context variable containing the longitude. Environment variables are evaluated when the flow is started while global context variables are evaluated at the time when the longitude is used. This means, using global context variables, it is possible to change the longitude on-the-fly (however, some nodes require a trigger to recalculate the time).

Location Detection

The button on the right side of the coordinate input can be used to automatically detect your position and fill the latitude and longitude fields. It is only visible if your browser supports the geolocation feature. When pressing the button for the first time, you will be asked for allowance of locality determination. If you deny, location cannot be detected. Depending on the browser, your choice might be cached and you won't be asked in future again. If the button does not work, it is likely that you denied the location detection in the past.

Please note that some browsers (e.g., Google Chrome) do not allow locality determination for non secured websites (no HTTPS). So if your connection to the Node-RED editor is not secured, you might not be able to use the button.

Map

The entered coordinates or the coordinates retrieved from environment variables are visualized on a map provided by OpenStreetMap. This helps verifying that the latitude and longitude values are correct.

Time Zone

The name of a valid time zone identifier (keep empty to use the time zone configured on the host which runs Node-RED). When selecting the environment or global context store input, it is also possible to specify the name of an environment or a global context variable containing the time zone. Environment variables are evaluated when the flow is started while global context variables are evaluated at the time when the time zone is used. This means, using global context variables, it is possible to change the time zone on-the-fly (however, some nodes require a trigger to recalculate the time).

[!IMPORTANT] A programmatic calculation of the time zone from the geographical coordinates is not performed! The reason is that this would require a large database to be included in the Node-RED contribution package and a regular update of that database.

Custom Sun Positions

If the predefined sun positions are not sufficient, it is possible to define custom sun positions based on the solar zenith angle.

Custom Sun Positions

New entries can be added to the list using the button at the bottom. Existing entries can be reordered or deleted. Each entry in the list can be configured as follows:

Angle

The solar zenith angle denotes the position of the sun in degrees relative to the horizon and is expressed as floating point value between -90° and 90°. Positive values specify sun positions above the horizon while negative values mean sun positions below the horizon.

Rise Name (🡩)

This field specifies the name of the position for rising sun (i.e., in the morning).

Set Name (🡫)

This field specifies the name of the position for setting sun (i.e., in the evening).

[!NOTE] Names can be composed of letters, digits and underscores and must be unique.