Skip to content

Commit b38731f

Browse files
committed
update
1 parent 4f4122e commit b38731f

File tree

7 files changed

+76
-1
lines changed

7 files changed

+76
-1
lines changed

README.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
MqttIrext
2+
=====
3+
4+
---
5+
## 什么是MqttIrext?
6+
MqttIrext [Irext](https://github.com/irext/irext-core)的一个衍生项目。
7+
MqttIrext的作用是帮助你只需要一个ESP8266系列的模块和一个红外二级管就可以控制家里红外设备。
8+
它的优势在于:
9+
> * 成本低廉只需要一个ESP8266模块或开发板如NodeMcu)和一个红外二级管
10+
> * 不需要人为学习红外码快速匹配到电器
11+
> * 有mqtt接口可以方便接入homeassistant
12+
13+
## 开发状态
14+
15+
MqttIrext 仍然处于前期开发阶段,未经充分测试与验证,不推荐用于生产环境。
16+
17+
**目前的交互协议可能随时改变,不保证向后兼容,升级新版本时需要注意公告说明同时升级服务端和客户端。**
18+
19+
## 说明
20+
现已完成,当前版本只支持空调
21+
22+
## 使用方式
23+
* 首先你需要刷好固件
24+
* 打开 http://esp.shanming.top/#/, 配置mqtt信息,完成会提示是否连接
25+
![配置mqtt](./images/1.png)
26+
* 开启esp设备,查找`AP_HOME_NODE``Bleeper`热点,手机或电脑都可以连接,访问地址`192.168.4.1` 配置如下信息:
27+
![配置esp设备mqtt](./images/2.jpg)
28+
* 网页端会接收到这样一个消息
29+
![配置esp设备mqtt](./images/3.png)
30+
* 配置topic和针脚,默认是14也就是d5,8266型号就是`00AED134`
31+
* 选择好空调固件,点击`使用固件`,会看到右上角有`download is ok`消息,证明固件下载完成
32+
![配置esp设备mqtt](./images/4.png)
33+
* 点击测试,会发送改变温度,从 `18度到30,制冷`,或在HomeAssistant中测试
34+
35+
## 发射管连接图
36+
![红外连接图](https://camo.githubusercontent.com/8b4e10e4d829d417cc29a5d5a563f650fb4beabf/687474703a2f2f667269747a696e672e6f72672f6d656469612f667269747a696e672d7265706f2f70726f6a656374732f652f657370383236362d69722d7472616e736d69747465722f696d616765732f49522532305472616e736d69747465725f62622e706e67)
37+
38+
也可以尝试不用三级管,直接连接。红外二级管长引脚接gpio,短脚接地。
39+
40+
## HomeAssistant配置文件
41+
记得修改mqtt型号
42+
```yaml
43+
climate:
44+
- platform: mqtt
45+
name: study
46+
friendly_name: 客厅空调
47+
modes:
48+
- cool
49+
- heat
50+
- auto
51+
- fan
52+
- dry
53+
- off
54+
swing_modes:
55+
- on
56+
- off
57+
fan_modes:
58+
- high
59+
- medium
60+
- low
61+
- auto
62+
power_command_topic: "esp/00AECB90/mode/set"
63+
mode_command_topic: "esp/00AECB90/mode/set"
64+
temperature_command_topic: "esp/00AECB90/temperature/set"
65+
fan_mode_command_topic: "esp/00AECB90/fan/set"
66+
swing_mode_command_topic: "esp/00AECB90/swing/set"
67+
min_temp: 16
68+
max_temp: 30
69+
```
70+
71+
## 特别感谢
72+
* [Strawmanbobi](https://github.com/strawmanbobi) Irext开源库的作者,给予我技术和精神上的支持
73+
* [Caffreyfans](https://github.com/Caffreyfans) IRmqtt 开源库作者,我这这个基础上做了一些修改
74+

firmware/firmware.bin

355 KB
Binary file not shown.

images/1.png

25.6 KB
Loading

images/2.jpg

53.9 KB
Loading

images/3.png

13.2 KB
Loading

images/4.png

26.7 KB
Loading

src/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ boolean downLoadFile(int index_id)
345345
String filename = String(index_id);
346346
if (SPIFFS.exists(filename))
347347
{
348+
client.publish(node_toast, "download is ok");
348349
SERIAL_DEBUG.println("already have file");
349350
return true;
350351
}
@@ -370,7 +371,7 @@ boolean downLoadFile(int index_id)
370371
http.writeToStream(filestream);
371372
SERIAL_DEBUG.printf("download %s ok\n", filename.c_str());
372373
flag = true;
373-
client.publish(node_toast, "download is ok");
374+
client.publish(node_toast, "download is ok");
374375
}
375376
else
376377
{

0 commit comments

Comments
 (0)