Code Monkey home page Code Monkey logo

Comments (1)

zehnm avatar zehnm commented on July 27, 2024

MDNS analysis:

  • not active by default
  • device starts sending MDNS queries only after one clicks through the myStrom app, device, settings, Apple HomeKit
  • MDNS is of type hap (Apple Homekit afaik)

Node.js test:

'use strict';
const bonjour = require('bonjour')();

function printObject(o) {
  let out = '';
  Object.getOwnPropertyNames(o).forEach( (name, index) => {
    out += (index > 0 ? ',' : '') + name + '=' + o[name];
  });
  return out;
}

function serviceUpListener(service) {
  if (!service || !service.txt || !service.host) {
    return;
  }
  if (service.host.startsWith('myStrom-Switch')) {
    console.log('MDNS discovered "%s": host=%s, MAC=%s, txt=[%s]', service.name, service.host, service.txt.id, printObject(service.txt));
  }
}

const mdnsBrowser = bonjour.find({ type: 'hap' }, serviceUpListener);
mdnsBrowser.start();

Output (with masked mac addresses):

MDNS discovered "Switch-ef0011": host=myStrom-Switch-ef0011.local, MAC=de:ad:be:ef:00:11, txt=[c#=1,ff=0,id=de:ad:be:ef:00:11,md=Switch-ef0011,pv=1.0,s#=2,sf=1,ci=8]
MDNS discovered "Outlet ef0022": host=myStrom-Switch-ef0022.local, MAC=de:ad:be:ef:00:22, txt=[c#=1025720861,ff=0,id=de:ad:be:ef:00:22,md=Outlet ef0022,pv=1.0,s#=1,sf=1,ci=7]
  • "Switch-ef0011" is a v1 switch
  • "Outlet ef0022" is a v2 switch

from neeo-mystrom-switch.

Related Issues (2)

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.