Skip to content

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

Notifications You must be signed in to change notification settings

JFWenisch/MMM-Homematic-Rooms

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published