Configuring Home Assistant is purely optional as this project will work great even without it. This guide assumes you already have a working and running Home Assistant server. If you don't, be sure to visit our Set up Home Assistant with a Raspberry Pi guide first.
Check Your Add-Ons
Start out by logging in and opening up your Home Assistant dashboard and checking that the File editor is installed.
As part of the setup, you should have an add-on either called configurator or File editor with a wrench icon next to it. Go ahead and select it.
If you don't see it, it may not be installed. You can find it under Settings → Add-ons → Add-on Store → File editor and go through the installation procedure.
If you already have it, but it's just not showing up, be sure it is started and the option to show in the sidebar is selected.
Creating a Switched Outlet
In order to control the switched outlet with Home Assistant, you'll want to add the following code to your configuration.
mqtt: switch: - name: "FanHouse" unique_id: "funhouse_outlet" command_topic: "funhouse/outlet/set" state_topic: "funhouse/outlet/state" payload_on: "on" payload_off: "off"
From the Developer Tools menu, you can check that the configuration is valid and click on Restart to load the configuration changes you made. You can just click Quick reload to reload any changes you made.
With the latest releases of Home Assistant, a LoveLace dashboard was added. If you haven't edited the Dashboard, it should automatically appear.
Otherwise, you may need to manually add a switch card to the dashboard.
The FanHouse switch should appear under your switches.
Turning the switch on should turn your FunHouse on and set the timer to the timeout value and turning it off should set the timer to zero and turn the funhouse off.
Troubleshooting
First, make sure you set MQTT = True
in the CircuitPython code. It will not send or respond to MQTT commands otherwise.
If you see the icons, but there is no data, it is easiest to start by checking the MQTT messages. Adafruit has a guide on how to use Desktop MQTT Client for Adafruit.io, which can be used for the Home Assistant MQTT server as well.
Go ahead and configure a username and password to match your MQTT server and connect. Under subscribe, you can subscribe to the #
topic to get all messages.
If you are seeing messages from the sensor, you may want to double check your Home Assistant configuration.
If you don't see any messages, you will want to follow the debugging section on the Code the Sensor page.
Page last edited March 08, 2024
Text editor powered by tinymce.