Hub node
The Hub node is the central component of the DuloNode module. It is responsible for facilitating communication between Node-RED and the Alexa DuloNode Skill.
Hub node output payloads are generated whenever a device’s state changes, regardless of how the change is introduced. This could be through an Alexa voice command, the Alexa app, or an input payload sent to the Hub node.
Properties
To properly set up a working system, you must configure your DuloNode email and password in the node properties. This setup ensures secure communication between your devices and Alexa DuloNode Skill
The properties section also allows you to manage your subscription, providing options to upgrade your plan, modify existing details, or cancel the subscription entirely.
Input
The Hub node can receive input payloads to manually trigger state changes or actions for the connected devices. Input payloads must conform to the expected JSON format for the devices connected to the Hub node.
Output
The Hub node generates a detailed output payload whenever a state change occurs in any connected device. This output helps you track changes and synchronize the state of your hardware devices and virtual Node-RED devices, ensuring accurate application of Alexa commands to physical home automation appliances. The payload provides information about the device, its components, and both the current and previous states.
Payload
Payload output properties:
name
: The name of the devicetype
: The type of the devicecomponents
: A set containing the current state of each component associated with the device.
A detailed list of all components and their properties can be found here.metadata.previous.components
: Contains the previous state of each component before the change occurred, enabling comparison and tracking.id
: A unique identifier for the device.
Example Output
Here is an example of an output payload for the device “Reading lamp” of type light:
{
"name": "Reading lamp",
"type": "light",
"components": {
"PowerController": {
"powerState": "ON"
},
"BrightnessController": {
"brightness": 40
},
"ColorController": {
"color": {
"hue": 0,
"saturation": 0,
"brightness": 1
}
},
"ColorTemperatureController": {
"colorTemperatureInKelvin": 4000
},
"ColorModeController": {
"colorMode": "HUE"
}
},
"metadata": {
"previous": {
"components": {
"PowerController": {
"powerState": "ON"
},
"BrightnessController": {
"brightness": 50
},
"ColorController": {
"color": {
"hue": 0,
"saturation": 0,
"brightness": 1
}
},
"ColorTemperatureController": {
"colorTemperatureInKelvin": 4000
},
"ColorModeController": {
"colorMode": "HUE"
}
}
}
},
"id": "d36ef110f0630946"
}