当前位置:网站首页>Esphone's self-made infrared remote control is connected to ha to control lights, switches, etc. any remote control can be used
Esphone's self-made infrared remote control is connected to ha to control lights, switches, etc. any remote control can be used
2022-07-23 07:11:00 【Sharing master】
Catalog
Project background
Recently, I took a fancy to the project of intelligent night light , Buy human body induction night lights with a few yuan through Taobao ( Use the shell ), Then add the machine drawing board esp8266 Networked control , Access homeassistant, Do intelligent control .
At present, the following functions are realized :
- Infrared human body detection
- ld2410 Microwave detection
- Ambient brightness detection
- Night light control
- RGB Color lamp control
- dht11 Temperature and humidity readings ( forbid )
- Infrared emission and reception
Now that infrared transmission and reception have been realized , Is it possible to use this device , As a common infrared remote control transfer signal to control the connected homeassistant What about other equipment ?

Implementation process
The great God of online forum has provided relevant codes , Original author post
Implementation steps :
- infrared ( perhaps 315 433 radio frequency ) Remote control transmits signal
- After receiving the signal, the receiving head gives ESP
- ESP hand MQTT
- HA Internal basis MQTT Content execution is automated accordingly
Verify only the infrared part , The measured available :
- Use esphome To identify the infrared remote control key code [main:094]: nec: 1886437949:0
[20:26:22][D][remote.pronto:229]: Received Pronto: data=0000 006D 0001 0000 0003 06C3
[20:26:23][I][main:094]: nec: 1886437949:0
[20:26:23][D][remote.pronto:229]: Received Pronto: data=0000 006D 0001 0000 0002 06C3
[20:26:23][D][remote.pronto:229]: Received Pronto: data=0000 006D 0003 0000 00AD 00AB 0018 003F 0019 06C3
[20:26:24][I][main:094]: nec: 1886437949:0
[20:26:24][D][remote.pronto:229]: Received Pronto: data=0000 006D 0003 0000 00AD 00AB 0019 003E 0018 06C3
[20:26:31][D][remote.pronto:229]: Received Pronto: data=0000 006D 0001 0000 0001 06C3
[20:26:35][I][main:094]: nec: 1886413469:0
[20:26:35][D][remote.pronto:229]: Received Pronto: data=0000 006D 0003 0000 00AE 00AA 0019 003E 0018 06C3
[20:26:37][I][main:094]: nec: 1886413469:0
[20:26:37][D][remote.pronto:229]: Received Pronto: data=0000 006D 0001 0000 0003 06C3
[20:26:37][D][remote.pronto:229]: Received Pronto: data=0000 006D 0003 0000 00AE 00AA 0018 003F 0018 06C3
[20:26:38][I][main:094]: nec: 1886413469:0
[20:26:38][D][remote.pronto:229]: Received Pronto: data=0000 006D 0003 0000 00AE 00AA 0019 003E 0018 06C3
[20:26:40][I][main:094]: nec: 1886413469:0
[20:26:40][D][remote.pronto:229]: Received Pronto: data=0000 006D 0003 0000 00AF 00A9 0018 003F 0019 06C3Build automation examples
alias: num4 toggle ir_conf
trigger:
- platform: mqtt
topic: ir_conf/senso/ir
payload: '1886413469:0'
action:
- service: switch.toggle
data:
entity_id: switch.wall_switch_left_158d0xxxxUse infrared remote control to verify

