jncanches / node-red-contrib-blindcontroller-v2

A blind controller for nodered
Apache License 2.0
3 stars 1 forks source link

node-red-contrib-blindcontroller-v2

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

Credits and thanks

This V2 has been created from the excellent node-red-contrib-blindcontroller. All credits go to its author alisdairjsmyth. This project is excellent but missing some little things to be perfect. I'm using Home Assistant and all my automations are in NodeRed.

I'm massively using NodeRed's subflows and the original blindcontroller can just be used once in your flows (because of the way it stores its list of registered blinds). So I updated it to store them in global context of NodeRed.

This way, config become shared between blindcontroller nodes and you can easily factorize your nodes in subflows.

I also updated the code to match the latest recommendations introduced in NodeRed V1 (more details here)

I planned to introduce blindcontroller inputs to set configuation programmatically (like multi blind controller do).

Install

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

npm install node-red-contrib-blindcontroller-v2

node-red-contrib-blindcontroller-v2 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.

Properties

Blind Controller Properties Header

Blind Controller Properties Dimensions

Blind Controller Properties Positions

Blind Controller Properties Thresholds

Blind Controller Properties Manual

Calculation

The calculation requires the output of the Sun Position Node.

By default, position will be computed for all registered blinds. If you want to restrict to one particualr blind, just append msg.payload.channel to Sun or Weather payload.

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:

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

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.

The mode can be changed via a message. msg.topic should be set to mode, and msg.payload with the following property:

Output

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:

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

msg.topic is set to "blind".

Manual Override

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

Manual positions can be forced to expire by processing a message with msg.topic set to blindPositionReset, and msg.payload containing the following properties:

Status

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

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:

When processing either a Sun Position, Weather or Mode 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