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

标题: 求大佬写一个esphome自动执行的操作 [打印本页]

作者: nidayede88    时间: 2024-2-6 21:39
标题: 求大佬写一个esphome自动执行的操作
本帖最后由 nidayede88 于 2024-2-6 21:43 编辑
  1. remote_receiver:
  2.   pin: GPIO16
  3.   id: decoder1
  4.   dump: all
  5. switch:
  6.   - platform: gpio
  7.     pin: 22
  8.     name: "Living Room Dehumidifier"
  9.     id: switch1
复制代码



如何让remote_receiver接收到这个值就执行switch1,
接收到的值是0005 000B 0005 0003 0005 0003 0005 0003 0005 0013 0005 0181 06C3

这个值是raw
太长了我就截取了一部分







作者: alei643    时间: 2024-2-6 22:43
  1. binary_sensor:
  2.   - platform: remote_receiver
  3.     name: "IR Command"
  4.     id: my_remote
  5.     on_press:
  6.       then:
  7.         - if:
  8.             condition:
  9.               remote_receiver.is_on_raw: # 使用RAW码
  10.                 code: [3450, 1750, 450, 1300, 450, 1300, 450, 1300, ...] # 请替换为您的RAW码
  11.             then:
  12.               - switch.toggle: switch1
复制代码


试试看对不对
作者: kjjuhfv    时间: 2024-2-6 23:07
raw码每次都不一样 所以这个自动化不会执行的
作者: zro22    时间: 2024-2-7 11:53
不能用raw值,raw值我的理解相当于波形的高低持续时间,每次都不一样,需要解码出来才可以。

作者: bugensui    时间: 2024-2-7 16:03
对的,确实每次都不一样
作者: nidayede88    时间: 2024-2-7 18:55
alei643 发表于 2024-2-6 22:43
试试看对不对

    报错...         Unable to find condition with the name 'remote_receiver.is_on_raw'.
作者: nidayede88    时间: 2024-2-7 18:56
这个是433 遥控器 不知道怎么解码,我发送了好多次 raw值都一样,所以干脆用raw算了
作者: 542548454    时间: 2024-2-8 21:58
本帖最后由 542548454 于 2024-2-8 21:59 编辑
nidayede88 发表于 2024-2-7 18:56
这个是433 遥控器 不知道怎么解码,我发送了好多次 raw值都一样,所以干脆用raw算了 ...

把“dump: all”换成除raw以外的其他选项试试,比如“dump: nec”、“dump: jvc”等。ESPHome官网示例[attach]55925[/attach]
[attach]55926[/attach]
[attach]55927[/attach]







欢迎光临 『瀚思彼岸』» 智能家居技术论坛 (https://bbs.hassbian.com/) Powered by Discuz! X3.5