shbatm / MMM-ISY

MagicMirror² module to connect to and display live updates from an ISY device
MIT License
7 stars 0 forks source link

MMM-ISY

This is a module for the MagicMirror² to connect to an ISY device from Universal Devices. (http://www.universal-devices.com) and display a floor plan showing live updates of which Insteon or Z-Wave devices are on.

Using the module

To use this module, add the following configuration block to the modules array in the config/config.js file:

var config = {
    modules: [
        {
            module: 'MMM-ISY',
            position: 'middle_center',
            config: {
                // See below for configurable options
            }
        }
    ]
}

Screenshots

Animated View:

Static View:

Creating the Floorplans

The floor plan is an SVG (Scalable Vector Graphics) image which the module uses to link back to ISY Devices, Variables, & Programs(future).

You create an SVG file and add shapes/images/icons to represent your ISY Nodes/Variables. As long as the ids match up (see requirements below), your SVG comes to life and displays your entities' states in real time. If you're not familiar with SVG, it is a vector image in XML format, which allows a browser to interact with individual paths and shapes inside the file.

Naming Conventions and Tag Requirements

Installation

  1. Clone the repo into your ~/MagicMirror/modules directory
  2. Run the following to install the dependencies & edit your ISY configuration
    cd MMM-ISY
    npm install
    cp isy.json.example isy.json
    nano isy.json

    Note: for security reasons, the ISY settings are not stored in the MagicMirror's config.js file.

Dependencies

Configuration options

Option Description
maxWidth Optional Maximum width of the module. Default: 98%
enableControls Optional Choose to enable the control subsystem, allowing you to control the devices by clicking on the individual devices in the graphic. Default: false.
nodes Optional Array of ISY Nodes customizations. By default, you do not need to provide a list of nodes in the config. As long as the elements in your floorplan.svg are tagged properly, they will automatically be updated. This setting is used to provide advanced node properties. See Advanced Properties below.
variables Optional Array of ISY Variable customizations, similar to nodes above.
floorplan Optional to set a custom file name for the base floorplan.
Default: floorplan.svg
thermostats Optional An object representing the Insteon Thermostats to display.
Example:thermostats: {'i_2517A4': { position: { left: 44%, top: 42%, zoom: 1.5 }', showRelHum: true, showSetPoints: true }}
Note: only include the base Insteon address in the device address (leave of the trailing 1, 2, 3, that the ISY enumerates).
.position The CSS Style to be applied describing the position and size of the T-Stat.
.showRelHum Whether or not to show the relative humidity reported by the device.
.showSetPoints Whether or not to show the Heating and Cooling Setpoints. If false only the current temperature is shown.

Advanced Properties

Advanced Properties can be set for individual nodes and variables, which lets you customize how they behave, such as setting custom On and Off values, inverting On and Off, or even performing an action when the device/variable changes by sending a module notification.

Example Advanced Properties for config.nodes

This example customizes the n001_dsc1_z02 element, which in this case is the motion sensor for the Alarm. Instead of just turning "ON" it flashes the element on the floor plan. It also sends a notification to the MMM-OnScreenMenu module to turn on the monitor when motion is detected and turn it off when it clears.

nodes: {
    'n001_dsc1_z02': {
        onVal: 1,
        offVal: 0,
        flash: true,
        notifyOn: {
            notification: "ONSCREENMENU_PROCESS_ACTION",
            payload: 'monitorOn'
        },
        notifyOff: {
            notification: "ONSCREENMENU_PROCESS_ACTION",
            payload: 'monitorOff'
        }
    }
}
Option Description
onVal & offVal The values to use for when to show the Variable as "On" or "Off" on the floor plan.
inverted: true Invert the normal ON and OFF states (e.g. Garage Door sensor). Cannot be used with flash use onVal: 0, offVal: 1 if you want to flash an inverted node.
flash: true Optional Setting this to true will show the device pulsing on and off. The actual animation can be changed by overriding the isyFlashNode class in the MMM-ISY.css file.
notifyOn & notifyOff Optional To send a module notification when a variable changes, add one or both of these.
Format: { notification: "NOTIFICATION_TEXT", payload: "payload to send" }
useProp Optional Add to use a property other than ST for the devices' Current State (e.g. GV3). See CHANGELOG v1.0.5 for details.
customStatusText Optional If you have a text span in the SVG file for a device, named (node address)_tspan and provide and provide an object with text to use for each status, the text will be updated. See text under the TV icon in the screenshot above for demo.
showStatusText FUTURE Optional If you have a text span in the SVG file for a device, named (node address)_tspan and showStatusText: true in your config for that node, the text will be updated with the formatted status (e.g. dimming level in %).

Sample Configuration

{
    module: 'MMM-ISY',
    position: "middle_center",
    header: "House Status",
    config: {
        nodes: {
            'n001_dsc1_z02': {
                onVal: 1,
                offVal: 0,
                flash: true,
                notifyOn: {
                    notification: "ONSCREENMENU_PROCESS_ACTION",
                    payload: 'monitorOn'
                },
                notifyOff: {
                    notification: "ONSCREENMENU_PROCESS_ACTION",
                    payload: {
                        actionName: "delayed1",
                        action: "monitorOff",
                        delay: 60000,
                    }
                }
            },
            "i_2277CB1": { inverted: true },
            "n007_h1509751175b7e": { useProp: "GV3", offVal: 0 }
        },
        variables: { 
            "var_2_48": { onVal: 1, offVal: 0 }
        },
        thermostats: {
            'i_2517A4': { position: {left: '42%', top: '30%' }, showRelHum: true, showSetPoints: true },
            'i_251A84': { position: {left: '73%', top: '21%' }, showRelHum: false, showSetPoints: true }
        },
    }
},

Inspiration and Credits