lj415243423 发表于 2023-10-15 11:36:02

求助如何用nodered流读取或者控制小爱同学的音量

HA上可以控制小爱的音量。放在nodered中要如何写。求大神指导一下

lichao622 发表于 2023-10-15 14:01:10

同问,通过蓝牙或者带airplay功能的小爱音箱播放歌曲后,再次唤醒小爱同学如何自动恢复之前的音量设置。

z1014619330 发表于 2023-10-16 11:34:49

三种都可以

xiaoxiaoma888 发表于 2024-4-25 11:31:32

z1014619330 发表于 2023-10-16 11:34
三种都可以

如何通过current state节点获取小爱的音箱呢,比如判断当音箱大于多少,或者等于多少时

z1014619330 发表于 2024-4-27 11:47:26

xiaoxiaoma888 发表于 2024-4-25 11:31
如何通过current state节点获取小爱的音箱呢,比如判断当音箱大于多少,或者等于多少时 ...

[
    {
      "id": "facba989297a7ad7",
      "type": "inject",
      "z": "40338f2c11e8254b",
      "name": "",
      "props": [],
      "repeat": "",
      "crontab": "",
      "once": false,
      "onceDelay": 0.1,
      "topic": "",
      "x": 550,
      "y": 2300,
      "wires": [
            [
                "db200ed5a0bb4203"
            ]
      ]
    },
    {
      "id": "f5f1e3d0787e7e6c",
      "type": "debug",
      "z": "40338f2c11e8254b",
      "name": "debug 80",
      "active": true,
      "tosidebar": true,
      "console": false,
      "tostatus": false,
      "complete": "payload",
      "targetType": "msg",
      "statusVal": "",
      "statusType": "auto",
      "x": 1200,
      "y": 2300,
      "wires": []
    },
    {
      "id": "db200ed5a0bb4203",
      "type": "api-current-state",
      "z": "40338f2c11e8254b",
      "name": "play_control",
      "server": "a98d657cf9377f5c",
      "version": 3,
      "outputs": 1,
      "halt_if": "",
      "halt_if_type": "str",
      "halt_if_compare": "is",
      "entity_id": "media_player.xiaomi_l09b_3716_play_control",
      "state_type": "str",
      "blockInputOverrides": false,
      "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
      ],
      "for": "0",
      "forType": "num",
      "forUnits": "minutes",
      "override_topic": false,
      "state_location": "payload",
      "override_payload": "msg",
      "entity_location": "data",
      "override_data": "msg",
      "x": 690,
      "y": 2300,
      "wires": [
            [
                "0395b50ed7bc6f21"
            ]
      ]
    },
    {
      "id": "8f22f20a929380f4",
      "type": "switch",
      "z": "40338f2c11e8254b",
      "name": "判断",
      "property": "data.attributes.volume_level",
      "propertyType": "msg",
      "rules": [
            {
                "t": "eq",
                "v": "0.36",
                "vt": "num"
            },
            {
                "t": "lt",
                "v": "0.36",
                "vt": "num"
            },
            {
                "t": "gt",
                "v": "0.36",
                "vt": "num"
            }
      ],
      "checkall": "true",
      "repair": false,
      "outputs": 3,
      "x": 1030,
      "y": 2300,
      "wires": [
            [
                "f5f1e3d0787e7e6c"
            ],
            [],
            []
      ]
    },
    {
      "id": "0395b50ed7bc6f21",
      "type": "function",
      "z": "40338f2c11e8254b",
      "name": "提取volume_level",
      "func": "msg.payload = msg.data.attributes.volume_level\nreturn msg;",
      "outputs": 1,
      "timeout": 0,
      "noerr": 0,
      "initialize": "",
      "finalize": "",
      "libs": [],
      "x": 870,
      "y": 2300,
      "wires": [
            [
                "8f22f20a929380f4"
            ]
      ]
    },
    {
      "id": "a98d657cf9377f5c",
      "type": "server",
      "name": "Home Assistant",
      "version": 5,
      "addon": false,
      "rejectUnauthorizedCerts": true,
      "ha_boolean": "y|yes|true|on|home|open",
      "connectionDelay": false,
      "cacheJson": true,
      "heartbeat": false,
      "heartbeatInterval": "30",
      "areaSelector": "friendlyName",
      "deviceSelector": "friendlyName",
      "entitySelector": "friendlyName",
      "statusSeparator": "at: ",
      "statusYear": "hidden",
      "statusMonth": "short",
      "statusDay": "numeric",
      "statusHourCycle": "h23",
      "statusTimeFormat": "h:m",
      "enableGlobalContextStore": true
    }
]
页: [1]
查看完整版本: 求助如何用nodered流读取或者控制小爱同学的音量