找回密码
 立即注册

微信扫码登录

搜索
查看: 59|回复: 0

[进阶教程] 当贝投影机DBF5 遥控器接入HA

[复制链接]

63

主题

646

回帖

5026

积分

论坛元老

积分
5026
金钱
4312
HASS币
20
发表于 10 小时前 | 显示全部楼层 |阅读模式
nodered导入,把: websocket out 双击 修改ip为投影机ip 端口保留,我的型号是 DBF5的 下面协议是抓包出来不知道其他型号共用不有兴趣可以试试,导入后修改ip和mqtt服务器。ha导入脚本可以控制 上 下 左 右 ok 音量+/-  菜单 home 设置 按键。
nodered:
[
    {
        "id": "67fafcba2cd5e482",
        "type": "tab",
        "label": "当贝投影机",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "688be89a7397e2d3",
        "type": "websocket out",
        "z": "67fafcba2cd5e482",
        "name": "",
        "server": "",
        "client": "3180962faa6346b6",
        "x": 970,
        "y": 220,
        "wires": []
    },
    {
        "id": "e59a4c1570fccf65",
        "type": "function",
        "z": "67fafcba2cd5e482",
        "name": "上",
        "func": "msg.payload = {\n    "sn": "",\n    "data": {\n        "command": {\n            "value": "1",   // 上\n            "params": "",\n            "command": "Operation",\n            "from": 901\n        },\n        "toDeviceId": "0ba06e873c33b0d25fc64896c9cd6a45"\n    },\n    "toId": "fczAs/bZ2lc=",\n    "fromId": "tYbuTOjizjQ=",\n    "type": "HB7FxtN64oc="\n};\n\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 490,
        "y": 100,
        "wires": [
            [
                "688be89a7397e2d3"
            ]
        ]
    },
    {
        "id": "2776a6bb4194f4f1",
        "type": "function",
        "z": "67fafcba2cd5e482",
        "name": "下",
        "func": "msg.payload = {\n  "sn": "",\n  "data": {\n    "command": {\n      "value": "2",\n      "params": "",\n      "command": "Operation",\n      "from": 901\n    },\n    "toDeviceId": "0ba06e873c33b0d25fc64896c9cd6a45"\n  },\n  "toId": "fczAs/bZ2lc=",\n  "fromId": "tYbuTOjizjQ=",\n  "type": "HB7FxtN64oc="\n};\n\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 490,
        "y": 140,
        "wires": [
            [
                "688be89a7397e2d3"
            ]
        ]
    },
    {
        "id": "d7bec04d72634021",
        "type": "function",
        "z": "67fafcba2cd5e482",
        "name": "左",
        "func": "msg.payload = {\n    "sn": "",\n    "data": {\n        "command": {\n            "value": "3",   // 上\n            "params": "",\n            "command": "Operation",\n            "from": 901\n        },\n        "toDeviceId": "0ba06e873c33b0d25fc64896c9cd6a45"\n    },\n    "toId": "fczAs/bZ2lc=",\n    "fromId": "tYbuTOjizjQ=",\n    "type": "HB7FxtN64oc="\n};\n\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 490,
        "y": 180,
        "wires": [
            [
                "688be89a7397e2d3"
            ]
        ]
    },
    {
        "id": "f82ebe924786783b",
        "type": "function",
        "z": "67fafcba2cd5e482",
        "name": "右",
        "func": "msg.payload = {\n    "sn": "",\n    "data": {\n        "command": {\n            "value": "4",   // 上\n            "params": "",\n            "command": "Operation",\n            "from": 901\n        },\n        "toDeviceId": "0ba06e873c33b0d25fc64896c9cd6a45"\n    },\n    "toId": "fczAs/bZ2lc=",\n    "fromId": "tYbuTOjizjQ=",\n    "type": "HB7FxtN64oc="\n};\n\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 490,
        "y": 220,
        "wires": [
            [
                "688be89a7397e2d3"
            ]
        ]
    },
    {
        "id": "cfdc68af61bbb6d1",
        "type": "function",
        "z": "67fafcba2cd5e482",
        "name": "ok",
        "func": "msg.payload = {\n    "sn": "",\n    "data": {\n        "command": {\n            "value": "5",   // 上\n            "params": "",\n            "command": "Operation",\n            "from": 901\n        },\n        "toDeviceId": "0ba06e873c33b0d25fc64896c9cd6a45"\n    },\n    "toId": "fczAs/bZ2lc=",\n    "fromId": "tYbuTOjizjQ=",\n    "type": "HB7FxtN64oc="\n};\n\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 490,
        "y": 260,
        "wires": [
            [
                "688be89a7397e2d3"
            ]
        ]
    },
    {
        "id": "e6c19af1a9616ffe",
        "type": "function",
        "z": "67fafcba2cd5e482",
        "name": "音量-",
        "func": "msg.payload = {\n    "sn": "",\n    "data": {\n        "command": {\n            "value": "10",   // 上\n            "params": "",\n            "command": "Operation",\n            "from": 901\n        },\n        "toDeviceId": "0ba06e873c33b0d25fc64896c9cd6a45"\n    },\n    "toId": "fczAs/bZ2lc=",\n    "fromId": "tYbuTOjizjQ=",\n    "type": "HB7FxtN64oc="\n};\n\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 490,
        "y": 300,
        "wires": [
            [
                "688be89a7397e2d3"
            ]
        ]
    },
    {
        "id": "aec30bf35ea3c0ab",
        "type": "function",
        "z": "67fafcba2cd5e482",
        "name": "音量+",
        "func": "msg.payload = {\n    "sn": "",\n    "data": {\n        "command": {\n            "value": "9",   // 上\n            "params": "",\n            "command": "Operation",\n            "from": 901\n        },\n        "toDeviceId": "0ba06e873c33b0d25fc64896c9cd6a45"\n    },\n    "toId": "fczAs/bZ2lc=",\n    "fromId": "tYbuTOjizjQ=",\n    "type": "HB7FxtN64oc="\n};\n\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 490,
        "y": 340,
        "wires": [
            [
                "688be89a7397e2d3"
            ]
        ]
    },
    {
        "id": "94d1bdf06b7090c4",
        "type": "function",
        "z": "67fafcba2cd5e482",
        "name": "菜单",
        "func": "msg.payload = {\n    "sn": "",\n    "data": {\n        "command": {\n            "value": "8",   // 上\n            "params": "",\n            "command": "Operation",\n            "from": 901\n        },\n        "toDeviceId": "0ba06e873c33b0d25fc64896c9cd6a45"\n    },\n    "toId": "fczAs/bZ2lc=",\n    "fromId": "tYbuTOjizjQ=",\n    "type": "HB7FxtN64oc="\n};\n\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 490,
        "y": 380,
        "wires": [
            [
                "688be89a7397e2d3"
            ]
        ]
    },
    {
        "id": "ef684200141d4a78",
        "type": "function",
        "z": "67fafcba2cd5e482",
        "name": "home",
        "func": "msg.payload = {\n    "sn": "",\n    "data": {\n        "command": {\n            "value": "7",   // 上\n            "params": "",\n            "command": "Operation",\n            "from": 901\n        },\n        "toDeviceId": "0ba06e873c33b0d25fc64896c9cd6a45"\n    },\n    "toId": "fczAs/bZ2lc=",\n    "fromId": "tYbuTOjizjQ=",\n    "type": "HB7FxtN64oc="\n};\n\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 490,
        "y": 420,
        "wires": [
            [
                "688be89a7397e2d3"
            ]
        ]
    },
    {
        "id": "feb09b19e6edc1e1",
        "type": "function",
        "z": "67fafcba2cd5e482",
        "name": "返回",
        "func": "msg.payload = {\n    "sn": "",\n    "data": {\n        "command": {\n            "value": "6",   // 上\n            "params": "",\n            "command": "Operation",\n            "from": 901\n        },\n        "toDeviceId": "0ba06e873c33b0d25fc64896c9cd6a45"\n    },\n    "toId": "fczAs/bZ2lc=",\n    "fromId": "tYbuTOjizjQ=",\n    "type": "HB7FxtN64oc="\n};\n\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 490,
        "y": 460,
        "wires": [
            [
                "688be89a7397e2d3"
            ]
        ]
    },
    {
        "id": "c8e55bd525393150",
        "type": "function",
        "z": "67fafcba2cd5e482",
        "name": "关闭",
        "func": "msg.payload = {\n    "sn": "",\n    "data": {\n        "command": {\n            "value": "11",   // 上\n            "params": "",\n            "command": "Operation",\n            "from": 901\n        },\n        "toDeviceId": "0ba06e873c33b0d25fc64896c9cd6a45"\n    },\n    "toId": "fczAs/bZ2lc=",\n    "fromId": "tYbuTOjizjQ=",\n    "type": "HB7FxtN64oc="\n};\n\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 490,
        "y": 500,
        "wires": [
            [
                "2e595d4d88f6327e",
                "688be89a7397e2d3"
            ]
        ]
    },
    {
        "id": "2e595d4d88f6327e",
        "type": "delay",
        "z": "67fafcba2cd5e482",
        "name": "",
        "pauseType": "delay",
        "timeout": "2",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "allowrate": false,
        "outputs": 1,
        "x": 640,
        "y": 500,
        "wires": [
            [
                "7fad86779f8ac671"
            ]
        ]
    },
    {
        "id": "7fad86779f8ac671",
        "type": "function",
        "z": "67fafcba2cd5e482",
        "name": "ok",
        "func": "msg.payload = {\n    "sn": "",\n    "data": {\n        "command": {\n            "value": "5",   // 上\n            "params": "",\n            "command": "Operation",\n            "from": 901\n        },\n        "toDeviceId": "0ba06e873c33b0d25fc64896c9cd6a45"\n    },\n    "toId": "fczAs/bZ2lc=",\n    "fromId": "tYbuTOjizjQ=",\n    "type": "HB7FxtN64oc="\n};\n\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 770,
        "y": 500,
        "wires": [
            [
                "688be89a7397e2d3"
            ]
        ]
    },
    {
        "id": "365b1b69986443ce",
        "type": "mqtt in",
        "z": "67fafcba2cd5e482",
        "name": "",
        "topic": "danbei/ha",
        "qos": "2",
        "datatype": "auto-detect",
        "broker": "506ce5dbba3051cf",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 100,
        "y": 260,
        "wires": [
            [
                "47c743d3a596f670",
                "c6009a658123e513"
            ]
        ]
    },
    {
        "id": "47c743d3a596f670",
        "type": "switch",
        "z": "67fafcba2cd5e482",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "上",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "下",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "左",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "右",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "ok",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "-",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "+",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "菜单",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "home",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "返回",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "关闭",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 11,
        "x": 250,
        "y": 260,
        "wires": [
            [
                "e59a4c1570fccf65",
                "e23f6c10c7e22baf"
            ],
            [
                "2776a6bb4194f4f1"
            ],
            [
                "d7bec04d72634021"
            ],
            [
                "f82ebe924786783b"
            ],
            [
                "cfdc68af61bbb6d1"
            ],
            [
                "e6c19af1a9616ffe"
            ],
            [
                "aec30bf35ea3c0ab"
            ],
            [
                "94d1bdf06b7090c4"
            ],
            [
                "ef684200141d4a78"
            ],
            [
                "feb09b19e6edc1e1"
            ],
            [
                "c8e55bd525393150"
            ]
        ]
    },
    {
        "id": "c6009a658123e513",
        "type": "debug",
        "z": "67fafcba2cd5e482",
        "name": "debug 4",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 180,
        "y": 100,
        "wires": []
    },
    {
        "id": "e23f6c10c7e22baf",
        "type": "debug",
        "z": "67fafcba2cd5e482",
        "name": "debug 5",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 340,
        "y": 40,
        "wires": []
    },
    {
        "id": "3180962faa6346b6",
        "type": "websocket-client",
        "path": "ws://192.168.68.215:6689",
        "tls": "",
        "wholemsg": "false",
        "hb": "0",
        "subprotocol": "",
        "headers": []
    },
    {
        "id": "506ce5dbba3051cf",
        "type": "mqtt-broker",
        "name": "",
        "broker": "127.0.0.1",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "autoUnsubscribe": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthRetain": "false",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closeRetain": "false",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willRetain": "false",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    }
]
scripts.yaml:
unknown_3:
  sequence:
  - action: mqtt.publish
    metadata: {}
    data:
      evaluate_payload: false
      qos: 0
      retain: false
      topic: danbei/ha
      payload: 上
  alias: 当贝上
  description: ''
unknown_4:
  sequence:
  - action: mqtt.publish
    metadata: {}
    data:
      evaluate_payload: false
      qos: 0
      retain: false
      topic: danbei/ha
      payload: 下
  alias: 当贝下
  description: ''
unknown_5:
  sequence:
  - action: mqtt.publish
    metadata: {}
    data:
      evaluate_payload: false
      qos: 0
      retain: false
      topic: danbei/ha
      payload: 左
  alias: 当贝左
  description: ''
unknown_6:
  sequence:
  - action: mqtt.publish
    metadata: {}
    data:
      evaluate_payload: false
      qos: 0
      retain: false
      topic: danbei/ha
      payload: 右
  alias: 当贝右
  description: ''
ok:
  sequence:
  - action: mqtt.publish
    metadata: {}
    data:
      evaluate_payload: false
      qos: 0
      retain: false
      topic: danbei/ha
      payload: ok
  alias: 当贝ok
  description: ''
unknown_7:
  sequence:
  - action: mqtt.publish
    metadata: {}
    data:
      evaluate_payload: false
      qos: 0
      retain: false
      topic: danbei/ha
      payload: '-'
  alias: 当贝-
  description: ''
unknown_8:
  sequence:
  - action: mqtt.publish
    metadata: {}
    data:
      evaluate_payload: false
      qos: 0
      retain: false
      topic: danbei/ha
      payload: +
  alias: 当贝+
  description: ''
unknown_9:
  sequence:
  - action: mqtt.publish
    metadata: {}
    data:
      evaluate_payload: false
      qos: 0
      retain: false
      topic: danbei/ha
      payload: 菜单
  alias: 当贝菜单
  description: ''
home:
  sequence:
  - action: mqtt.publish
    metadata: {}
    data:
      evaluate_payload: false
      qos: 0
      retain: false
      topic: danbei/ha
      payload: home
  alias: 当贝home
  description: ''
unknown_10:
  sequence:
  - action: mqtt.publish
    metadata: {}
    data:
      evaluate_payload: false
      qos: 0
      retain: false
      topic: danbei/ha
      payload: 返回
  alias: 当贝返回
  description: ''
unknown_11:
  sequence:
  - action: mqtt.publish
    metadata: {}
    data:
      evaluate_payload: false
      qos: 0
      retain: false
      topic: danbei/ha
      payload: 关闭
  alias: 当贝关闭
  description: ''
unknown_12:
  sequence:
  - action: mqtt.publish
    metadata: {}
    data:
      evaluate_payload: false
      qos: 0
      retain: false
      topic: ble/1
      payload: 'on'
  alias: 当贝开机
  description: ''
ha脚本 开机是 mqtt使用esp32 发送ble广播开机的可以论坛搜索相关教程


回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2026-1-11 21:43 , Processed in 1.210785 second(s), 5 queries , MemCached On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

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