GithubHelp home page GithubHelp logo

jfwenisch / mmm-homematic-rooms Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 220 KB

An easy to use MagicMirror² module that automically requests device information from the HomeMatic CCU and displays them grouped by the assigned room.

JavaScript 98.73% CSS 1.27%

mmm-homematic-rooms's Introduction

MMM-Homematic-Rooms

screenshot

A MagicMirror² module that automically requests device information from the HomeMatic CCU and displays them grouped by the assigned room. This module requires the CCU to have the XML-API installed. Easy to use, only the connection URL needs to be specified. The information are automatically refreshed every 10 minutes.

Installation

  1. Clone repo:
	cd MagicMirror/modules/
	git clone https://github.com/JFWenisch/MMM-Homematic-Rooms
  1. Install dependencies:
	cd MMM-Homematic-Rooms/
	npm install
  1. Add the module to the ../MagicMirror/config/config.js, example:
		{
			module: 'MMM-Homematic-Rooms',
			header: 'MMM-Homematic-Rooms',
			position: 'bottom_right',
			config: {
				homematicURL: "http://192.168.0.2"
			}
		},

Config

key Description
homematicURL The URL to be used to request information from the CCU2
Default value: http://192.168.0.2

How it works

When the module is started, the within the ../MagicMirror/config/config.js set homematic url is used as base URL for all queries. As this modules makes use of the XML-API, the module automatically appends /config/xmlapi/ to all request. screenshot_01

After the URL has been set the moduls does an XMLHTTPRequest on /config/xmlapi/devicelist.cgi to get the ids of all currently configured devices. Currently only found heaters are stored for further processing. screenshot_02

Once all devices have been read, the module does an XMLHTTPRequest on /config/xmlapi/roomlist.cgi to find all currently configured rooms, and linked sensors.

screenshot_03

Now, as we have a roomlist that contains a list of sensors and we have a list of devices, we need to find out which sensor belongs to which device, create a mapping and query useful information by doing a XMLHTTPRequest on /config/xmlapi/state.cgi?device_id={id}. As there is no way to get the device based on a sensor id ( at least i'm not aware of this right now), we are iterate over our previously stored list of heater devices and call the state cgi with the heater ids to get the temperatur sensor for our devices. Once we get the sensor id, we look within our roomlist to find the sensor linked to a room. If found, we are getting the actual temperature and set temperature from the state.cgi resonse and update our room configuration which is afterwards used to render the frontend. screenshot_04

mmm-homematic-rooms's People

Contributors

jfwenisch avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

djalexchrist

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.