Discovery Broadcast

The discovery broadcast can be used to find and identify CEMMs in the local network. The broadcast works by sending a UDP message to the broadcast IP of the network on port 9777. The data should be an utf-8 encoded string “cemm_query”. Each CEMM with core version 1.23 and above will respond to this query with an answer containing information about the CEMM, see the example response below.

    "ip": "",
    "mac": "00:1E:C0:85:96:CC",
    "version": "1.24",
    "type": "CEMM_basic",
    "init_state": 1


A very basic Python implementation to execute the broadcast might look like:

import socket
import time

query_str = b"cemm_query"
broadcast_wait = 5
server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
server.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
server.bind(("", 9777))
start = time.time()
server.sendto(query_str, ("", 9777))
while time.time() < start + broadcast_wait:
        data, addr = server.recvfrom(1024)
        if data == query_str:
            print("%s:%s >>> %s" % (addr[0], addr[1], data))
    except socket.timeout:

This script will output: >>> b'{"ip": "", "mac": "D8:80:39:46:22:B5", "version": "1.23", "type": "CEMM_basic", "init_state": 1}' >>> b'{"ip": "", "mac": "00:1E:C0:85:96:CC", "version": "1.24", "type": "CEMM_basic", "init_state": 1}'