在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:normen/homebridge-433-arduino开源软件地址:https://github.com/normen/homebridge-433-arduino开源编程语言:JavaScript 100.0%开源软件介绍:homebridge-433-arduinoA homebridge plugin to control 433MHz switches and receive 433MHz switch signals using an Arduino Micro or an ESP8266 / ESP32 connected via USB or WiFi to send and receive data. IntroductionThis plugin allows you to use cheap 433MHz wireless switches as lamps, fans or generic switches in HomeKit and control them using Siri. You can also use your 433Mhz remote to control things in HomeKit, like for example start scenes. Improvements over other similar plugins
Why use an external microcontroller?There is plugins out there that use the Raspberry Pi GPIO functions to send and receive 433 MHZ data. The problem with these is that especially the receiving part requires quite a lot of CPU power as the RasPi lacks real hardware interrupts on its GPIO ports. Sending works okay most of the time if the RasPi isn't under much load. The RasPi 1 can struggle to get accurate RF timing with short pulse durations even under low load however. Additionally, the RasPi works on 3.3V and most simple 433MHz receivers/transmitters work best at 5V. The Arduino micro for example runs on 5V and allows a much more stable connection to the receivers and transmitters. Supported switchesMost cheap 433 MHz switches should work, the transceiver can use either rc-switch or ESPiLight to encode and decode signals. ESPiLight is recommended as it supports more switch types but as the name suggests it requires ESP hardware. InstallationHardwareThe software for the microcontroller has it's own github project. For info on how to set up the microcontroller hardware, see this page: https://github.com/normen/arduino-433 HomebridgeInstall software
Configure config.jsonExample config.json{
"bridge": {
"name": "#####",
"username": "",
"port": 51826,
"pin": ""
},
"platforms": [
{
"platform": "ArduinoRCSwitch",
"name": "Arduino RC Switch Platform",
"serial_port": "/dev/ttyACM0",
"switches": [
{
"name" : "My Device",
"on": {
"code":123456,
"pulse":188
},
"off": {
"code":123457,
"pulse":188
}
},
{
"name" : "My Other Device",
"on": {
"code":123458,
"pulse":188,
"protocol":2
},
"off": {
"code":123459,
"pulse":188,
"protocol":2
}
}
],
"buttons": [
{
"name" : "My Button",
"code":123450,
"pulse":188
}
],
"detectors": [
{
"name" : "My Smoke Detector",
"code":1234502,
"pulse":366
}
],
"sensors": [
{
"name" : "My Leak Sensor",
"code":1234503,
"pulse":366
}
]
}
]
} Settings
Optional settings
ESPiLightOptionally you can use the ESPiLight library instead of rc-switch on the transceiver which supports a wider range of 433MHz devices. When using it (configured in the Arduino code) the format of the messages changes from code/pulse/protocol to type and message (different for each switch type), see below for an example. Note that for some switches not all of the received info that is given in the homebridge log needs to be added to the config.json. Usually "id", "unit" and "state" are enough. Example config.json with Websockets & ESPPiLightFor switches that report "up" and "down" for the state instead of "on" and "off" you can specify "state":"up" in the configuration to account for that. For buttons you have to specify which state you want to use as a button. "platforms": [
{
"platform": "ArduinoRCSwitch",
"name": "Arduino RC Switch Platform",
"host": "arduino-433",
"port": 80,
"switches": [
{
"name" : "My Device",
"type": "clarus_switch",
"message":{
"id": "A3",
"unit": 60
}
}
],
"buttons": [
{
"name" : "My Button",
"type": "clarus_switch",
"message":{
"id": "B4",
"unit": 20,
"state": "off"
}
}
]
}
] UsageAdding SwitchesTo add switches press a button on the remote control that came with the switch and watch the homebridge log. Switch messages should appear in the log, giving you the needed information to fill out config.json or add switches through the web interface settings panel. See the wiki for more info as well as tips&tricks for getting your switches to work. Also please add your own info about switches. https://github.com/normen/homebridge-433-arduino/wiki DevelopmentIf you want new features or improve the plugin, you're very welcome to do so. The projects Setup
CreditsCredit goes to LicensePublished under the MIT License. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论