Coder Social home page Coder Social logo

idoodler / mmm-loxone Goto Github PK

View Code? Open in Web Editor NEW
11.0 6.0 1.0 386 KB

MMM-Loxone connects to your Loxone Miniserver and lets it communicate to your MagicMirror².

Home Page: https://www.idoodler.de

License: MIT License

JavaScript 99.91% CSS 0.09%
magicmirror loxone

mmm-loxone's Introduction

Codacy Badge

MMM-Loxone

This is a module for the MagicMirror².

MMM-Loxone connects to your Loxone Miniserver and lets it communicate to your MagicMirror².

Disclaimer

This package has been written for the Raspberry Pi and has only be tester on the Raspberry Pi please report any incompatibilities.

Security

This module doesn't transmit the defined credentials, it uses tokens to talk to your Loxone Miniserver.

Please create an user for your MagicMirror² to keep your personal credentials secure!

Dependencies

Upcoming features

  • Support controls like Alarm, WindowMonitor, Simple Virtual outputs, Weather in a modular way
  • Further power saving features (Ability to switch off the monitors AC power via an relay)
  • Quick overview, whats up in your home

Installation

Navigate into your MagicMirror's modules folder:

cd ~/MagicMirror/modules

Clone this repository:

git clone https://github.com/idoodler/MMM-Loxone

Navigate to the new MMM-Loxone folder and install the node dependencies.

npm install

Update the module

Navigate into the MMM-Loxone folder with cd ~/MagicMirror/modules/MMM-Loxone 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 the following configuration block to the modules array in the config/config.js file:

var config = {
    modules: [
        {
            module: 'MMM-Loxone',
            config: {
                // See below for configurable options
            }
        }
    ]
}

Configuration options

Option Description
host Required: Defines the Loxone Miniserver host. It can be an IP or your CloudDNS address

Example: 192.168.0.46 or dns.loxonecloud.com/EEE00000000

Type: string
user Required: Defines the Loxone Miniserver username.

Type: string
pwd Required: Defines the Loxone Miniserver password.

Type: string
roomUuid Optional: Defines the room of which the room temperature is displayed

Info: Modules like the default currentWeather and MMM-forecast-io will display the indoor temperature, please refere to their documentation

Type: string
observingUuids Optional: Defines controls that should be shown on our module. Supported Controls: Virtual State, State

Type: array

Default: Empty array
presence Optional: If enabled this module will use the LightControllerV2 in the defined room, or the virtual state defined in presenceUuid to set the MagicMirror to sleep or wake it up

Type: bool

Default: false
presenceUuid Optional: Defines a digital virtual state control that will be used to detect presende. If the virtual state is ON the mirror will be on, if the state if OFF the mirror will be off

Note: Can be used to override the default behaviour of using the first LightControllerV2 in the room

Type: string
fadeOut Optional: Fades out the webinterface before the HDMI output is disabled (MagicMirror goes to sleep)

Type: bool

Default: false
showInfoNotifications Optional: If info notifications should be shown.

Type: bool

Default: true
showErrorNotifications Optional: If error notifications should be shown.
Type: bool

Default: true
showSystemNotifications Optional: If system notifications should be shown.

Type: bool

Default: true
showNotificationOfControlTypes Optional: Defines, what controls are able to show notifications on your MagicMirror².

Type: array

Default: [ "Intercom", "Alarm", "SmokeAlarm", "Sauna" ]
allow3rdParty Optional: If 3rd Party modules are able to use this module to communicate with your Loxone Miniserver.

Type: bool

Default: false

Display the room temperature

Requirements

  • The room needs to have at lease contain one Intelligent Room Controller (v2)
    • The first Intelligent Room Controller (v2) will be used if multiple are defined in one room
  • roomUuid needs to be defined in the MMM-Loxone configuration in config.js
  • currentWeather or MMM-forecast-io must be installed and correctly configured to display the indoor room temperature

Display Notifications

Requirements

  • You must define the alert module in your config.json file.

Example:

{
	module: "alert"
}

How to get the roomUuid

  1. Open the Loxone Webinterface
  2. Navigate to the room you want to display the room temperature
  3. Copy the last path component displayed in your browsers URL-Bar
    alt text

Populate observingUuids

observingUuids is an array of control uuids

Example:

observingUuids: [
    "0d12f989-0060-c82f-ffff2083eaf2523c"
]

alt text

  1. Open the Loxone Webinterface
  2. Navigate to the control you want to display on your mirror
    • Virtual State and State controls are supported
  3. Copy the last path component displayed in your browsers URL-Bar
    alt text

