node-red-contrib-blindcontroller 4.3.0

A collection of Node-RED nodes that can be used to automate the control of household roller blinds based on the current position of the sun.

npm install node-red-contrib-blindcontroller

npm version

A collection of Node-RED nodes that can be used to automate the control of household roller blinds based on the current position of the sun.

Install

Run the following command in the root directory of your Node-RED install

npm install node-red-contrib-blindcontroller

node-red-contrib-blindcontroller is compatible with node-red-contrib-sunpos.

Blind Controller

This node calculates the appropriate blind position to restrict or maximise direct sunlight through the associated window.

It is configured with the following properties:

  • channel: identifier of the blind - which is used in the emitted msg.payload
  • mode: mode of control
    • Summer: constrains the extent to which direct sunlight is allowed to enter the room
    • Winter: maximises the amount of direct sunlight allowed to enter the room
  • orientation: the bearing representing the perpendicular to the of the window
  • negative offset: (optional) anti-clockwise offset from orientation for determination of whether the sun is coming through window
  • positive offset: (optional) clockwise offset from orientation for determination of whether the sun is coming through window
  • top: measurement from the floor to top of the window covered by the blind
  • bottom: measurement from the floor to bottom of the window covered by the blind
  • depth: (optional) the extent to which direct sunlight is to be allowed into the room through the window, defined as a length on the floor. (Only relevant in Summer mode.)
  • altitude threshold: (optional) minimum altitude of the sun for determination of blind position
  • increment: the degree to which the blind position can be controlled
  • max open: (optional) the maximum extent the blind is allowed to be opened during daylight hours. Defaults to 0.
  • max closed: (optional) the maximum extent the blind is allowed to be closed during daylight hours. Defaults to 100.
  • temperature threshold: (optional) temperature at which the blind will be fully closed while the sun is in the window. This setting overrides altitudethreshold and depth in the calculation
  • clouds threshold: (optional) maximum percentage of sky occluded by clouds for the calculation to be performed
  • night position: (optional) the position of the blind outside of daylight hours. Defaults to 100.
  • expiry period: (optional) the duration in hours a manual setting will remain is place. Default to 2.

The calculation requires the output of the Sun Position Node. This can be supplemented with current weather conditions, such as that from forecastio or weather underground. msg.topic should be set to weather, and msg.payload either or both of the following properties:

  • maxtemp: the forecasted maximum temperature for the day;
  • clouds: A numerical value between 0 and 1 (inclusive) representing the percentage of sky occluded by clouds. A value of 0 corresponds to clear sky, 0.4 to scattered clouds, 0.75 to broken cloud cover, and 1 to completely overcast skies.

In Summer mode, the node calculates the appropriate blind position to restrict the amount of direct sunlight entering the room. This calculation includes:

  • determination of whether direct sunlight is entering the room based on the orientation of the blind and the azimuth of the sun - taking into account the negative and positive offset properties; and sunInWindow
  • dimensions of the window and the current altitude of the sun. sunInRoom
  • consideration of weather conditions against defined thresholds

In Winter mode, the node calculates the appropriate blind position to maximise the amount of direct sunlight entering the room. This calculation is based on whether direct sunlight is entering the room based on the orientation of the blind and the azimuth of the sun - taking into account the negative and positive offset properties. When the sun is in the window the blind will positioned in the max open setting, otherwise it will be positioned in the max closed setting. In overcast conditions the blind will be positioned in the max closed setting.

In the event the node determines a blind position change is required, it will emit a msg.payload with the properties of the blind including:

  • blindPosition: the new position of the blind
  • blindPositionReasonCode: code of rationale of the new position
    • 01 - Manually set
    • 02 - Sun below horizon
    • 03 - Sun below altitude threshold
    • 04 - Sun not in window
    • 05 - Sun in window
    • 06 - Overcast conditions
    • 07 - Temperature forecast above threshold
  • blindPositionReasonDesc: description of rationale of the new position (as above)

In addition, msg.data includes information useful for monitoring:

  • altitude: altitude of the sun in degrees
  • azimuth: azimuth of the sun in degrees
  • sunInWindow: boolean value indicating whether direct sunlight is entering the room based on the orientation of the blind and the azimuth of the sun - taking into account the negative and positive offset properties

msg.topic is set to "blind".

The node also supports manual overrides by processing messages with msg.topic set to blindPosition, and msg.payload containing the following properties:

  • channel: the channel of the blind
  • blindPosition: the new position of the blind

The node also reports its status within the Node-RED flow editor:

  • colour indicates whether it is currently considered daylight hours;
  • shape indicates whether the blind is fully closed or not;
  • text reports current blind position.

Multi Blind Controller

This node calculates the appropriate blind position to restrict direct sunlight through a number of windows. This node processes three types of input messages:

  • blind configuration where msg.topic equals blind, and msg.payload contains the following properties:
    • channel
    • mode
    • orientation
    • noffset (optional)
    • poffset (optional)
    • top
    • bottom
    • depth
    • altitudethreshold (optional)
    • increment
    • max open (optional)
    • max closed (optional)
    • temperaturethreshold (optional)
    • cloudsthreshold (optional)
    • night position (optional)
    • expiry period (optional)
  • the output of the Sun Position Node;
  • current weather conditions, such as that from forecastio or weather underground. msg.topic should be set to weather, and msg.payload either or both of the following properties:
    • maxtemp
    • clouds
  • a specified blind position, which will remain in effect for the expiry period
    • channel
    • blindPosition

When processing either a Sun Position or Weather message, the blind position calculation is performed for each blind for which a configuration message has previously been received. Emitted messages from this node have the same properties as those emitted from the Blind Controller node.

This node does not report status within the Node-RED flow editor.

Sample Flow

The figure below represents a sample flow of Blind Controller node can be used to control 6 Qmotion blinds at the one geo location. The flow is initiated by an Injector node configured to run periodically.

Blind Controller Screenshot

The figure below represents a sample flow using the Multi Blind Controller node for the same use case, where the blind configuration is stored in a Cloudant database.

Multi Blind Controller Screenshot

Node Info

Version: 4.3.0
Updated 7 months, 1 week ago
License: Apache-2.0

Downloads

0 in the last day
44 in the last week
150 in the last month

Nodes

  • blindcontroller
  • multiblindcontroller

Keywords

  • node-red
  • suncalc
  • home+automation
  • qmotion

Maintainers

  • alisdairjsmyth