This is a module for the MagicMirror².
Uses the npm package ikea-tradfri to provide some rudimentary actions.
cd ~/MagicMirror/modules
git clone https://github.com/thburghout/mmm-ikea-home-smart.git
cd mmm-ikea-home-smart
npm install
Next, you are going to have to obtain the credentials to control the devices
through the Tradfri gateway.
These can be obtained via the setup.js
script.
- Make sure that your gateway has a static ip address configured in your router.
- Please see your router's manual on how to do that.
The gateway can be recognized by its name starting with
GW-
.
- Please see your router's manual on how to do that.
The gateway can be recognized by its name starting with
- Obtain the gateway's identity by scanning the QR code on the bottom of the gateway. It contains a string containing the MAC address and the identity separated by a comma. You only need the identity.
- Run the setup script using
node setup.js
. - Provide the address and identity when prompted.
- Add the given configuration parameters to
config.js
as shown below.
To use this module, add the following configuration block to the modules array in the config/config.js
file:
var config = {
modules: [
{
module: "mmm-ikea-home-smart",
config: {
identity: {
identity: "tradfri_9999999999999",
psk: "abcdefghijklmnop",
},
host: "192.168.1.103",
location: {
latitude: 52.0,
longitude: 6.0,
}
}
}
]
}
Option | Description |
---|---|
identity |
Required credentials used for authenticating to the Tradfri Gateway. See Installation. |
host |
Required address to reach the gateway on. |
deviceMatchString |
Optional devices whose name contain this string are considered lights when turning all lights on or off. Type: string Default: "light" |
location |
Required for location based sunset estimation. |
This module is controlled via notifications.
These are listed below.
Please note that "all available lights" are the devices which have config.deviceMatchString
(default: light
) in their name.
Notification | Payload type | Description |
---|---|---|
IKEA_HOME_SMART_SWITCH_LIGHTS |
bool |
Turns on/off all available lights. |
IKEA_HOME_SMART_SWITCH_LIGHTS_IF_DARK |
- | Turns on all available lights if the sun is currently set. |
- Command registration for control via Telegram or other command users.
- Currently does not keep track of changes in lights and other devices.