$ sudo apt-get install libavahi-compat-libdnssd-dev $ sudo apt-get autoremove nodejs $ wget http://nodejs.org/dist/latest/node-v7.6.0-linux-armv7l.tar.gz $ tar xzf node-v7.6.0-linux-armv7l.tar.gz $ sudo mv node-v7.6.0-linux-armv7l /usr/local/node-v7.6.0 $ echo 'export PATH=/usr/local/node-v7.6.0/bin:$PATH' >> ~/.bashrc $ source ~/.bashrc $ sudo npm install -g homebridge homebridge-irkit IRKit999A IRKit999A.local
$ curl -i "http://irkit999a.local/messages" -H "X-Requested-With: curl" HTTP/1.0 200 OK Access-Control-Allow-Origin: * Server: IRKit/3.0.0.0.g85190b1 Content-Type: text/plain {"format":"raw","freq":38,"data":[...]} vi ~/.homebridge/config.json { "bridge": { "name": "Homebridge", "username": 00:00:00:00:00:00, "port": 51826, "pin": "031-45-154" }, "description": "IRKit Control", } "accessories": [ { "accessory": "IRKit", "name": " ", "irkit_host": "IRKit999A.local", "on_form": {"format":"raw","freq":38,"data :[ ]}, "off_form": {"format":"raw","freq":38,"data :[ ]} } ] IRKit999A.local
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi. *** WARNING *** Please fix your application to use the native API of Avahi! *** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node> *** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi. *** WARNING *** Please fix your application to use the native API of Avahi! *** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=dnsserviceregister> [2017-2-27 19:50:12] Loaded plugin: homebridge-irkit [2017-2-27 19:50:12] Registering accessory 'homebridge-irkit.irkit' [2017-2-27 19:50:12] --- [2017-2-27 19:50:12] Loaded config.json with 1 accessories and 0 platforms. [2017-2-27 19:50:12] --- [2017-2-27 19:50:12] Loading 1 accessories... [2017-2-27 19:50:12] [ ] Initializing IRKit accessory... Scan this code with your HomeKit App on your ios device to pair with Homebridge: 031-45-154 [2017-2-27 19:50:12] Homebridge is running on port 51826.
$ sudo apt install supervisor $ sudo vi /etc/supervisor/conf.d/homebridge.conf [program:homebridge] command=/usr/local/bin/homebridge --user-storage-path /home/pi/.homebridge user=pi autorestart=true stdout_logfile=/var/log/homebridge.log stdout_logfile_maxbytes=1mb stdout_logfile_backups=5 stdout_capture_maxbytes=1mb redirect_stderr=true $ sudo supervisorctl update homebridge: added process group $ sudo supervisorctl status homebridge RUNNING pid 2080, uptime 0:00:05
$ curl -i "http://irkit999a.local/keys" -d "" -H "X-Requested-With: curl" HTTP/1.0 200 OK Access-Control-Allow-Origin: * Server: IRKit/3.0.0.0.g85190b1 Content-Type: text/plain {"clienttoken":"the_client_token"} $ curl -i -d "clienttoken=the_client_token "https://api.getirkit.com/1/keys" HTTP/1.1 200 OK Server: openresty Date: Mon, 27 Feb 2017 11:52:56 GMT Content-Type: application/json; charset=utf-8 Content-Length: 94 Connection: keep-alive Access-Control-Allow-Origin: * Access-Control-Allow-Headers: X-Requested-With X-Content-Type-Options: nosniff {"deviceid":"the_device_id","clientkey":"the_client_key"}
$ curl -i "https://api.getirkit.com/1/messages?clientkey=the_client_key&clear=1" HTTP/1.1 200 OK Server: openresty Date: Mon, 27 Feb 2017 11:58:01 GMT Content-Type: application/json; charset=utf-8 Content-Length: 1076 Connection: keep-alive Access-Control-Allow-Origin: * Access-Control-Allow-Headers: X-Requested-With ETag: "-718207882" X-Content-Type-Options: nosniff {"message":{"format":"raw","freq":38,"data":[...]},"hostname":"irkit999a","deviceid":"the_device_id"}
Trigger: You enter an area Action: Make a web request URL: https://api.getirkit.com/1/messages Method: POST Content-type: application/x-www-form-urlencoded Body: clientkey=the_client_key&deviceid=the_device_id&message={"message":{"format":"raw","freq":38,"data :[ ]}, hostname":"irkit999a","deviceid : THE_DEVICE_ID }