找回密码
 立即注册
搜索
查看: 30|回复: 1

[求助] 涂鸦红外配对出来的自动脚本如何变实体按键

[复制链接]
cook 手机认证

8

主题

55

回帖

237

积分

中级会员

积分
237
金钱
174
HASS币
0
发表于 3 小时前 | 显示全部楼层 |阅读模式

电视机顶盒通过涂鸦发红外传感器,把各个配对码已经弄出来在脚本里面去了。现在怎样转换成实体按键呢?有开关机,有数字按键,怎样弄成?
微信图片_20250628110625.png
tvbox_ir:
  sequence:
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: TVBOX
      command: ONOFF
    target:
      entity_id: remote.tuya_ir_remote_control
    alias: TVBOX_ONOFF
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: TVBOX
      command: HOME
    target:
      entity_id: remote.tuya_ir_remote_control
    alias: TVBOX_HOME
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: TVBOX
      command: RB
    target:
      entity_id: remote.tuya_ir_remote_control
    alias: TVBOX_RB
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: TVBOX
      command: VOL-
    target:
      entity_id: remote.tuya_ir_remote_control
    alias: TVBOX_VOL-
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: TVBOX
      command: VOL+
    target:
      entity_id: remote.tuya_ir_remote_control
    alias: TVBOX_VOL+
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: TVBOX
      command: UP
    target:
      entity_id: remote.tuya_ir_remote_control
    alias: TVBOX_UP
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: TVBOX
      command: DOWN
    target:
      entity_id: remote.tuya_ir_remote_control
    alias: TVBOX_DOWN
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: TVBOX
      command: LEFT
    target:
      entity_id: remote.tuya_ir_remote_control
    alias: TVBOX_LEFT
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: TVBOX
      command: RIGHT
    target:
      entity_id: remote.tuya_ir_remote_control
    alias: TVBOX_RIGHT
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: TVBOX
      command: 1
    target:
      entity_id: remote.tuya_ir_remote_control
    alias: TVBOX_N1
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: TVBOX
      command: 2
    target:
      entity_id: remote.tuya_ir_remote_control
    alias: TVBOX_N2
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: TVBOX
      command: 3
    target:
      entity_id: remote.tuya_ir_remote_control
    alias: TVBOX_N3
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: TVBOX
      command: 4
    target:
      entity_id: remote.tuya_ir_remote_control
    alias: TVBOX_N4
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: TVBOX
      command: 5
    target:
      entity_id: remote.tuya_ir_remote_control
    alias: TVBOX_N5
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: TVBOX
      command: 6
    target:
      entity_id: remote.tuya_ir_remote_control
    alias: TVBOX_N6
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: TVBOX
      command: 7
    target:
      entity_id: remote.tuya_ir_remote_control
    alias: TVBOX_N7
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: TVBOX
      command: 8
    target:
      entity_id: remote.tuya_ir_remote_control
    alias: TVBOX_N8
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: TVBOX
      command: 9
    target:
      entity_id: remote.tuya_ir_remote_control
    alias: TVBOX_N9
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: TVBOX
      command: 0
    target:
      entity_id: remote.tuya_ir_remote_control
    alias: TVBOX_N0
  alias: TVBOX-IR
  description: ''


回复

使用道具 举报

cook 手机认证

8

主题

55

回帖

237

积分

中级会员

积分
237
金钱
174
HASS币
0
 楼主| 发表于 3 小时前 | 显示全部楼层
微信图片_20250628120522.png
按键模式,可以是上下左右这种按键,
但开机按键想要这种能够变色的滑动块
微信图片_20250628120542.png

template:
  - button:
      - name: Fast Forward
        press:
          action: remote.send_command
          target:
            entity_id: remote.tuya_ir_remote_control
          data:
            device: TV
            command: on off

回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )

GMT+8, 2025-6-28 15:10 , Processed in 0.404359 second(s), 26 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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