Set of nodes for HAPCAN (home automation project based on CAN bus).
The node.js package that brings HAPCAN Home Automation Project support in node-red.
Nodes are using the Hapcan ethernet module to communicate between Hapcan bus and node-red.
- Hapcan based infrastructure
- Hapcan ethernet module
New in version 1.5
Custom input and custom output nodes, which can handle each Hapcan message. Now it is easy to use devices which hasn't its own control nodes, including Your own custom messages and devices (based on Hapcanuino project for example).
There is a one, possibly breaking change, with
hapcanFrame property emitted with each the input nodes. It was emitted as an integer hex number, but in fact, it wasn't hex. For example, a value of
302 which look like a Hapcan hex frame number it's in fact falue of
770 in decimal system. So if you wan't compare new
hapcanFrame with string
'303' You have to make some computations first. This change/fix is due to problem with other frames hex representation such as
0x10B etc as an integer number using just digits.
Using NODE-RED installer
Just open Manage palette from node-red dashboard menu, switch to Install tab and search for hapcan word. Only stable releases.
Only stable releases
npm install node-red-contrib-hapcan
Latest available version - working in most cases.
git clone https://github.com/Onixarts/node-red-contrib-hapcan
What You get in the package?
Package contains multiple input and output nodes for different Hapcan modules. You don't need to know any Hapcan's messages to make it work. Each node uses special (hidden) gateway node to communicate with Hapcan system. UNIV3 and UNIV1 modules support included.
Currently available nodes:
- Blind input receives messages from blind controller
- Blind output allows controlling the blind controller
- Button input receives messages from button modules
- IR input receive infrared sensor messages from Infrared receiver and transmitter
- Relay input receives messages from relay modules
- Relay output allows controlling the relay modules
- RGB input receives messages from RGB LED controller module
- RGB output allows controlling RGB LED controller module
- RTC input receives time messages from ethernet module
- RTC output allows set time and date for ethernet module
- State output helps request Hapcan modules status informations
- Temp input receives temperature messages from button modules
- Thermostat input receives thermostat messages from button modules
- Custom input receives any Hapcan's frame data from any module (custom modules included).
- Custom output sends any configured (static) and dynamic (payload) message to Hapcan's bus.
Simply drag any Hapcan node and double click to open edit mode. First, You need to configure gateway. You need to do it only once. Any other node will use this gateway.
Each node has help provided, so You can read about parameters and its possibilities.
You can configure each input node to receive data from selected node, but You can also filter the messages if this node has many inputs (for example 14 buttons module).
Input nodes produces json object payload that contains simply to understand Hapcan message values that You can use in Your flow. There are also userField value available, so it is possible to output custom defined value on each input state.
Output nodes delivers default action, that You can choose for the selected Hapcan module (for example toggle action in relay output), so any payload received by this node will trigger the default action. You can also control Hapcan module by passing more detailed payload with topic set to control value. Details are available in the help panel for each node.
You can control the nodes by payload in many ways. For example, let's consider relay output. You can pass string value with "ON", "Off", "Toggle" text (case insensitive) to switch channel selected in node configuration. You can also pass number 0,1,2 (Hapcan module compatible values). You can also pass bool value of true or false, to enable or disable relay - in this case the possible actions are limited to ON and OFF. Finally, you can pass object (JSON) where You have full control over node - You can override default settings in configuration then.
Example of RGB output node configuration - it contains each control frame fields for simple use.
Thera are also Custom input and output nodes which allows You to send and receive any messages to and from the bus. You can name each data byte as You want. It also has a preset menu, with common Hapcan's messages frames, ready to be used.