Python script adapting Yeelight bulbs as cue lights for Blackmagic ATEM switchers
Enterprise cue lights used by streaming companies or TV studios are way out of any amateur's budget. But the functionality is not that complicated after all. Since me and my friends provide streaming services, I began to think about a budget solution. First I thought about using some Arduino or ESP32 with red and green LEDs. It would however require a lot of other components as 5V LEDs would not be sufficient (not mentioning a 3D-printed enclosure with some sort of coldshoe adapter). I wanted more effortless solution – and then I came accross smartbulbs by Yeelight!
These smartbulbs are way cheaper than other brands (e.g. Phillips Hue or IKEA) and communicate over Wi-Fi, which is also handy because you don't need any ZigBee gateway. They also have a lot of trade-offs (tedious initial setup, not so strong light output...) but overall are absolutely awesome for this kind of project!
The whole system is being used and tested with our stream setup
Firstly, we need the bulbs. Here in CZE, they are a bit harder to find, still possible tho. See the following table of tested compatible bulbs:
Bulb type | Tested and working |
---|---|
Yeelight 1SE (color) | ✅ |
Yeelight W3 (color) | ✅ |
Yeelight M2 | ❌ not working ❌ |
There might be other types which I haven't been able to test, still W3 and 1SE are safe bets. Feel free to report other types.
As far as I know all Blackmagic ATEM switchers should be able to be compatible. Everything depends on Python library PyATEMMax which is derived from SKAARHOJ Arduino library (huge thanks to all contributors). However, as stated in the docs:
August 2018: The free open source SKAARHOJ provided Arduino Libraries will only work with
ATEM Software Control firmware versions up to 7.5.0.
(SKAARHOJs commercial products will work with ATEM Software Control firmwares beyond 7.5.0)
It might cease working with Blackmagic ATEM firmware update and nobody might be able to patch it. But for now, it works.
ATEM type | Firmware Version | Tested and working |
---|---|---|
Blackmagic ATEM Mini Pro | TBD | ✅ |
other ATEMs | ❓ | ❓ |
As mentioned, YeeCue is depended on PyATEMMax. In addition, it also uses Python YeeLight Library (again, huge thanks to contributors). Both libraries could be installed using pip
.
$ pip install yeelight
$ pip install PyATEMMax
The script has to be running on a PC/Mac within the same network all the bulbs and the ATEM are connected into.
The first task is to activate the bulbs and connect them to a single network. As far as I know, it has to be done via official Yeelight app. During the activation, the bulb has to send some data to the internet, therefore the LAN you are adding the bulb into, has to be connected to the internet.
- On your smartphone, download official Yeelight App (not the Mi Home)
- Connect your smartphone to the same network you wish to connect the bulb into
- In Yeelight App, add a new bulb following the instructions
- Once the procedure is done, be sure to turn on LAN control (it should be on by default). This is absolutely crucial, it allows you to control the bulb locally, even without the LAN connected to the internet
- Now it is very handy for the bulb to have a static IP. In your AP settings (probably somewhere in DHCP tab) assign this bulb a static IP.
Repeat for all the bulbs you wish to use. Regarding the IPs, assign them sequentially, the script won't work otherwise.
After you connect bulbs, ATEM and the PC/Mac into a single network, you can proceed and run the script. In Terminal or Command Line , cd
into the folder you downloaded the script. You can either run
$ python3 main.py
and go through the wizard filling the number of bulbs being used and all the IPs, or run
$ python3 main.py [n_bulbs] [ip_start] [ip_atem] (-v)
where n_bulbs
sets the number of bulbs being used, ip_start
is the last of nibble of first bulb's IP, ip_atem
is the last nibble of the ATEM's IP address. Optional -v
turns on verbose mode.
Let's say, I have three bulbs, the first one's IP address is 192.168.1.100
, the second has .101
, the third .102
. ATEM's IP address is 192.168.1.50
. My computer has IP within the same subnet, for example 192.168.1.7
. I can now run the script as
$ main.py 3 100 50 -v
Input 1 of the ATEM switcher will be then assigned to the first bulb 192.168.1.100
, input 2 to the bulb .101
and input 3 to the bulb .102
. If the video input is set to Preview, the corresponding bulb turns green. If the input is set to Program, corresponding bulbs turns red. Otherwise the bulb is turned off.
This project is very very much work in progress, I would like to develop a simple GUI for everyone to use. Of course feel free to fix my bugs or improve anything. This project is now on hold, since I have to finish my Master's project.