Developer notes

Notifications emitted by MMM-Loxone

NotificationKey Description
INDOOR_TEMPERATURE Modules like the default currentWeather and MMM-forecast-io will display the indoor temperature. Please implement this notification key if you want to display the indoor temperature in your module.

Note: roomUUID must be configured in your config.json
USER_PRESENCE Modules can use this notification to pause or resume your module.

Example: true if the User is present in the room, false if not.

Payload: bool

Note: roomUUID and presence must be configured in your config.json
LOXONE_STATE Any state emitted by the Loxone Miniserver with its UUID and value. Ready to be used by any other module.

Payload: Number or String

Note: allow3rdParty must be configured in your config.json
LOXONE_STRUCTURE_FILE The current structure file of the Loxone Miniserver as an Object {}.

Payload: Object

Note: allow3rdParty must be configured in your config.json
LOXONE_OSS Out Of Service status of the Loxone Miniserver.

Example: true if the Miniserver is rebooting, false if the Miniserver is up and running.

Payload: bool

Note: allow3rdParty must be configured in your config.json

Next steps

  • Statistics
  • Systemstate

License

The MIT License (MIT)

Copyright (c) 2018 David Gölzhäuser

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

mmm-loxone's People

Contributors

dependabot[bot] avatar el97 avatar idoodler avatar jslits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

jslits

mmm-loxone's Issues

Rpi-4 - black screen instead of switching off the display

The Display do not turn off, it shows a black screen instead turning off the display. (Rpi 4 <-HDMI-> display)
The pm2 log shows a interessting Message: " This is no Raspberry Pi, toggle the display is not supported!"

Setup:

Raspberry Pi 4
latest Raspian Image with all updates
latest updates for MagicMirror and modules

1|MagicMirror | [2020-09-25 12:57:13.738] [INFO] MMM-Loxone Enabling statusupdates
1|MagicMirror | [2020-09-25 12:57:13.798] [LOG]
1|MagicMirror | MMM-Loxone Successfully executed ‘dev/sps/enablebinstatusupdate’ with code 200 and value 1
1|MagicMirror | [2020-09-25 12:57:14.531] [INFO]
1|MagicMirror | MMM-Loxone Got lightMood change to: All off(778)
1|MagicMirror | [2020-09-25 12:57:14.534] [INFO]
1|MagicMirror | This is no Raspberry Pi, toggle the display is not supported!

Monitoring of Parameters

Hi,
It would be nice to be able to monitor data out of loxone.
Examples:
Energy Monitor -->Current Power; Energy Production, Energy Consumption; Counters
Door Status -->Which window / Door is Open
Alarm Status --> ON / OFF
Analog Sensor Values (water cistern distance sensor)

Furthermore, Energy saving for the Montior in "presence mode = ON" would be nice

Thanks

More than 1 MMM-Loxone entry in config.js does not work.

Hi idoodler.

I created 2 MMM-Loxone entries in config.js. See below.
For security reasons I don't mention current observingUuids because this issue is public.

{
			module: "MMM-Loxone",
			position: "bottom_right",
			header: "Solar Energy Performance",
			config: {
				host: "x.x.x.x",
				user: "xxx",
				pwd: "-----",
				roomUuid: "roomUuid", // Living Room temp in Weather Position
				observingUuids: [
					"observingUuids-1", // Energy Direction
					"observingUuids-2", // Total Solar Energy Production
					"observingUuids-3", // Current Power Consumption
					"observingUuids-4",  // Current Performance Energy Supplier
					"observingUuids-5" // Real Time Solar Power Production				
				],
				presence: true				
			}
		},
		{
			module: "MMM-Loxone",
			position: "bottom_right",
			header: "Temperatures",
			config: {
				host: "x.x.x.x",
				user: "xxx",
				pwd: "-----",
				observingUuids: [
					"observingUuids-6" // Living Room Temperature
				]	
			}
		},

As you can see in the screenshot below the modules are Loading. No values are displayed.

image

I removed all parameters as you mentioned. Except required observingUuids in the second MMM-Loxone entry.

Below you will find pm2 error and out logs:

pm2 error log

