How to perform mDNS discovery

Thank you @robertklep, for your kind help. Got me to a better path over night.

go-eCharger advertise its’ service also with _http._tcp and switching to that brought a result for all http capable devices, including the go-e device.

Now with

{
  "type": "mdns-sd",
  "mdns-sd": {
    "name": "http",
    "protocol": "tcp"
  },
  "id": "{{txt.serial}}",
  "conditions": [
    [
      {
        "field": "txt.manufacturer",
        "match": {
          "type": "string",
          "value": "go-e"
        }
      }
    ]
  ]
}

I finally get a result with standalone discovery:

[log] 2022-11-29 04:47:01 [MyApp] Got result: DiscoveryResultMDNSSD {
  _events: [Object: null prototype] {},
  _eventsCount: 0,
  _maxListeners: undefined,
  id: '123456',
  lastSeen: '2022-11-29T04:47:01.300Z',
  address: '192.168.4.16',
  host: 'go-echarger_123456',
  port: 80,
  name: '123456',
  fullname: '123456._http._tcp.local.',
  txt: {
    serial: '123456',
    friendly_name: '123456',
    manufacturer: 'go-e',
    devicetype: 'go-eCharger_V4',
    version: '054.7',
    protocol: '2'
  },
  [Symbol(kCapture)]: false
}

So there is progress, for some reason nothing is discovered the the go-e manufacturer specific service. But now I can continue and add the condition to filter only go-e results and even that looks like working now. Oh, and the condition indeed is an array of arrays. Homey complains, if it isn’t.

2 Likes