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.
My Custom-Command, InfraredRunnable, controls some infrared home devices.
You can enjoy controlling your infrared home devices, a ceiling light, an air conditioner, or more joyful devices on Apple Home app on iPhone or Siri, using RunnablePlatform and your Custom-Command.
- Development Webpage: https://github.com/patineboot/runnable-platform
- Publishing Webpage: https://www.npmjs.com/package/homebridge-runnable-platform
RunnablePlatform supports:
- All Service Types of Homebridge.
- All Characteristics of Service Types on Homebridge.
e.g., My Custom-Command, InfraredRunnable, support LightBulb, Heater Cooler, Humidifier Dehumidifier, Humidity Sensor, Light Sensor, Temperature Sensor. You can create a Custom-Command supports all sorts of Homebridge API Service Types with all Characteristics.
Search patineboot's RunnablePlatform with the "RunnablePlatform" word on Homebridge.
Install RunnablePlatform you found on Homebridge.
The example of the element of RunnablePlatform on config.json.
{
"platform": "RunnablePlatform",
"name": "RunnablePlatform",
"run": "/var/opt/infrared-runnable/runnable.py",
"time": 300,
"accessories": [
{
"name": "DimLight",
"service": "Lightbulb",
"characteristics": [
"On",
"Brightness"
]
},
]
}
The RunnablePlatform platform element.
Attribute | Type | Description |
---|---|---|
platform | string | Set "RunnablePlatform" only. |
name | string | Set "RunnablePlatform" only. |
run | string | Input the absolute path of the Custom-Command to control the infrared home devices. |
time | number | Input the millisecond time to finish handling a JSON message on the Custom-Command. |
accessories | array of any type | See the following accessories element of RunnablePlatform |
The accessories element of RunnablePlatform.
Attribute | Type | Description |
---|---|---|
name | string | The name of an infrared home device. |
service | string | The service type of the infrared home device. |
characteristics | array of string | The characteristics of the service. |
Refer to Homebridge Service Types:
Get service and characteristics, e.g., Heater Cooler:
-
Visit Heater Cooler
-
Find the service name of Heater Cooler on the Example code. Get the service name, HeaterCooler, from the 'this.Service.HeaterCooler' code snippet.
// create a new Heater Cooler service this.service = new this.Service(this.Service.HeaterCooler);
-
Get the Characteristics
- Find 'Required Characteristics' and 'Optional Characteristics.'
- Click the Active link to Characteristic.
- Get the name, Active, from the 'Characteristic.Active' on the Name item.
RunnablePlatform and Custom-Command communicate through Custom-Command’s standard input and output with each other.
Custom-Command should have the two features:
- Send infrared codes to infrared home devices
- Post and Receive a JSON message to RunnablePlatform
The JSON message format on the standard input and output:
Attribute | Type | Description |
---|---|---|
method | string | Set 'SET' only. |
name | string | The name of your infrared home device . |
characteristic | string | The characteristic will change the new value. |
value | string | The new value of the characteristic. |
status | array of any | The current characteristics of the device specified with name attribute. |
e.g., the JSON message that RunnablePlatform turns on the 'Your Light' Lightbulb.
Custom-Command's standard input:
RunnablePlatform --[JSON message]-> Custom-Command
{
"method": "SET",
"name": "Your Light",
"id": 1,
"characteristic": "On",
"value": true,
"status": {
"On": false,
"Brightness": 100,
"ColorTemperature": 500,
"Hue": 360,
"Saturation": 100
}
}
{
"method": "ACK",
"name": "Your Light",
"id": 1,
"status": {
"On": true,
"Brightness": 100,
"ColorTemperature": 500,
"Hue": 360,
"Saturation": 100
}
}
e.g., the JSON message that the 'Your AirConditioner' HeaterCooler notifies the current temperature.
Custom-Command's standard output:
Custom-Command --[JSON message]--> RunnablePlatform
{
"method": "SET",
"name": "Your AirConditioner",
"characteristic": "CurrentTemperature",
"value": 20
}
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 |
A ceiling light | Panasonic | LightBulb |
A ceiling light | Panasonic | LightBulb |
An air-conditioner | N/A | HeaterCooler |
InfraredRunnable involves some useful files:
-
codes.json
involves some infrared codes of 'cgir.' -
example.install_runnable.sh
installs InfraredRunnable on Ubuntu Linux.
Run the install script after changing masked asXXX
to your sensitive information of the devices or some.
Homebridge UI provides Swagger:
-
Swagger URL
http:// [homebrdige domain or IP] /swagger -
The cached accessories URL
We get the current state of 'the cached accessories' on
http:// [homebrdige domain or IP] /swagger/static/index.html#/Homebridge/ServerController_getCachedAccessories
-
I may add the new communication to RunnablePlatform.
- RESTful API
- GET - get the state of RunnablePlatform accessory on the Homebridge.
- POST - notify the state to the Homebridge
Memo: We already get 'the cached accessories' with Swagger on Homebridge.
- Web socket
RunnablePlatform sends the state to change by user interaction on Apple Home app or Siri.
- RESTful API
-
RunnablePlatform supports updating the properties for some characteristics in the future.
{ "method": "PROPERTY", "name": "My Temperature", "characteristic": "TargetTemperature", "properties": [ "minValue": "18", "maxValue": "30", "minStep": "1" ] }
RunnablePlatform is running as Homebridge Plugin.
My Custom-Command, InfraredRunnable, is running but not limited:
They created a nice Raspberry Pi HAT, RPZ-IR-Sensor, and good tools, 'cgir and cgsensor.'
@IndoorCorgi's 'RPZ-IR-Sensor': https://www.indoorcorgielec.com/products/rpz-ir-sensor/
I strongly recommend RPZ-IR-Sensor to send infrared codes because of my good experience.
Homebridge and its Organization Collaborators
Overall, The Verified By Homebridge program is a FRAUD.
I solved my plugin soon from the requests of @donavanbecker.
@donavanbecker respond very late and is ignoring the import bug at Homebridge.
The member of Homebridge replied very late every time, and 3 months later, finally, He ignored my proposal.
Bit Trade One, LTD. (ADRSIR design, manufacturing, and sales) provides NO supports and the USELESS scripts. Bit Trade One provides bad and poor deliverables.
- Update
- Update the value of 'version' on
package.json
. - Update the
package-lock.json
.rm -rf node_modules rm package-lock.json npm install ../runnable-platform/
- Update the value of 'version' on
- Login
npm asks
npm login
Username: patine Password: <your password> Email: (this IS public) <your email address> Enter one-time password: <one time password on received email>
- Publish
npm publish
- Logout
npm logout
-
Clone
git clone https://github.com/patineboot/runnable-platform.git
-
Install
sudo npm --location=global install ./runnable-platform/