Skip to content

A MagicMirror Module showing my Smartthings Home automation device status

License

Notifications You must be signed in to change notification settings

aduyng/MMM-IOTStatus

Repository files navigation

MMM-IOTStatus

A MagicMirror's Module to show my Smartthings Home Automation device status using Firebase Realtime Database

The project uses a thingLayer, a Smartthings SmartApp to report the device status to Firebase. This module listens to the Firebase events in realtime and renders the device status on your mirror.

CircleCI

Screenshots

All devices green

Some devices red

Installation

1. Setup the MagicMirror module

cd ~/MagicMirror/modules
git clone https://github.com/aduyng/MMM-IOTStatus.git
cd MMM-IOTStatus
npm install --production

2. Setup Firebase Realtime Database

You will need a realtime database for Smartthings to push the device status to. Follow this tutorial, https://firebase.google.com/docs/web/setup, to setup a Firebase project and a realtime database.

Take note of the project configuration especially the realtime database URL.

3. Setup Smartthings

I modified the original of thingLayer SmartApp developed Jody Albritton to report my device status to Firebase.

  1. Install the modified version of thingLayer SmartApp (./smartthings/thingLayer.groovy) via Smartthings IDE
  2. Switch to App Settings, enter the realtime database URL on step 2. above to the value of firebaseUrl.

thingLayer will keep pushing changes to the path /iot of your realtime database above.

Configuration

  {
			module: "MMM-IOTStatus",
			position: "top_right",
			config: {
				title: 'My Home', // the title appears on the top
				firebaseDatabaseRootRef: '/iot', // the path of the realtime database to listen to
				firebaseConfig : {
					apiKey: "<the api key>",
					databaseURL: "<the realtime database URL>",
					projectId: "<the project id>",
					appId: "<the appId - optional>"
				}
			}
  }