• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

EshamAaqib/NodeMcu-Esp8266-Homebridge-Switch: NODEMCU Homebridge Homekit Switch

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

EshamAaqib/NodeMcu-Esp8266-Homebridge-Switch

开源软件地址:

https://github.com/EshamAaqib/NodeMcu-Esp8266-Homebridge-Switch

开源编程语言:

C++ 100.0%

开源软件介绍:

NodeMcu Esp8266 Homebridge Switch

Introduction

This will give you a quick and easy way to add a NODEMCU to Apple's HomeKit on an iOS device. It opens up all sorts of possibilities including Scripts running on the server, combined with Apples HomeKit "Scenes", it makes for a powerful combo!

This is by no means a complete solution or ready for long term use but it demonstrates what's possible with a bit more work :)

What's needed:

  • NODEMCU ( ESP8266 Module )
  • Raspberry Pi or some other server
  • Solid State Relay or Normal relay with control circuit
  • Bread board - optional
  • Project Box
  • iOS device
  • Extension Lead to carve up

Installation

Step 1: Setup the Server

This project requires the use of a server to run the HomeBridge software. I used a Raspberry Pi as I had it readily available but in theory anything that can run Node.Js should work!

You can follow this guide here to get this up and running on a Raspberry Pi.

https://github.com/nfarina/homebridge/wiki/Running-HomeBridge-on-a-Raspberry-Pi

Once installed you need install a plugin and customise the config.json file

Step 2: Config and Plugins

Open your config.json file which should be in ~/.homebridge/config.json using your favourite text editor and add the following

{

"bridge": {

"name": "Homebridge",

"username": "CC:22:3D:E3:CE:30",

"port": 51826,

"pin": "031-45-154"

},

"platforms": [

],

"accessories": [

{

"accessory": "Http",

"name": "Living Room Lamp",

"on_url": "http://NODEMCU_IP:80/LED=ON",

"off_url": "http://NODEMCU_IP:80/LED=OFF",

"http_method": "GET"

}

]

}

You will also need to install the homebride-http plugin. The HomeBridge software will make HTTP GET requests to the NODEMCU which will then turn the Solid State Relay on or off. The call looks like this:

http://NODEMCU_IP:80/LED=ON

http://NODEMCU_IP:80/LED=OFF

To install the plugin type:

sudo npm install homebridge-http or sudo npm install -g homebridge-http

Step 3: Setup the Solid State Relay and the NODEMCU

Upload the code to the NODEMCU

Connect circuit as : NODEMCU GND --> Module pin - , NODEMCU 3v3 --> Module pin + , NODEMCU D4 --> Module pin S

All usual warnings apply when dealing with 120v/220v AC - TAKE CARE.

Customise your IP address as needed.

This should now be ready for testing.

Launch homebridge on the server! ( Just open up a terminal and type "homebridge" if it give an error try typing "sudo Homebridge"

Step 5: Test!

Now that everything is in place its time to test!

Download Elgatu Eve from the App Store on you iOS device.

You should see Homebridge as an accessory available to be connected. Use the pin number 031-45-154, this can be customised in the config.json file.

Once connected you can move this around within the App into the desired Room etc. Give Siri a test! It should be able to control the relay using voice!




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap