In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the raspberry pie how to build Homebridge components home control center, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand.
Homebridge is a lightweight NodeJS server that simulates iOS HomeKit API and provides basic bridging of a variety of third-party API from HomeKit to "smart home" device manufacturers. Through Homebridge bridging, you can let Siri control devices that do not support HomeKit at all.
Hardware equipment: raspberry pie 3B, ESP8266, ws2812 light belt, relay
Software: homebrigde server, mqtt server, arduino IDE
Basic functions: use Iphone voice or software to control lamp belt, relay switch, table lamp.
Configuration process:
1) download the raspbian_lite image containing homebridge and burn it to raspberry pie 3B; after the raspberry pie is powered on, there will be an open hot spot of homebridge when you turn on the wireless connection on the phone; when you connect to this hotspot, you will be prompted to connect to the wireless at home. After entering the wireless account password, the mobile phone turns on the current hot spot. At the same time, the raspberry pie will connect to the wireless hotspot just configured. This allows you to visit the homebridge page that has been set up in the raspberry pie. When the notebook accesses homebridge.local on the same local area network, it will prompt for account number: admin password: admin
2) Control lamp, the control relay uses the GPIO pin on the raspberry pie, by controlling the high and low level signal of the pin to access some sensors or switches, etc.
First, search for the plug-in GPIO, which is an open source project of github. The plug-ins we use here are (homebridge-gpio-device); https://github.com/dubocr/homebridge-gpio-device#digitaloutput.
{
"accessory": "GPIODevice"
"name": "lamp"
"type": "Lightbulb"
"pin": 5
}
Add configuration information to the configuration in Json format. Save and restart the homebridge service. At this time, you can control the lamp to turn on and off in the accessories. In addition to operating on the web interface, you can also use iPhone's own "home" software to scan the QR code to add the current device, so that it can be controlled by Siri voice. The software can set the scene, such as adding the scene "home", configure the switch to turn on, the light on, etc., and say "home" to Siri, and the switch and light will be turned on.
When the high level signal is emitted, the relay switch is closed and the lamp is on; when the low level signal is emitted, the relay switch is closed and the lamp is off.
3) esp8266+ws2812 lamp belt is controlled by homebridge
Write code to burn the code written to esp8266,esp8266 can connect to the wireless network at home, after he receives the control signal to control the light belt to show different lighting effects.
Let's talk about how to achieve it: how does the mobile phone control the light belt?
First of all, there has to be a "courier" who can get the letter out on his cell phone. This courier is mqtt, and the mqtt server can be built in raspberry pie. MQTT is a message transport protocol based on publish / subscribe model. For so-called subscriptions and posts similar to the official Wechat account, esp8266 subscribes to a topic: led_color/transform/older/color
It means that it pays attention to this topic, and he can receive any tweets about this topic. If the color of the phone control light belt is red, it is equivalent to sending a message to the subject: set the RGB color to (255,0,0); after the message is received, the esp8266 can control the light belt through its own pins. At the same time, esp8266 can publish a topic to publish the status of the light belt, so that devices that subscribe to the status topic can receive the status of the current light belt.
Thank you for reading this article carefully. I hope the article "how to build a family control center for Homebridge components" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.