To use everything, you will want to make sure your Home Assistant instance is up and running. Next you will want to make sure your MacroPad is running its code. You can use a serial console to see that it is "Waiting for Server".

You can then start the server by going to the folder containing the file rpc_ha_server.py and typing the following:

python3 rpc_ha_server.py

The MacroPad should connect and, if everything is configured correctly, you should be able to control your lights.

Code Walkthrough

The code is broken down into three main pieces. Because the code is a bit complex, it is separated into a separate page.

This guide was first published on Aug 11, 2021. It was last updated on Jul 29, 2021.

This page (Running the Code) was last updated on Aug 10, 2021.

Text editor powered by tinymce.