Making Smart Remote of Raspberry Pi Zero WH
By Patineboot

Connecting Apple Home app with RunnablePlatform
Overview
- Prepare Hardware.
- Install Software.
- Boot Raspberry Pi Zero.
- Install Homebridge.
- Install RunnablePlatform.
- My Custom-Command, InfraredRunnable.
- Use Smart Remote with Siri.
- Misc Homebridge Plugin.
- deCONZ and Homebridge Hue.
- homebridge-dyson-link.
Prepare Hardware
Purchase the hardware parts of the Smart Remote listed below.
- Raspberry Pi Zero WH with Case
Raspberry Pi Zero is a small computing board. - RPZ-IR-Sensor RPZ-IR-Sensor is a HAT for the Raspberry Pi series.
- A Micro-B USB cable and a charger.
- A ZigBee gateway.
Install Software
Install the following software programs in later steps.
- Homebridge: support the HomeKit protocol running on ’node.js.'
- Plugins
- Homebridge-Hue: exposes the Smart Remote to HomeKit ZigBee devices.
- homebridge-dyson-link: controls Dyson Link devices.
- Plugins
- RunnablePlatform: Patineboot has been developing RunnablePlatform.
- InfraredRunnable: Patineboot has been developing InfraredRunnable.
Boot Raspberry Pi Zero
I wrote the article about setting up the Raspberry Pi series.
Read the past article titled Booting Raspberry Pi OS using Raspberry Pi Imager.
Install Homebridge
Node.js
Use unofficial Node.js built for linux-armv6 in Experimental status because of the ARMv6 CPU instruction set in Raspberry Pi Zero WH. The unofficial Node.js is on Node.js unofficial-builds project.
Download the install script for Node.js binaries from the install-node.now.sh URL.
Run the install script with the BASE_URL variable set as the “Node.js unofficial-builds project” URL.
curl -sL install-node.now.sh/lts -o node.sh
chmod +x node.sh
sudo BASE_URL=https://unofficial-builds.nodejs.org/download/release ./node.sh
Homebridge
Homebridge emulates Raspberry Pi Zero WH as HomeKit. Homebridge Config UI X provides the administrator pages for configuring Homebridge.
Patineboot recommends installing Homebridge Config UI X.
-
Install Homebridge with the Homebridge Config UI X plugin.
sudo npm install -g --unsafe-perm homebridge homebridge-config-ui-x
-
Run Homebridge service by the pi user.
sudo hb-service install --user pi
Patineboot recommends running the Homebridge service on the pi user account because
hb-service
changes UNIX permissions of Homebridge files to only accessible by the running user.
FYI: ‘hb’ of hb-service
stands for HomeBridge.
Install RunnablePlatform
RunnablePlatform
RunnablePlatform is the Homebridge plugin that connects many infrared home devices with Homebridge using Custom-Command.
RunnablePlatform and Custom-Command communicate through Custom-Command’s standard input and output with each other.
Install RunnablePlatform on Homebridge.
-
Visit the administrator page:
http:// [IP address or Domain of Raspberry Pi] :8581 -
Move to the Plugins page with the ‘Plugins’ link on the upper of the administrator page.
Searching RunnablePlatform on the Plugins page
Search the “RunnablePlatform” word on the Plugins page, find and install patine’s RunnablePlatform.
Custom-Command
Program your Custom-Command that communicates with RunnablePlatform sends some infrared codes to your infrared home devices.
Custom-Command should have the two features:
- Send infrared codes to infrared home devices
- Post and Receive a JSON message to RunnablePlatform
See my Custom-Command for your programming, visit ‘RunnablePlatform Development’ and find my Custom-Command named InfraredRunnable.
My Custom-Command, InfraredRunnable
Introduce
My Custom-Command, InfraredRunnable, sends some infrared codes registered previous to my infrared home devices with RPZ-IR-Sensor.
InfraredRunnable uses hardware and software:
- RPZ-IR-Sensor: is an infrared sender of the Raspberry Pi HAT.
- cgir: is a tool in Python to control RPZ-IR-Sensor.
- cgsensor: is a tool to get the sensor data from RPZ-IR-Sensor.
My list of infrared home devices:
Product Name | Constructor | Service Type |
---|---|---|
RPZ-IR-Sensor | Indoor Corgi | HumiditySensor and TemperatureSensor |
Serene | Francfranc | HumidifierDehumidifier |
A ceiling light | Panasonic | LightBulb |
A ceiling light | Panasonic | LightBulb |
An air-conditioner | N/A | HeaterCooler |
RPZ-IR-Sensor into Raspberry Pi Zero WH
Push the RPZ-IR-Sensor’s pin socket into the Raspberry Pi Zero’s pin header.

RPZ-IR-Sensor into Raspberry Pi Zero WH
Install ‘cgir’ and the depending ‘pigpio’
-
Install the ‘pigpio’ library, start and register the ‘pigpio’ service as an auto-start service on boot.
sudo apt install pigpio sudo systemctl enable --now pigpiod.service
-
Install the
cgir
andcgsensor
applications.
Installpip3
with thesudo apt install python3-pip
command ifpip3
is not installed.sudo pip3 install cgir cgsensor
-
Improve the ‘pigpiod’ service.
Patineboot confirmed the
pigpiod
command consumed its CPU usage with thetop
command.Add the -m option followed to the
pigpiod
command on the pigpiod service file to reduce the CPU usage.The line of the
pigpiod
command with added the -m option on /lib/systemd/system/pigpiod.service:# the command line of sending infrared codes ExecStart=/usr/bin/pigpiod -l -m
Note: effect only it when sending infrared codes. Other times, e.g., capturing infrared codes, should remove the -m option.
Install InfraredRunnable
Patineboot has been developing InfraredRunnable, enjoying many scenes at Patineboot’s home.

