…actually I know one, who is a huge fan of Raspberry Pi…it’s CHOCOLATE from the ConfigCat team 🙂
- Raspberry Pi 2/3 with:
- ConfigCat python SDK
- (‘GPIO Zero’ integration to any hardware) - optional
- ConfigCat subscription (free plan is enough :))
I use my board with Raspbian OS but you can use any distribution. I prefer it because it (usually :)) contains all necessary components for my pet projects. Read more about Raspberry Pi OS installation here.
Install ConfigCat SDK with pip:
By default the Raspbian desktop image contains the GPIO Zero package. On a different OS, you’ll have to use PIP:
- Create a feature flag
- Copy your SDK Key from the
Create a file (e.g. remoteswitch.py) with your favourite editor (I prefer nano) and implement the following code:
In line 9 you should add your own SDK KEY. This solution uses the ConfigCat SDK’s in manual polling mode. (Read more about polling modes here).
Run your code with the following:
Depending on the value of setting the program prints the actual value of your switch on the ConfigCat Dashboard and turns on/off the OutputDevice as well.
For the demonstration I created a simple circuit.
The components I have used:
- LED diode to show the switch status
- one resistor to limit the current (500Ω)
- two wires to connect to GPIO#3 port and a ground
- Raspberry Pi to serve power to the LED (you won’t need external power supply)
- Set up a program as a daemon (always run, after reboot)
- Apply this solution with any wireless power switch on your home