Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
node-red-contrib-ikea-tradfri
Advanced tools
Node-RED nodes to get updates from and control devices connected to an IKEA TRADFRI gateway
Node-RED nodes to get updates from and control devices connected to an IKEA TRÅDFRI gateway. This project is based on AlCalzone's excellent node-tradfri-client module, which does not utilize any compiled binaries.
npm install node-red-contrib-ikea-tradfri
Alternatively, you can install this module through the editor UI palette.
This module contains 5 nodes:
This node is responsible for connecting to an IKEA TRÅDFRI gateway on your network. An attempt is made to automatically discover a gateway on the network. If this is unsuccessful a valid hostname or ip-address has to be entered. You also need to enter the gateways security code, as printed on the sticker on the bottom of the gateway. As per IKEA's guidelines, this code is not stored in Node-RED, instead, only the identity and pre-shared key returned after successful authentication are stored within the node.
This node is able to control on/off capable devices connected to the gateway. It can do so in 2 different ways:
If both are specified, the node will pick the action (on or off) from the message, but execute that action on all devices and groups given in both the node configuration and the input message. Any combination of these input message and configuration properties is also possible.
{
"topic": [1, 2],
"payload": "on"
}
{
"topic": 1,
"payload": "off"
}
{
"topic": 1,
}
{
"payload": "on",
}
{}
This node will send messages when a device or group is updated or removed. The message will contain all available details for the device or group. Due to how this system works these update messages are also sent when reconnecting to the gateway after a flow deploy.
Depending on the type of event, payload.event
will have a different value.
In case of the "device updated"
event, depending on the type of the updated device one of the blind
, lightbulb
, sensor
, or plug
properties will be set and the others will be undefined
.
{
"topic": 1,
"payload": {
"event": "device updated",
"type": "device type (lightbulb, plug, motionSensor, etc.)",
"instanceId": 1,
"name": "the human friendly device name",
"alive": true,
"lastSeen": "ISO8601 date when the device was last seen",
"deviceInfo": {
"battery": 100,
"firmwareVersion": "version",
"manufacturer": "device manufacturer",
"modelNumber": "model number if available",
"power": "power source (Battery, ACPower, Solar, etc.)",
"serialNumber": "device serial number if available (numeric)"
},
"blind": {
"position": 50,
},
"lightbulb": {
"color": "hexadecimal rgb color string",
"colorTemperature": 65,
"dimmer": 50,
"hue": 0,
"isDimmable": true,
"isOn": true,
"saturation": 0,
"spectrum": "bulb color spectrum (none, white, or rgb)"
},
"sensor": {
"sensorType": "sensor type (motionSensor)",
"minRangeValue": 0,
"minMeasuredValue": 10,
"maxMeasuredValue": 90,
"maxRangeValue": 100,
"sensorValue": 25
},
"plug": {
"isOn": true,
"isSwitchable": true
}
}
}
{
"topic": 1,
"payload": {
"event": "device removed",
"instanceId": 1
}
}
{
"topic": 1,
"payload": {
"event": "group updated",
"instanceId": 1,
"name": "the human friendly group name",
"deviceIds": [2],
"isOn": true,
"dimmer": 65,
"position": 0,
"transitionTime": 500,
"createdAt": "2021-01-01T12:00:00Z"
}
}
This node will retrieve the current state of one or more devices and/or groups. The output message will contain all available details for the devices and/or groups.
In case of device state, depending on the type of the updated device one of the blind
, lightbulb
, sensor
, or plug
properties will be set and the others will be undefined
.
{
"topic": [1, 2]
}
{
"topic": 1
}
{}
{
"topic": [1, 2],
"payload": {
"1": {
"type": "device type (lightbulb, plug, motionSensor, etc.)",
"instanceId": 1,
"name": "the human friendly device name",
"alive": true,
"lastSeen": "ISO8601 date when the device was last seen",
"deviceInfo": {
"battery": 100,
"firmwareVersion": "version",
"manufacturer": "device manufacturer",
"modelNumber": "model number if available",
"power": "power source (Battery, ACPower, Solar, etc.)",
"serialNumber": "device serial number if available"
},
"blind": {
"position": 50,
},
"lightbulb": {
"color": "hexadecimal rgb color string",
"colorTemperature": 65,
"dimmer": 50,
"hue": 0,
"isDimmable": true,
"isOn": true,
"saturation": 0,
"spectrum": "bulb color spectrum (none, white, or rgb)"
},
"sensor": {
"sensorType": "sensor type (motionSensor)",
"minRangeValue": 0,
"minMeasuredValue": 10,
"maxMeasuredValue": 90,
"maxRangeValue": 100,
"sensorValue": 25
},
"plug": {
"isOn": true,
"isSwitchable": true
}
},
"2": {
"type": "group",
"instanceId": 2,
"name": "the human friendly device name",
"deviceIds": [3],
"isOn": true,
"dimmer": 65,
"position": 0,
"transitionTime": 500,
"createdAt": "2021-01-01T12:00:00Z"
}
}
}
This node is able to control lights connected to the gateway. It can do so in 2 different ways:
If both are specified, the node will pick the action (on or off) from the message, but execute that action on all devices and groups given in both the node configuration and the input message. Any combination of these input message and configuration properties is also possible.
The node is able to control dimmable lights, white spectrum lights, and RGB lights.
{
"topic": [1, 2],
"payload": {
"onOff": true,
"brightness": 50
}
}
{
"topic": 1,
"payload": {
"colorTemperature": 75,
"brightness": 75
}
}
{
"topic": 1,
}
{
"payload": {
"color": "#ff0000",
"brightness": 75
},
}
{}
This node is able to control blinds connected to the gateway. It can do so in 2 different ways:
If both are specified, the node will pick the operation from the message, but execute that action on all devices and groups given in both the node configuration and the input message. Any combination of these input message and configuration properties is also possible.
The node is able to control smart blinds.
{
"topic": [1, 2],
"payload": {
"operation": "setPosition",
"position": 50
}
}
{
"topic": 1,
"payload": {
"operation": "stop"
}
}
{
"topic": 1,
}
{
"payload": {
"operation": "setPosition"
},
}
{}
Array.prototype.flat
payload
and topic
Promise.allSettled
polyfillFAQs
Node-RED nodes to get updates from and control devices connected to an IKEA TRADFRI gateway
The npm package node-red-contrib-ikea-tradfri receives a total of 30 weekly downloads. As such, node-red-contrib-ikea-tradfri popularity was classified as not popular.
We found that node-red-contrib-ikea-tradfri demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.