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

 找回密码
 立即注册
查看: 761|回复: 4

[教程系列] 求助如何用nodered流读取或者控制小爱同学的音量

[复制链接]

2

主题

13

帖子

146

积分

注册会员

Rank: 2

积分
146
金钱
133
HASS币
0
发表于 2023-10-15 11:36:02 | 显示全部楼层 |阅读模式
HA上可以控制小爱的音量。放在nodered中要如何写。求大神指导一下
回复

使用道具 举报

54

主题

351

帖子

1569

积分

金牌会员

Rank: 6Rank: 6

积分
1569
金钱
1213
HASS币
0
发表于 2023-10-15 14:01:10 | 显示全部楼层
同问,通过蓝牙或者带airplay功能的小爱音箱播放歌曲后,再次唤醒小爱同学如何自动恢复之前的音量设置。
回复

使用道具 举报

1

主题

31

帖子

695

积分

高级会员

Rank: 4

积分
695
金钱
664
HASS币
0
发表于 2023-10-16 11:34:49 | 显示全部楼层
三种都可以

小爱音量.rar

897 Bytes, 下载次数: 40

评分

参与人数 1金钱 +5 收起 理由
lj415243423 + 5

查看全部评分

回复

使用道具 举报

20

主题

56

帖子

336

积分

中级会员

Rank: 3Rank: 3

积分
336
金钱
280
HASS币
0
发表于 2024-4-25 11:31:32 | 显示全部楼层

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

使用道具 举报

1

主题

31

帖子

695

积分

高级会员

Rank: 4

积分
695
金钱
664
HASS币
0
发表于 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
    }
]
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-6 01:47 , Processed in 0.056864 second(s), 30 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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