frekel / MMM-Homey-BetterLogic

MagicMirrorModule for fetching REST data and displaying them on the mirror

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Module: MMM-Homey-BetterLogic

The MMM-Homey-BetterLogic module is a MagicMirror addon. This module collects data from the Better Logic app from a Homey and displays it on your mirror in a table.

This project is a fork form MMM-REST so credits to him.

Installation

  1. Navigate into your MagicMirror's 'modules' folder and execute 'git clone https://github.com/PBaan93/MMM-Homey-BetterLogic.git'
  2. cd 'cd MMM-Homey-BetterLogic'
  3. Execute 'npm install' to install the node dependencies.

Known Issues

  • had a problem with remote URLs an AJAX: changed to node_helper.js to collect data

Using the module

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

modules: [
    {
        module: 'MMM-Homey-BetterLogic',
        position: 'bottom_right',   // This can be any of the regions.
                                    // Best results in one of the side regions like: top_left
        header: 'Woonklimaat',      
        config: {
                debug: false,
                homeyIp: '192.168.1.2',
                homeyBearerToken : '1234567890abcdef1234567890abcdef',
                sections: [
                {
                    format: '%.1f<span class="wi wi-celsius"></span>',
                    betherLogicVariable: 'NestTemperatuur'
                },
                {
                    format: '%.1f<span class="wi wi-humidity"></span>',
                    betherLogicVariable: 'NestLuchtvochtigheid'
                }
            ],
            output: [
                ['Woonkamer','@1', '@2']
            ]
        }
    }
]

Configuration options

The following properties can be configured:

Option Description
sections sections is an array of hashes for the REST endpoints to connect to
Option Description
format sprintf() format
mapping Map the value againt a defined mapping
url The url to call. It has to return a single integer / floating point value
mappings mappings is an hash of hashes for the mapping of values to other values
Option Description
NAME_OF_MAPPING Name of mapping will be referenced by sections -> mapping
values hash of key / values to map from / to
output control the output table for the display. Has to be a 2-dimensional array representing the rows and the columns of the output
A cell containing a '@' followed by a number represents the section id (starting by 1) of the REST Urls
updateInterval How often this refreshes

Example: 60000
Default value: 60000
initialLoadDelay How long to wait for the first load

Example: 60000
Default value: 0
animationSpeed Fadeover effect for dom updates

Example: 1000
Default value: 2000
debug Log messages to Log.info / console

Example: true
Default value: false

About

MagicMirrorModule for fetching REST data and displaying them on the mirror

License:MIT License


Languages

Language:JavaScript 99.6%Language:CSS 0.4%