所需材料
8266开发板
红外发射二极管
三极管放大器

参考两个开源项目
https://github.com/huexpub/IRMQTT
https://github.com/Caffreyfans/IREasy

先刷入IRMQTTServer固件
https://github.com/huexpub/IRMQTT/blob/master/fimware/IRMQTTServer.ino.generic.bin

8266上电后,搜索IRMQTT热点,连接上,转入配网WEB页面,未弹出请尝试访问192.168.4.1地址
qq_pic_merged_1582771108652.jpg

连接好wifi后,在路由器管理界面查看新增的ESP_xxx设备 然后给他固定IP

8266断电后如图所示连接二极管与三极管
连接图.png

浏览器进入刚刚固定的IP进行匹配空调
2020-2-27 10-44-3.png
选择对应的空调型号,模式,电源,温度,并点击 UPDATE/SEND,空调有反应后,视为有效型号,若无反应,请对应尝试model 1-6子设备型号,如均无反应,可能不被支持。

然后配置homeassistant(又名HASS)
修改configuration.yaml

    mqtt:
  # MQTT Broker的IP地址或者域名
  broker:yiniot.com
  # MQTT Broker的端口号,缺省为1883
  port: 1883
  # 用户名
  username:自定
  # 密码
  password:123456

climate:
  - platform: mqtt
    name: zwaircon
    modes:
      - "off"
      - "auto"
      - "cool"
      - "heat"
      - "dry"
    fan_modes:
      - "auto"
      - "min"
      - "low"
      - "medium"
      - "high"
      - "max"
    swing_modes:
      - "off"
      - "auto"
      - "highest"
      - "high"
      - "middle"
      - "low"
    power_command_topic: "ir_server/ac/cmnd/power"
    mode_command_topic: "ir_server/ac/cmnd/mode"
    mode_state_topic: "ir_server/ac/stat/mode"
    temperature_command_topic: "ir_server/ac/cmnd/temp"
    temperature_state_topic: "ir_server/ac/stat/temp"
    fan_mode_command_topic: "ir_server/ac/cmnd/fanspeed"
    fan_mode_state_topic: "ir_server/ac/stat/fanspeed"
    swing_mode_command_topic: "ir_server/ac/cmnd/swingv"
    swing_mode_state_topic: "ir_server/ac/stat/swingv"
    min_temp: 16
    max_temp: 30

Last modification:April 20th, 2020 at 11:26 pm
如果觉得我的文章对你有用,请随意赞赏