Coder Social home page Coder Social logo

mmm-homeassistant-sensors's Introduction

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

If you want to use icons for the sensors download the MaterialDesignIcons webfont from https://github.com/Templarian/MaterialDesign-Webfont/archive/master.zip and unzip the folder: cd ~/MagicMirror/modules/MMM-homeassistant-sensors && 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: true
stripName Removes all keys before the printed key.

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

Default: Home Assistant
host The hostname or ip adress of the home assistant instance.

Default: REQUIRED hassio.local
port port of homeassistant e.g. 443 for SSL.

Default: 8321
https is SSL enabled on home assistant (true/false)

Default: REQUIRED false
token The long lived token.

Default: REQUIRED
apipassword Deprecated API password.

Default: ``
updateInterval The time between updates (In milliseconds).

Default: 300000 (5 minutes)
selfsigned allows self signed certificates/ less secure (true/false).

Default: false
debuglogging Enable logging into /home/pi/.pm2/logs/mm-error.log (true/false).

Default: false
values Specify specific values from the json feed to only show what you need (entity_id).

values option

Option Description
sensor entity_id from Home Assistant. Please have a look at the states pages for the unique entity_id of your sensor
name The name of the value to display. If you omit this, friendly_name from Home Assistant will be displayed.
alertThreshold As soon as the measured value of the sensor exceeds the configured threshold, the entry will begin to 'blink'.

Default: off
attributes Array of sensor attributes to show. If not set, only show sensor state. If set, you can add as many attributes as you want, if you want to show the state as well add 'state'.

Default: []
icons Icons object for the on/off status of sensor. 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
state_open Open status icon of the sensor
state_closed Closed status icon of the sensor

Here is an example of an entry in config.js

modules: [{
		module: 'MMM-homeassistant-sensors',
		position: 'top_left',
		config: {
			host: "YOUR_HASS_HOST",
			port: "8123",
			https: false,
			token: "YOUR_LONG_LIVED_HASS_TOKEN",
			prettyName: false,
			stripName: false,
			debuglogging: false,
			values: [{
					sensor: "sensor.processor_use",
					alertThreshold: 50,
					icons: [{
							"default": "chip"
						}
					]
				}, {
					sensor: "binary_sensor.sensor",
					name: "Hallway 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.

mmm-homeassistant-sensors's People

Contributors

abdallahbaddour avatar anonym-tsk avatar bmennear avatar floge77 avatar jritsema avatar l3d00m avatar leinich avatar lolouk44 avatar moejetz avatar tkoeberl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.