Skip to content

Feature Request: Listening for changes in other modules #299

@Fabrizz

Description

@Fabrizz

Description

It would be nice to have a (disabled by default) option to make the module send the web API action to the MM2 notification/event bus. And It could be pretty easy to implement! (See below)

Example:

  1. I set the display brightness to 70% using the API
  2. MMM-Remote control processes the change
  3. Module sends the change to the MM2 event bus

Changelog

executeQuery(query, res) {

The query could be resent here to the fronted so it can be sent to the MM2 event bus.

executeQuerysendSocketNotification → module → MM2 notification

Requirements

I think it could be fairly easy to implement this as a middleware in express, after the request is made and authorized the module could just send a RC_WEBAPI_SET (or similar) notification with the payload/endpoint. (Optionally the config entry could be an array to match the feature in the api to resend, filtering what is resended).

As said in "changelog", the best idea would be to get the query and just resend it to the MM2 event bus

Additional info

Why?

Compatibility with other modules that use MMM-Remote-Control. Im writing MMM-HomeKit, that adds native homekit support for MM2, exposing accessories to control modules/the mirror. I would love to use MMM-Remote-Control as the endpoint for things like screen brightness, on/off/reboot/etc, and having the info reflected on the Homekit app even if not made by it could be nice:

MMMHomeKit-test.mp4

Example with HA and MMM-OnSpotify / MMM-LiveLyrics

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions