irMagician is used by Siri
- Introduction
Mini-board-computers are released in year by year. Current board will be obsolete soon. - What they can ?
Actual Home Automation (HA) system is realized by Raspberry + irMagician, operated by Siri. Originally, HomeKit is Home Automation solution by corresponding equipment such as Philips Hue. However, not matured so far. At voluntary base, node.js implementation is released. - RaspberryPi setting
Required internet connected RaspberryPi
irMagician needs following setting from Raspbian-pixel(2016/Sep/16) release- /boot/cmdline.txt から
Delete “console=serial0,115200″ statement
- reboot
After above, Check ttyACM0 by “ls /dev/ttyACM0″
- /boot/cmdline.txt から
- System update
Following commands should be updated- sudo apt-get update
- sudo apt-get upgrade
You can take break by completing update
- Install git
Following command
- sudo apt-get install git
- pythonの設定 Configure python
Raspbian has python originally. Should be installed serial-plugin for using irMagician. pyserial can be installed following commands,
- sudo apt-get install python-pip
- sudo pip install pyserial
- Install irm.py
irm.py is script for using irMagician from python. netbuffalo (as lead-partner) contributed.- git clone https://github.com/netbuffalo/irmcli.git
#web-master preferes to rename from irmcli.py to irm.py
- Capture ir command data
Several ir command data are provided, however if you can not find out your required data, you have to capture by your self.
- python irm.py -c
Capture data.
- python irm.py -p
Try to use captured ir command data actually.
- python irm.py -f -s “filename.json”
Save it, if no problem.
- python irm.py -c
- git clone https://github.com/netbuffalo/irmcli.git
- Install node.js
- sudo apt-get install -y nodejs npm
Install node.js normally.
- sudo npm cache clean
- sudo npm install n -g
- sudo n stable
web-master did above operation for set-up node.js.
- sudo apt-get install -y nodejs npm
- Install homebridge
- sudo apt-get install libavahi-comat-libdnssd-dev screen
Install required libraries.
- sudo npm install -g homebridge –unsafe-perm
Some options will be required for installation
- sudo apt-get install libavahi-comat-libdnssd-dev screen
- Install homebridge-cmd
- sudo npm install homebridge-cmd -g
command line can be operated by this plug-in
- sudo npm install homebridge-cmd -g
- homebridgeの設定
- config.jsonの設定
1234567891011121314151617181920212223242526{"bridge": {"name": "irMagician with HomeKit","username": "DC:FB:02:58:4A:C4","port": 51821,"pin": "031-45-155"},"description": "Papa's room","platforms": [],"accessories": [{"accessory": "CMD","name": "電気","on_cmd": "sudo python /home/pi/.homebridge/data/irm.py -p -f /home/pi/.homebridge/data/LightOn.json","off_cmd": "sudo python /home/pi/.homebridge/data/irm.py -p -f /home/pi/.homebridge/data/LightOff.json"},{"accessory": "CMD","name": "コンセント","on_cmd": "sudo python /home/pi/.homebridge/data/irm.py -p -f /home/pi/.homebridge/data/OutletOn.json","off_cmd": "sudo python /home/pi/.homebridge/data/irm.py -p -f /home/pi/.homebridge/data/OutletOff.json"}]}
- Check MAC address of wifi-device
use ifconfig command. MAC address will be displayed non-capitalized (lowercase). Should be capitalized then describe in config.json
- “Tips: Use your mother-tongue’s word in “name”.
web-master is a Japanese. I have tried to described “light” in “name”. However, could not recognized. Changed from “light” to “電気(denki)” in name. Siri can recognize.
- Describe your target command in “on_cmd” and “off_cmd”.
Describe command following your environment.
- Check MAC address of wifi-device
- config.jsonの設定
- Future
Should be improved user interface for setup.
- Reference URL
Many thanks !!