Developing Infrared on the RunnablePlatform GitHub pages.
-
Visit the InfraredRunnable Software page.
-
Clone RunnablePlatform to the local machine.
git clone https://github.com/patineboot/runnable-platform.git
-
Run the example.install_runnable.sh file.
installs InfraredRunnable on Ubuntu. Run the install script after changing masked as XXX to your sensitive information of the devices or some.
cd runnable # edit changing masked as XXX to your sensitive information of the devices or some nano example.install_runnable.sh ./example.install_runnable.sh
To learn more details about InfraredRunnable, visit the InfraredRunnable Software page.
Use Smart Remote with Siri
- Visit the administrator page:
http:// [IP address or Domain of Raspberry Pi] :8581 - Read the 2D barcode on the upper left of the administrator page using Apple Home app on iPhone.
- Control your home devices with Home App on iPhone or say what you want to do with the Smart Remote following sentence “Hey Siri.”

The image that Apple Home App launches RunnablePlatform
Misc Homebridge Plugin
deCONZ and Homebridge Hue
deCONZ provides RESTful APIs for lights, sensors, and switches.
See more details on ConBee II Software.
-
Install deCONZ
See the installation steps of deCONZ for Raspbian.
Information: Patineboot is running deCONZ on Raspberry Pi Zero WH. -
Headless deCONZ
Headless deCONZ means GUI-free and auto-start deCONZ.
Register thedeconz
service in the auto-start service, disable the deCONZ GUI service.# enable the deCONZ service sudo systemctl enable deconz # disable the deCONZ GUI service. sudo systemctl disable deconz-gui sudo systemctl stop deconz-gui
References: deCONZ REST plugin.
-
Change the HTTP port of deCONZ
deCONZ provides the –http-port option to change the HTTP port of the Phoscon web app.
Add –http-port=8080 following the deCONZ command on:
/lib/systemd/system/deconz.service -
Reduce the CPU usage of deCONZ
deconz-update.service and deconz-wifi.service consume too much CPU usage.
Comment out the Wants line on:
/lib/systemd/system/deconz.serviceWants=deconz-init.service deconz-update.service ↓ # Wants=deconz-init.service deconz-update.service
Disable deconz-update.service and deconz-wifi.service, restart deconz.service.
sudo systemctl stop deconz-wifi sudo systemctl disable deconz-wifi sudo systemctl stop deconz-update sudo systemctl disable deconz-update sudo systemctl restart deconz
-
Link Homebridge Hue to the Phoscon App
Search “Homebridge Hue” on the ‘plugins’ page of Homebridge UI X and install ebaauw’s Homebridge Hue.
The Phoscon App already is waiting on:
http:// [IP address or Domain of Raspberry Pi] :[80 or your specified ort number]
See the request to push the Link button on the Phoscon App on the log view of Homebridge if you have not define the users element on config.json of the Homebridge Hue yet.
config.json of Homebridge for Homebridge Hue.
{ "name": "Hue", "anyOn": true, "effects": true, "hosts": [ "<IP address or Domain of Raspberry Pi>: <Port number>" ], "lights": true, "resource": true, "platform": "Hue", "users": { "<the users attribute>": "<the users value>" } }
homebridge-dyson-link
Search “Homebridge Dyson Link” on the ‘plugins’ page and install joeng’s Homebridge Dyson Link.
config.json of Homebridge Dyson Link.
{
"platform": "DysonPlatform",
"name": "DysonPlatform",
"accessories": [
{
"displayName": "DysonFan",
"ip": "DYSON-IP",
"serialNumber": "DYSON-SERIALNUMBER",
"password": "DYSON-PASSWORD",
"focusModeVisible" : false
}
]
}
Replace DYSON-IP, DYSON-SERIALNUMBER, and DYSON-PASSWORD with the sensitive information of your own Dyson Fan.
Value Name | Description |
---|---|
DYSON-IP |
IP address or Domain name you assigned to Dyson Fan. Maybe static IP address. |
DYSON-SERIALNUMBER |
Wi-Fi SSID of your own Dyson Fan. |
DYSON-PASSWORD |
Wi-Fi Password of your own Dyson Fan. |
Confirm Wi-Fi SSID and Password assigned to your Dyson fan with the seal on the Dyson fan manual.
Software Programs and Versions
RunnablePlatform: 0.9.0 is developed by Patineboot.
RunnablePlatform and InfraredRunnable are running with the following programs and versions.
- Raspberry Pi OS: GNU/Linux 10 (buster) 10.11
- Python: 3.7.3
- cgir: 1.0
- cgsensor: 1.0
- Node.js: 16.13.2
- Homebridge: 1.4.0
- Homebridge UI: 4.42.0
- Homebridge Hue: 0.13.36
- Homebridge Dyson Link: 2.5.6
References
-
RunnablePlatform
Patineboot has been developing the Smart Infrared Remote.
Reference: https://github.com/patineboot/runnable-platform. -
‘cgir’ and ‘cgsensor’ tools and RPZ-IR-Sensor
The extended HAT on Raspberry Pi to send/receive infrared codes and get data from the sensors.
Reference: https://www.indoorcorgielec.com/products/rpz-ir-sensor/. -
Install Homebridge on Raspbian
The official steps to install homebridge on Raspberry Pi OS.
Reference: https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-Raspbian. -
The installation steps of deCONZ for Raspbian
The Phoscon App and deCONZ provide RESTful APIs accessing Zigbee hardware.
Reference: https://phoscon.de/en/conbee2/install#raspbian -
Homebridge Dyson Link
The reference configuration for Homebridge Dyson Link.
Reference: https://github.com/joe-ng/homebridge-dyson-link.