『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 425|回复: 3

[基础教程] 改造用ESPHOME改了Orvibo的红外遥控

[复制链接]

8

主题

77

帖子

708

积分

高级会员

Rank: 4

积分
708
金钱
631
HASS币
0
发表于 2024-10-1 08:08:32 | 显示全部楼层 |阅读模式
Orvibo的红外遥控是8266的芯片。然后各种找资料代码如下:顺便说下。我主要是玩悟空的时候电视机少了遥控器属于整了这

substitutions:
  device_name: "ESP8266IR"
  run_time: 15s       # 运行时间 
  sleep_time: 44s     # 休眠时间

esphome:
  name: esp8266
  friendly_name: ESP8266

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "kWLEm1CRtH1ikbQDKedCshqelOhhhwzfgVGUDtVoPZo="
  
ota:
  - platform: esphome
    password: "580f85d3239973eb61506976578f0a09"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  # fast_connect: True
  reboot_timeout: 300s
  manual_ip:
    static_ip: 192.168.1.188
    gateway: 192.168.1.1
    subnet: 255.255.255.0
    dns1: 183.221.253.100

web_server:
  port: 80

captive_portal:

script:
  - id: opne_changhong_hdmi
    then:
      - button.press: but_chpower
      - delay: 60s
      - button.press: but_chsource
      - delay: 1s
      - button.press: but_menu

  - id: close_changhong_hdmi
    then:     
      - button.press: but_chpower

remote_transmitter:
  - id: IR_transmitter
    pin: GPIO14   #红外引脚
    carrier_duty_percent: 50%
remote_receiver:
  - id: IR_receiver
    pin:
      number: GPIO5 #红外接收引脚
      inverted: True
    dump:
    - raw
    - nec

status_led:
  pin: GPIO15

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO4 
      inverted: true
    name: "Button"
    id: button_input

button:
  - platform: template
    name: But_PowerOpen
    id: but_poweropen
    icon: mdi:power     
    on_press:
      - script.execute: opne_changhong_hdmi
  
  # Received NEC: address=0x3000, command=0xFD02 command_repeats=1
  - platform: template
    name: BQ_Power
    id: but_bqpower
    icon: mdi:power     
    on_press:
      - remote_transmitter.transmit_nec:
          address: 0x3000
          command: 0xFD02
          command_repeats: 1
  # ' '
  - platform: template
    name: BQ_menu
    id: but_bqmenu
    icon: mdi:menu        
    on_press:
      - remote_transmitter.transmit_nec:
          address: 0x3000
          command: 0xEA15
          command_repeats: 1
  - platform: template
    name: CH_Power
    id: but_chpower
    icon: mdi:power     
    on_press:
      - remote_transmitter.transmit_nec:
          address: 0xBF40
          command: 0xED12
          command_repeats: 1
  - platform: template
    name: CH_Source
    id: but_chsource
    icon: mdi:source-branch    
    on_press:
      - remote_transmitter.transmit_nec:
          address: 0xBF40
          command: 0xEB14
          command_repeats: 1
  - platform: template
    name: CH_Volumeplus
    id: but_chvolumeplus  
    icon: mdi:volume-plus      
    on_press:
      - remote_transmitter.transmit_nec:
          address: 0xBF40
          command: 0xE51A
          command_repeats: 1
  - platform: template
    name: CH_Volumeminus
    id: but_chvolumeminus
    icon: mdi:volume-minus        
    on_press:
      - remote_transmitter.transmit_nec:
          address: 0xBF40
          command: 0xE11E
          command_repeats: 1
  - platform: template
    name: CH_volumemute
    id: but_volumemute
    icon: mdi:volume-mute        
    on_press:
      - remote_transmitter.transmit_nec:
          address: 0xBF40
          command: 0xEF10
          command_repeats: 1

  - platform: template
    name: CH_menuleft
    id: but_menuleft
    icon: mdi:menu-left       
    on_press:
      - remote_transmitter.transmit_nec:
          address: 0xBF40
          command: 0xB946
          command_repeats: 1
  - platform: template
    name: CH_menuright
    id: but_menuright 
    icon: mdi:menu-right      
    on_press:
      - remote_transmitter.transmit_nec:
          address: 0xBF40
          command: 0xB847
          command_repeats: 1
  - platform: template
    name: CH_menuup
    id: but_menuup 
    icon: mdi:menu-up       
    on_press:
      - remote_transmitter.transmit_nec:
          address: 0xBF40
          command: 0xE619
          command_repeats: 1
  - platform: template
    name: CH_menudown
    id: but_menudown
    icon: mdi:menu-down        
    on_press:
      - remote_transmitter.transmit_nec:
          address: 0xBF40
          command: 0xE21D
          command_repeats: 1
  - platform: template
    name: CH_menu
    id: but_menu
    icon: mdi:menu        
    on_press:
      - remote_transmitter.transmit_nec:
          address: 0xBF40
          command: 0xF50A
          command_repeats: 1

# Received NEC: address=0xBF40, command=0xED12 command_repeats=1
# Received NEC: address=0xBF40, command=0xEB14 command_repeats=1
# Received NEC: address=0xBF40, command=0xB847 command_repeats=1
# Received NEC: address=0xBF40, command=0xB946 command_repeats=1
# Received NEC: address=0xBF40, command=0xE619 command_repeats=1
# Received NEC: address=0xBF40, command=0xE21D command_repeats=1
# Received NEC: address=0xBF40, command=0xF50A command_repeats=1
# Received NEC: address=0xBF40, command=0xEF10 command_repeats=1




回复

使用道具 举报

23

主题

158

帖子

859

积分

高级会员

Rank: 4

积分
859
金钱
701
HASS币
0
发表于 2024-10-1 10:31:46 | 显示全部楼层
   on_press:
      - script.execute: opne_changhong_hdmi

这行代码 什么意思 ,后面的是遥控器代码 这个我知道

如果 还要添加 其它遥控器 怎么添加???

怎么添加??

你这个是一个设备的 遥控器 代码 ,一些功能键的代码。

比如我要添加 电视盒子 投影机 空调 怎么添加 设备
回复

使用道具 举报

23

主题

158

帖子

859

积分

高级会员

Rank: 4

积分
859
金钱
701
HASS币
0
发表于 2024-10-1 10:53:19 | 显示全部楼层
lifesmart 超级碗 提示,没有OTA 足够的 空间!
回复

使用道具 举报

8

主题

77

帖子

708

积分

高级会员

Rank: 4

积分
708
金钱
631
HASS币
0
 楼主| 发表于 2024-10-3 11:27:28 | 显示全部楼层
tanbobo 发表于 2024-10-1 10:31
on_press:
      - script.execute: opne_changhong_hdmi

这个是个脚本,我玩游戏需要切换信号源到HDMI。这个电视没有开机自动切换所以我就弄了这
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-23 16:37 , Processed in 0.151263 second(s), 25 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表