RackedPrice

Disclosure: We earn a commission from some links on this page. Details

Add a real button to Home Assistant

One press for "movie mode" or "goodnight", from a button you built.

Make and tinker1 hourEasy

Drafted with AI assistance, fact-checked and approved by RackedPrice.

  1. Plug a Qwiic Button into your Pi with a Qwiic cable.
  2. Install SparkFun's Qwiic Button Python library, linked from its page.

    Into the same sensors folder as our room sensor how-to sets up.

    ~/sensors/bin/pip install sparkfun-qwiic-button
  3. Run its example. Pressing the button prints a message.
  4. Send the press to Home Assistant over MQTT, like the room sensor does.

    Set up MQTT as in the room sensor how-to. Then publish a message like pressed to a topic like home/office/button each time it's pressed.

  5. In Home Assistant, make the press run a scene.

    Settings > Automations & scenes > Create automation. Trigger: MQTT, topic home/office/button. Action: Scene, activate, and pick yours.

Want every detail? Read the full guide

Build guide

Build the whole project

Temperature, humidity and real CO2 readings in Home Assistant from plug-in SparkFun sensors on a Raspberry Pi, plus an optional status screen and power monitoring.

Build Home Assistant room sensors with a Raspberry Pi (no soldering): every step and a priced parts list

Shopping (optional)

What you'll need

SparkFun doesn't share prices with us, so check the price on its page.

More make and tinker how-tos