Close
0%
0%

Desk Control Panel

A custom macro-pad with screen and rotary encoder for controlling my PC and office smart-devices.

Similar projects worth following
A simple "macro-pad" with a small display and rotary encoder for sending arbitrary signals to my PC, and "host" software which listens for those signals and sends commands (key strokes, calls to Home Assistant, etc).

My Streamdeck recently died on me, leaving me without a convenient way to toggle the lights/fan in my office (among other things). Instead of buying a replacement, I decided to try and built one myself, without the button displays, but with another feature I think I'll end up preferring in the long run.

A year or two ago I picked up a new curved, ultrawide monitor, and discovered when I got home that my monitor arm was not up to the task of keeping it vertical.  It could keep it off the desk, but it would droop and slowly lean forward.  Instead of buying a stronger monitor arm, I opted to design and print a set of modular organizers that fit underneath the monitor and help support the weight. I wanted my new control pad to be built inside one of these modules.

For the electronics I started with an Arduino Uno. After some breadboard prototyping of the individual components, I switched to a protoboard shield which I could add and remove from the Uno.  Fairly happy I went this route, as the Uno didn't end up working out, and this means I don't have to desolder it from a normal protoboard or something to get it back out to use for something else.

Read more »

  • Shift to WiFi/MQTT Communication

    Tim S7 days ago 0 comments

    As I've gotten deeper into home-assistant, I decided I wanted to change how my desktop control panel communicated with the PC, and other smart-home things. 

    I have reworked a lot of the code so that it no longer relies on serial communication; instead, it uses the WiFiManager library to let the user specify an SSID and password, along with some MQTT configuration. Once a connection is established to the WiFi, it tries to connect to the MQTT broker. Assuming both of those things are successful, instead of sending serial messages in response to inputs, it sends messages to topics in MQTT.

    As an added bonus, since I'm connected to WiFi anyway, it can just sync the time with NTP instead of relying on periodic serial messages to update the clock.

    Since I want to use it with Home Assistant, the first thing it communicates over MQTT is a discovery message. This lets Home Assistant identify the device, and know what inputs to expect. In this case, five timestamp sensors (one for each button), and one generic sensor that stores the last action taken via the dial. Then in Home Assistant I can listen for changes on those sensors, and perform automations accordingly.  For my setup, one of the buttons triggers an automation to toggle the lights in my office, and another toggles the fan (both are operated via smart switches).

    The remaining buttons I wanted to continue to use to trigger hotkeys on my PC. To enable this, I wrote a simple background service in python. The service, much like the device, connects to the MQTT broker and sends a discovery message. This one, however, provides several virtual "buttons" which can be pressed manually or via automations in Home Assistant. From there it is fairly trivial to set up automations to respond to changes in one of the timestamp sensors by "pressing" the appropriate virtual button.

    For the most part, the change in functionality is pretty minimal. The clock display got a minor update in the process (to include day/month), and the device can be plugged into any USB power supply, instead of needing to use a port on the PC itself. But it means that re-binding the buttons to new behaviors isn't going to require code changes/re-programming the device, just some changes to HA automations. 

View project log

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates