Skip to content

redxeagle/MMM-ioBroker

 
 

Repository files navigation

Module: MMM-ioBroker

This MagicMirror module, shows values like temperature/humidity of ioBroker devices.

Magic-Mirror Module MMM-ioBroker screenshot Magic-Mirror Module MMM-ioBroker screenshot Magic-Mirror Module MMM-ioBroker screenshot

Dependencies

Installation

Navigate into your MagicMirror's modules folder:

cd ~/MagicMirror/modules

Clone this repository:

git clone https://github.com/ioBroker/MMM-ioBroker

Configure the module in your config.js file.

Update the module

Navigate into the MMM-ioBroker folder with cd ~/MagicMirror/modules/MMM-ioBroker and get the latest code from Github with git pull.

If you haven't changed the modules, this should work without any problems. Type git status to see your changes, if there are any, you can reset them with git reset --hard. After that, git pull should be possible.

Using the module

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

modules: [
  {
    module: 'MMM-ioBroker',
    position: 'bottom_bar',
    config: {
      host: 'localhost',
      port: '8082',
      https: false,
      template: 'MMM-ioBroker.njk',
      devices: [
          { name: 'writeHereTheName1',
            deviceStates: [
                              { id: 'mqtt.0.sensorX.temperature', icon: 'wi wi-thermometer', suffix: '°' },
                              { id: 'mqtt.0.sensorX.humidity',    icon: 'wi wi-humidity',    suffix: '%' }
                          ]
          },
          { name: 'writeHereTheName2',
            deviceStates: [
                              { id: 'mqtt.0.sensorY.temperature', icon: 'wi wi-thermometer',  suffix: '°' },
                              { id: 'mqtt.0.sensorY.battery',     icon: 'fa fa-battery-half', suffix: '' }
                          ]
          }
        ]
    }
  }
]

For a Floorplan you can use this configuration

modules: [
  {
    module: 'MMM-ioBroker',
    position: 'bottom_bar',
    config: {
      host: 'localhost',
      port: '8082',
      https: false,
      template: 'MMM-Floorplan.njk',
      devices: [
          { name: 'writeHereTheName1',
            deviceStates: [
                              { id: 'mqtt.0.sensorX.temperature', icon: 'wi wi-thermometer', suffix: '°', left: 240, top: 300 },
                              { id: 'mqtt.0.sensorX.humidity',    icon: 'wi wi-humidity',    suffix: '%', left: 270, top: 300 }
                          ]
          },
          { name: 'writeHereTheName2',
            deviceStates: [
                              { id: 'mqtt.0.sensorY.temperature', icon: 'wi wi-thermometer',  suffix: '°', left: 240, top: 100  },
                              { id: 'mqtt.0.sensorY.battery',     icon: 'fa fa-battery-half', suffix: '', left: 290, top: 100  }
                          ]
          },
          { name: 'Doors',
            deviceStates: [
                              { id: 'deconz.0.Sensors.16.open', type: 'door', left: 20, top: 143 },
                              { id: 'deconz.0.Sensors.17.open', type: 'door', left: 20, top: 12 }
                          ]
          },
          { name: 'Lights',
            deviceStates: [
              { id: 'deconz.0.Lights.10.on', type: 'light', left: 110, top: 300 },
              { id: 'deconz.0.Lights.7.on', type: 'light', left: 385, top: 46 }
            ]
          }
        ]
    }
  }
]

Configuration options

The following properties can be configured:

Option Description
host Hostname/IP of the ioBroker Server. Is only necessary, if ioBroker and Magic-Mirror is not on the same machine (Raspberry Pi).
Possible values: localhost or a IP
Default value: localhost
port ioBroker web Port
Possible values: any number
Default value: 8082
https If your ioBroker use https
Possible values: true or false
Default value: false
template Name of the used nunjucks template file
Possible values: any template file in the MMM-ioBoker directory
Default value: 'MMM-ioBroker.njk'
Using a user Nunjuck template file you may change the output. E.g. change the color of an Item or skip it, if usefull.
see [Homepage of Nunjucks](https://mozilla.github.io/nunjucks/)
devices Array of objects. Object for the different ioBroker devices.

{ name: 'yourNameHere1',
  deviceStates: [
     { id: 'mqtt.0.device1.temperature',  icon: 'wi wi-thermometer', suffix: '°' },
     { id: 'mqtt.0.device1.mqtthumidity', icon: 'wi wi-humidity',    suffix: '%'     },
  ],
},
name: Just a text, that will be shown as title.
deviceStates: array of states for the device readings you want to display.
id: ID of the state (Required). Go to the ioBroker admin, find the state ID.
icon: CSS class of an icon (Font-Awesome and Weather Icons are pre installed)
suffix: any string/text
initialLoadDelay The initial delay before loading. (Milliseconds)
Default value: 1000 (1 second)
updateInterval Content update interval in Milliseconds.
Possible values: 1000 (1 second) to 86400000 (24 hours)
Default value: 60000 (1 minute)

About

A module for the MagicMirror, to display data from ioBroker devices.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 64.1%
  • HTML 20.7%
  • CSS 15.2%