Access the homee api with node-red and create virtual devices for homee.
cd ~/.node-red
npm install node-red-contrib-homee
This plugin provides three nodes (and two configuration nodes). The homeeApi node is used to address the API of an existing homee. With the homeeDevice node you can create virtual devices for your homee. The homeeLog node is used to query the logfile from your homee.
When the connection is successfully established, all messages from homee, e.g. status updates and user interactions, are passed on to the payload.
homee accepts various messages in a particular format. Send the message as payload to the homee node. Below are a few examples of common messages.
GET:nodes
GET:homeegrams
GET:groups
GET:relationships
First a virtualHomee-node (like an virtual homee) must be configured. Afterwards any device that homee knows can be created. The devices can then be taught-in using the homee in homee function. Every homeeDevice-node provides one input and one output.
You can change attribute values by sending a JSON object as payload to the
homeeDevice-node. The example sets the attribute with the ID 10
to the value 1
.
{
"attribute": {
"id": 10,
"value": 1
}
}
Hint: The old syntax {"id": 10, "value": 1}
still works but is deprecated and will be removed in one of the next versions.
It's also possible to update the state of the node. The following example sets the state of the virtual device to unavailable.
{ "state": 2 }
Every attribute change from homee sends a json payload to the output of the node.
{ "attributeId": 10, "targetValue": 0 }
The homeean project provides a collection of sample flows, including fully-configured virtualDevice-node
's that can serve as a starting point for your own flows.
Each virtualDevice-node
needs a specific profile
value and each of the node's attributes a type
. Known values can be found in the homee-api project's enum.js
.
By default, Node-RED does not save changes to nodes that are executed in the background. This includes changes to the current value of an attribute.
With version 0.5.0 an optional storage possibility of attribute values is introduced.
In order to use the storage option, the local file storage must be enabled in settings.js
.
contextStorage: {
default: {
module: "memory",
},
homeeStore: {
module: "localfilesystem",
}
},
Send any message to the homeeLog node to start querying the log file. Since the log file can only be queried as a whole, the query will take a few seconds.
The output format can be selected in the settings. In addition to the output of the raw log data, the log file can be transformed to an array or a collection. The selection can be overwritten with msg.output
. Valid values are raw
, array
and collection
.
This plugin is not an official plugin. The homee device simulation is based on the work of @tobiasgraf and his homeejs and would not have been possible without him.