Skip to content

AbdallahBaddour/MMM-homeassistant-sensors

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MMM-homeassistant-sensors

This a module for the MagicMirror. It can display information from Home Assistant using the home assistant REST API.

Installation

Navigate into your MagicMirror's modules folder and clone this repository. cd ~\MagicMirror\modules && git clone https://github.com/leinich/MMM-homeassistant-sensors.git

In cases you want to use icons for the sensor please perform following: Download the MaterialDesignIcons Webfont from https://github.com/Templarian/MaterialDesign-Webfont/archive/master.zip and unzip the folder wget https://github.com/Templarian/MaterialDesign-Webfont/archive/master.zip && unzip master.zip

Configuration

It is very simple to set up this module, a sample configuration looks like this:

Configuration Options

Option Description
prettyName Pretty print the name of each JSON key (remove camelCase and underscores).

Default value: true
stripName Removes all keys before the printed key.

Example: a.b.c will print c.
Default value: true
title Title to display at the top of the module.

**Default value: ** Home Assistant
url The url of the homeassitant api .

Default value: REQUIRED
updateInterval The time between updates (In milliseconds). /

Default value: 300000 (5 minutes)
values Specify specific values from the json feed to only show what you need (entity_id).

values option

Option Description
sensor entity_id as of home-assistant. Please hav a look at teh states pages for the unique entity_id of your sensor
icons an icons object for the on/off status of sensor. please see: MaterialDesignIcons

icons option

Option Description
default default icon of the sensor. In case there is no on/off status, like processor use.
state_on on status icon of the sensor
state_off off status icon of the sensor

Here is an example of an entry in config.js

modules: [{
		module: 'MMM-homeassistant-sensors',
		position: 'top_left',
		config: {
			url: 'https://youehomeassistant:8123/api/states?api_password=secret',
			prettyName: false,
			stripName: false,
			values: [{
					sensor: "sensor.processor_use",
					icons: [{
							"default": "chip"
						}
					]
				}, {
					sensor: "binary_sensor.sensor",
					icons: [{
							"state_off": "run",
							"state_on": "run-fast"
						}
					]
				}, {
					sensor: "switch.reception_spot",
					icons: [{
							"state_off": "lightbulb-outline",
							"state_on": "lightbulb-on-outline"
						}
					]
				}
			]

		}
	}
]

Result example:

Alt text

Special Thanks

  • Michael Teeuw for creating the awesome MagicMirror2 project that made this module possible.
  • tkoeberl for creating the initial module that I used as guidance in creating this module.

About

shows homeassistant sensors on Magic Mirror

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%