Skip to content

cybex-dev/MMM-ServiceViewer

Repository files navigation

Magic Mirror Service Viewer

Module for MagicMirror allows showing which services are online on your local network.

This module allows finding services you are interested in on your network, and can open then with the MMM-XDG-OPEN module or some other mechanism.

Note: Best used with MMM-XDG-OPEN to allow opening of any link from a service on your network

Any issues, please report and pull requests are most welcome

Screenshot

Show is the header (defined in the config), and below a list of hosts on the local network providing a service, grouped by the type of service.

Screenshot

Installation

Open up your terminal, navigate to /path/to/MagicMirror/modules. Then type in:

git clone https://github.com/cybex-dev/MMM-ServiceViewer
cd MMM-ServiceViewer
npm install

Configuration

Here is an example configuration with description. Put it in the MagicMirror/config/config.js file:

{
    module: "MMM-ServiceViewer",
    header: "Network Services",
    position: "bottom_right",
    config: {
        // groupBy: "service",
        serviceTypes: [
            "ssh", "device-info", "smb", "videodepth", "microphone", "openhab-server", "video-rgb", "video-depth", "speaker"
        ]
    }
}

serviceTypes is an array, so you can add the various services you are interested in (which is found on your local network).

Configuration options

The following properties can be configured:

Option Description
position Location on MagicMirror display
serviceTypes An array of services you are interested in.

OnClick functionality

When an host (entry) is clicked, a notification is sent using the Magic Mirror Notification Mechanism. The notification XDG-OPEN is sent along with details in the notification payload. The payload is defined as

{
    protocol: "",
    location: "",
    port: "",
    type: "",
    host: "",
} 

The payload descriptions/purpose is as follows

Option Description
protocol The protocol TCP, UDP, HTTP, etc of the service. (This is detected by the presence of a uri="/" value in the txt-record field)
location The IP address where the service can be found. (if the option uses_multicast=1 is found in the txt-records, then the multicast address is used.
port The port where the service can be accessed from.
type Type as defined in Avahi Service Types the first part of the service type e.g. the _ssh part of the full service name _ssh._tcp. The type name in this case will be ssh (without the underscore).
host The host is a DNS name which describes the device-name.domain which is used for samba shares.

See the Avahi Documentation and the Arch Wiki for information about Avahi operations and naming conventions, and the IANA register for service names and their corresponding ports.

Collaborate

Pull requests are welcome.

Future Work

  • Improve GUI for viewing online/offline services with icons of services and status icons.
  • Add browsing all services on the network, not just predefined services.

About

Shows all Avahi/Bonjour services on local network

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published