[22.08.2021 15:16.23.253] [ERROR] WebSocket:  socket failed! WS Close Code: -unknown-
[22.08.2021 15:16.23.262] [ERROR] MMM-Loxone { errorCode: 418 }
[22.08.2021 15:16.23.266] [ERROR] (node:13048) UnhandledPromiseRejectionWarning: #<Object>
[22.08.2021 15:16.23.267] [ERROR] (node:13048) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
[22.08.2021 15:16.23.268] [ERROR] (node:13048) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[22.08.2021 15:16.23.668] [WARN]  MMM-Loxone Couldn't find Room!
/home/pi/MagicMirror/node_modules/electron/dist/electron exited with signal SIGINT

pm2 out log

> [email protected] start
> DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js

[22.08.2021 15:16.10.490] [LOG]   Starting MagicMirror: v2.16.0
[22.08.2021 15:16.10.495] [LOG]   Loading config ...
[22.08.2021 15:16.10.501] [LOG]   Loading module helpers ...
[22.08.2021 15:16.10.504] [LOG]   No helper found for module: alert.
[22.08.2021 15:16.10.661] [LOG]   Initializing new module helper ...
[22.08.2021 15:16.10.662] [LOG]   Module helper loaded: updatenotification
[22.08.2021 15:16.10.663] [LOG]   No helper found for module: clock.
[22.08.2021 15:16.10.804] [LOG]   Initializing new module helper ...
[22.08.2021 15:16.10.805] [LOG]   Module helper loaded: calendar
[22.08.2021 15:16.10.806] [LOG]   No helper found for module: compliments.
[22.08.2021 15:16.10.807] [LOG]   No helper found for module: weather.
[22.08.2021 15:16.10.831] [LOG]   Initializing new module helper ...
[22.08.2021 15:16.10.832] [LOG]   Module helper loaded: newsfeed
[22.08.2021 15:16.10.966] [LOG]   Initializing new module helper ...
[22.08.2021 15:16.10.967] [LOG]   Module helper loaded: MMM-BackgroundSlideshow
[22.08.2021 15:16.11.291] [LOG]   Initializing new module helper ...
[22.08.2021 15:16.11.292] [LOG]   Check MagicMirror version for node helper 'MMM-Loxone' - Minimum version: 2.1.1 - Current version: 2.16.0
[22.08.2021 15:16.11.293] [LOG]   Version is ok!
[22.08.2021 15:16.11.294] [LOG]   Module helper loaded: MMM-Loxone
[22.08.2021 15:16.11.520] [LOG]   Initializing new module helper ...
[22.08.2021 15:16.11.521] [LOG]   Module helper loaded: MMM-Remote-Control
[22.08.2021 15:16.11.521] [LOG]   All module helpers loaded.
[22.08.2021 15:16.11.639] [LOG]   Starting server on port 8080 ... 
[22.08.2021 15:16.11.651] [LOG]   Server started ...
[22.08.2021 15:16.11.652] [LOG]   Connecting socket for: updatenotification
[22.08.2021 15:16.11.653] [LOG]   Connecting socket for: calendar
[22.08.2021 15:16.11.654] [LOG]   Starting node helper for: calendar
[22.08.2021 15:16.11.655] [LOG]   Connecting socket for: newsfeed
[22.08.2021 15:16.11.656] [LOG]   Starting node helper for: newsfeed
[22.08.2021 15:16.11.656] [LOG]   Connecting socket for: MMM-BackgroundSlideshow
[22.08.2021 15:16.11.658] [LOG]   Connecting socket for: MMM-Loxone
[22.08.2021 15:16.11.660] [LOG]   Connecting socket for: MMM-Remote-Control
[22.08.2021 15:16.11.661] [LOG]   Starting node helper for: MMM-Remote-Control
[22.08.2021 15:16.11.668] [LOG]   Sockets connected & modules started ...
[22.08.2021 15:16.11.925] [LOG]   Launching application.
[22.08.2021 15:16.14.988] [LOG]   Create new calendarfetcher for url: (for security reasons not showed) - Interval: 300000
[22.08.2021 15:16.15.087] [LOG]   Create new calendarfetcher for url: (for security reasons not showed - Interval: 300000
[22.08.2021 15:16.15.332] [LOG]   Create new newsfetcher for url: (for security reasons not showed) - Interval: 300000
[22.08.2021 15:16.15.339] [LOG]   Create new newsfetcher for url: (for security reasons not showed - Interval: 300000
[22.08.2021 15:16.15.350] [INFO]  Checking git for module: MMM-BackgroundSlideshow
[22.08.2021 15:16.15.991] [INFO]  Calendar-Fetcher: Broadcasting 0 events.
[22.08.2021 15:16.16.015] [INFO]  BACKGROUNDSLIDESHOW: Reading directory "(for security reasons not showed)" for images.
[22.08.2021 15:16.16.021] [INFO]  BACKGROUNDSLIDESHOW: 25 files found
[22.08.2021 15:16.17.373] [INFO]  Calendar-Fetcher: Broadcasting 5 events.
[22.08.2021 15:16.17.479] [INFO]  Checking git for module: MMM-Loxone
[22.08.2021 15:16.17.585] [INFO]  BACKGROUNDSLIDESHOW_NEXT_IMAGE
[22.08.2021 15:16.17.592] [INFO]  BACKGROUNDSLIDESHOW: reading path "(for security reasons not showed)"
[22.08.2021 15:16.18.040] [INFO]  Checking git for module: MMM-Remote-Control
[22.08.2021 15:16.18.437] [INFO]  Newsfeed-Fetcher: Broadcasting 20 items.
[22.08.2021 15:16.19.077] [INFO]  Newsfeed-Fetcher: Broadcasting 60 items.
[22.08.2021 15:16.23.194] [INFO]  MMM-Loxone Opening Socket to your Miniserver
[22.08.2021 15:16.23.255] [INFO]  MMM-Loxone Opening Socket to your Miniserver
[22.08.2021 15:16.23.627] [LOG]   MMM-Loxone Download LoxApp3.json
[22.08.2021 15:16.23.667] [INFO]  MMM-Loxone Search room with uuid: null
[22.08.2021 15:16.23.669] [INFO]  MMM-Loxone NotificationUuid: (for security reasons not showed)
[22.08.2021 15:16.23.671] [INFO]  MMM-Loxone Enabling statusupdates
[22.08.2021 15:16.23.731] [LOG]   MMM-Loxone Successfully executed 'dev/sps/enablebinstatusupdate' with code 200 and value 1
[22.08.2021 15:16.36.033] [INFO]  BACKGROUNDSLIDESHOW_NEXT_IMAGE
[22.08.2021 15:16.36.034] [INFO]  BACKGROUNDSLIDESHOW: reading path "(for security reasons not showed)"
[22.08.2021 15:16.56.032] [INFO]  BACKGROUNDSLIDESHOW_NEXT_IMAGE
[22.08.2021 15:16.56.034] [INFO]  BACKGROUNDSLIDESHOW: reading path "(for security reasons not showed)"
[22.08.2021 15:17.16.033] [INFO]  BACKGROUNDSLIDESHOW_NEXT_IMAGE
[22.08.2021 15:17.16.037] [INFO]  BACKGROUNDSLIDESHOW: reading path "(for security reasons not showed)"
[22.08.2021 15:17.36.032] [INFO]  BACKGROUNDSLIDESHOW_NEXT_IMAGE
[22.08.2021 15:17.36.036] [INFO]  BACKGROUNDSLIDESHOW: reading path "(for security reasons not showed)"
[22.08.2021 15:17.56.040] [INFO]  BACKGROUNDSLIDESHOW_NEXT_IMAGE
[22.08.2021 15:17.56.047] [INFO]  BACKGROUNDSLIDESHOW: reading path "(for security reasons not showed)"

Just 1 MMM-Loxone entry in config.js works just fine.
I needed more MMM-Loxone entries in config.js to rotate in different positions p.e. in the bottom_right position and bottom_left position.

In case you need more information, please contact me.

greetz
will4378

Feature request. Sorting observingUuids in a preferred way.

Hi idoodler.

Below you will find a config.js entry for MMM-Loxone.
For security reasons I don't mention current observingUuids because this Issue is public.

{
			module: "MMM-Loxone",
			position: "bottom_right",
			header: "Solar Energy Performance",
			config: {
				host: "x.x.x.x",
				user: "xxxx",
				pwd: "xxx",
				roomUuid: "roomUuid", // Living Room temp in Weather Position
				observingUuids: [
					"observingUuids-1", // Energy Direction
					"observingUuids-2", // Total Solar Energy Production
					"observingUuids-3", // Current Power Consumption
					"observingUuids-4",  // Current Performance Energy Supplier
					"observingUuids-5" // Real Time Solar Power Production				
				],
				presence: true				
			}
},

As you can see in the screenshot below the sorting inside the array is not equal the way observingUuids are presented in the MagicMirror Display.

doodle-image-1

Is it possible to create a feature in MMM-Loxone to display observingUuids in a preferred way?
I would appreciate this very much.

Thank you so much for your efforts to create an awesome MagicMirror module.

greetz,

will4378

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.