Reference code
Enclosed esphome Code :
esphome:
name: ir_conf
esp8266:
framework:
version: 2.7.4
board: nodemcuv2
# Enable logging
logger:
# Enable Home Assistant API
api:
password: !secret api_password
ota:
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
# Set this to the IP of the ESP
static_ip: 192.168.1.178
#static_ip: 192.168.1.10
# Set this to the IP address of the router. Often ends with .1
gateway: 192.168.1.1
# The subnet of the network. 255.255.255.0 works for most home networks.
subnet: 255.255.255.0
#DNS1: 192.168.31.1
# Enable fallback hotspot (captive portal) in case wifi connection fails
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Light Xiaoyedeng"
password: "MynRqBY96AUC"
captive_portal:
# remote_receiver:
# id: rcvr
# pin:
# number: D5
# inverted: true
# # mode:
# # input: true
# # pullup: true
# dump: #all
# - nec
# - raw
mqtt:
broker: !secret broker
username: !secret mqtt_name
password: !secret mqtt_password
discovery: true
remote_receiver:
pin:
number: D5
inverted: True
mode: INPUT_PULLUP
dump: all
on_nec:
then:
- mqtt.publish:
topic: ir_conf/sensor/ir
payload: !lambda |-
char temp[20];
sprintf(temp, "%d:%d", x.address, x.command);
ESP_LOGI("main", "nec: %s", temp);
return temp;
on_panasonic:
then:
- mqtt.publish:
topic: ir_conf/sensor/ir
payload: !lambda |-
char temp[20];
sprintf(temp, "%d:%d", x.address, x.command);
ESP_LOGI("main", "nec: %s", temp);
return temp;
on_sony:
then:
- mqtt.publish:
topic: ir_conf/sensor/ir
payload: !lambda |-
char temp[20];
sprintf(temp, "%d:%d", x.data, x.nbits);
ESP_LOGI("main", "nec: %s", temp);
return temp;
on_samsung:
then:
- mqtt.publish:
topic: ir_conf/sensor/ir
payload: !lambda |-
char temp[20];
sprintf(temp, "%d:%d", x.data, x.nbits);
ESP_LOGI("main", "nec: %s", temp);
return temp;
on_jvc:
then:
- mqtt.publish:
topic: ir_conf/sensor/ir
payload: !lambda |-
char temp[20];
sprintf(temp, "%d", x.data);
ESP_LOGI("main", "nec: %s", temp);
return temp;
on_rc5:
then:
- mqtt.publish:
topic: ir_conf/sensor/ir
payload: !lambda |-
char temp[20];
sprintf(temp, "%d:%d", x.address, x.command);
ESP_LOGI("main", "nec: %s", temp);
return temp;
边栏推荐
- Combing the docking process between the integration base and the business system
- 浅析缓存的读写策略
- session、cookie、token 详解
- 电脑如何快速关机 电脑关机命令分享
- SQL Server中的STRING_SPLIT函数的实现
- 为什么不能隐藏文件夹?电脑隐藏的文件夹还能看到的解决办法
- EXCEL单元格公式-实现阿克曼函数计算
- Pikachu靶场-SQL注入-搜索型注入过关步骤
- What is the difference between GPU and CPU? Introduction to the meaning of GPU in different computers
- 怎么让自己在how old robot显得年轻?我看起来几岁更年轻方法技巧
猜你喜欢

小黑啃leetcode:589. N 叉树的前序遍历

【Matlab项目实战】Sine Sweep(正弦扫频信号)

Q6ui布局操作

【MATLAB项目实战】基于SPI指数的某地区地区干旱时空特征分析
![[matlab project practice] sine sweep (sine sweep signal)](/img/14/9f66d1c90d56409fd4d5c7540d9c27.png)
[matlab project practice] sine sweep (sine sweep signal)

对线程池的了解与应用你掌握多少

Mycms we media mall v3.5 release, new free plug-ins

Demo19- (to be updated)

MySQL - sub query - sub query concept, specification, classification

Gb28181 summary of common problems in the use and secondary development of livegbs streaming media service
随机推荐
怎么让自己在how old robot显得年轻?我看起来几岁更年轻方法技巧
CV semantic segmentation model sketch (1)
记事本文件太大打不开怎么办?TXT文件太大无法打开现象的解决办法介绍
How to open the tutorial of administrator permission setting for computer administrator permission
How to get administrator permissions on the computer tutorial on setting administrator permissions on the computer
电脑不能截屏怎么办?电脑的快捷截屏键无法使用的解决办法
小黑leetcode之旅:341. 扁平化嵌套列表迭代器
Design of boiler drum temperature control system (process control course design matlab/simulink)
How to connect two computers with one network cable? How to connect two computers with one network cable
局域网SDN技术硬核内幕 - 15 三 从物到人 园区用户漫游的MPLS实现
Pikachu shooting range SQL injection search injection clearance steps
图像处理解决方案 veImageX 技术演进之路
FileInputFormat.setInputPaths多路径读取规则
Huawei shengteng competition materials
AWS使用EC2降低DeepRacer的训练成本DeepRacer-for-cloud的实践操作
Realize the national standard gb28181 streaming media service solution
小程序wx.setStorageSync后,在用getStorageSync获取数据有时会获取不到
实现OPC UA publish/subscribe单次发送
小黑leetcode之旅:590. N 叉树的后序遍历
SQL Server中的STRING_SPLIT函数的实现