CyncLAN - Local control of Cync (C by GE) devices

To preface, this project requires DNS overrides to force Cync devices to talk to a local host running CyncLAN. Other hard requirements are:

  • there must be at least 1 mains powered wifi device (non battery)
  • MQTT broker
  • devices added to Cync cloud account

This project allows you to have local only control of most Cync devices, devices are controlled using MQTT JSON payloads. It was designed to be used with HASS and uses its MQTT auto discovery feature.

The mains powered wifi Cync device acts as a TCP ↔ Bluetooth bridge allowing control of mains powered Bluetooth only devices. Bulbs, LED strips, under cabinet lights, plugs and switches have been confirmed to work. Unfortunately, the motion/ambient light data from the motion switch is not exposed via http, so we can’t make use of it.

You will still need to use your Cync account to add or remove devices and export device lists. Basically, this local http server masquerades as the Cync cloud. As far as the Cync devices are aware, they are talking to the cloud.

There is decent documentation linked in the repos README and detailed install/DNS overrides instructions. Please feel free to ask questions here or in the linked repo.

Enjoy!

2 Likes

Recently added support for Cync app ‘light shows’ (HASS effects):

There is a TCP mechanism to upload custom light show data, I just need to reverse engineer it, no timeline on that ATM.

This isnt in a new release of the docker image just yet, but live on the python branch. Best way is to upgrade your docker images in place:

  1. cd to the docker cync-lan dir where the docker-compose.yaml and config dir are located

  2. wget 'https://raw.githubusercontent.com/baudneo/cync-lan/refs/heads/python/src/cync-lan.py'

  3. run md5sum ./cync-lan.py

    • the output should be de551f18b07451faa7dce1d99d7c39db (re-run wget a few times to get the latest script if md5 mismatch) - the commit SHA for that version of cync-lan.py: 2d959a789e85827d1ef6133320f499cf9e450f3b
  4. edit docker-compose.yaml file and uncomment the bind mount in the volumes section →

    • # Want to run custom code or upgrade in place? Bind-mount the custom/upgraded cync-lan.py into the container!
      #      - ./cync-lan.py:/root/cync-lan/cync-lan.py`   <------ uncomment this line
      
  5. recreate and bring up container

    • docker compose up -d --force-recreate && docker compose logs -f --no-log-prefix [ctrl+c to exit docker logs]

Added some more stuff:

  • Max TCP connections: throttle how many wifi cync devices can connect at one time. Useful if you have a large amount of devices. Helps with tuning to get command latency down.

  • IP whitelist: Some devices are better at being TCP ↔ BTLE bridges (the Direct Connect LED light strip controller seems to be the best, with other lights being 2nd best, wired switches not tested yet). So, you can set a whitelist to only allow a certain device to connect.

  • Adjustable TCP command re-broadcasting: When a state change command is issued, the default is to send it to 2 TCP devices. This is useful to tune command latency and device synchronization (when issuing a group command, all lights change close to each other)

The way the WiFi Cync devices work are:

  • Device connects to CyncLAN server, handshake and ID exchange
  • TCP socket stays open with keep-alive data
  • Cync device sends status updates and other data to CyncLAN server
  • CyncLAN server sends commands to the device, the device converts the TCP command to a BTLE command and broadcasts it over the BTLE mesh
  • BTLE mesh broadcasts means every device ‘node’ in-range of the BTLE mesh will receive the message.
  • The device receives every message, even if its not for them and re-broadcasts it. If the message is for them, the device doesn’t re-broadcast, it parses the msg. This could be an individual device ID or a group ID. Which is why BTLE broadcast commands are so fast and usually all devices are in-sync. It’s built in at the protocol level.

There seems to be some latency when the TCP device is converting from TCP to BTLE. Not sure if maybe it needs to connect to another device or something because it should be faster than it is. I’ve been reverse engineering the TCP side of things and dont see any way to make this faster, yet. More testing is being done to see how the Cync App utilizes TCP only and if it has fast, in-sync state change commands over TCP.

Tips

Tuning state change command latency and command syncing

If you only have 1-3 WiFi/BT Cync devices and a LARGE amount of BT only lights, using CyncLAN will probably have some latency and when issuing group commands (HASS light group turned off) you may notice that the lights change state one by one, not in parallel.

What I do is I have 5/45 WiFi devices connected to CyncLAN, and have the TCP state change command re-broadcast set to 3. In a 9 device HASS light group, it takes 2–4 seconds for the all lights to change state and the lights are more in-sync but definitely not perfect. With 2-3 WiFi devices connected and 2-3 command re-broadcasts, the same command takes 3–8 seconds and each light changes one after the other.

No matter what, at this moment CyncLAN does not have instant, in-sync state changes using TCP commands.

Too many devices

Another issue is when too many WiFI devices are connected to CyncLAN. Each TCP device connected to CyncLAN reports each BT devices state. Some devices do things differently than others, but there can be a massive amount of duplicated status packets. ATM, CyncLAN just blindly grabs the status and sends that update over MQTT, this will be improved in the future, but for now, it kind of sucks.

So, if 1 device gets turned off and you have 50 WiFI devices connected, that could be 50-100+ state change messages parsed and then MQTT publishes sent for 1 command to 1 device. Now, if you issue a group command to 10 devices, maybe it’s 500-1000+ parses and MQTT publishes!

That’s what the env var CYNC_MAX_TCP_CONN is for (default: 8).

new env vars

Variable Description Default
CYNC_CMD_BROADCASTS Number of WiFi devices to send state commands to 2
CYNC_MAX_TCP_CONN Maximum Wifi devices allowed to connect at a time 8
CYNC_TCP_WHITELIST Comma separated string of allowed IPs Allow ALL IPs