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

标题: 普通音箱接入homeassistant,播放本地nas音乐教程 [打印本页]

作者: silas3082    时间: 2024-5-1 09:02
标题: 普通音箱接入homeassistant,播放本地nas音乐教程


将普通音响通过D1mini接入homeassistant,并播放nas中的音乐,并通过自制的无线开关控制(任意可以接入ha的开关都可以)


实现效果如下:




主要有一下几个步骤:

1.将D1mini刷入音响固件,并正确接线,配置好音响信息。这个可以参考Mrdiy大神的步骤,照着来不难。具体操作看:https://www.instructables.com/MQ ... -Play-MP3-TTS-RTTL/,这个


2.将nas中的音乐挂载到Alist,之前写了一个帖子可以参考。比如我的音乐存放在:“/volume1/music/经常听/”,挂在到alist为:“nas music/经常听”,不会配置的看下图:


[attach]58562[/attach]


3.在nr中将我的流导入:
[attach]58563[/attach]

  1. [
  2.     {
  3.         "id": "65eae738d91f64a3",
  4.         "type": "inject",
  5.         "z": "fdf7dc26597ae619",
  6.         "name": "",
  7.         "props": [
  8.             {
  9.                 "p": "payload"
  10.             },
  11.             {
  12.                 "p": "topic",
  13.                 "vt": "str"
  14.             }
  15.         ],
  16.         "repeat": "",
  17.         "crontab": "",
  18.         "once": false,
  19.         "onceDelay": 0.1,
  20.         "topic": "",
  21.         "payload": "",
  22.         "payloadType": "date",
  23.         "x": 350,
  24.         "y": 400,
  25.         "wires": [
  26.             [
  27.                 "3c8c7825f90a5f3b"
  28.             ]
  29.         ]
  30.     },
  31.     {
  32.         "id": "93c7b2b927b14214",
  33.         "type": "http request",
  34.         "z": "fdf7dc26597ae619",
  35.         "name": "",
  36.         "method": "POST",
  37.         "ret": "obj",
  38.         "paytoqs": "ignore",
  39.         "url": "http://192.168.1.222:5244/api/fs/list",
  40.         "tls": "",
  41.         "persist": false,
  42.         "proxy": "",
  43.         "insecureHTTPParser": false,
  44.         "authType": "",
  45.         "senderr": false,
  46.         "headers": [
  47.             {
  48.                 "keyType": "other",
  49.                 "keyValue": "Authorization",
  50.                 "valueType": "other",
  51.                 "valueValue": "XXXXXX"
  52.             }
  53.         ],
  54.         "x": 680,
  55.         "y": 400,
  56.         "wires": [
  57.             [
  58.                 "833c3b5c444f548b",
  59.                 "fe52ae74185a932e"
  60.             ]
  61.         ]
  62.     },
  63.     {
  64.         "id": "3c8c7825f90a5f3b",
  65.         "type": "function",
  66.         "z": "fdf7dc26597ae619",
  67.         "name": "function 50",
  68.         "func": "msg.payload = {"path":"/nas music/经常听","password":"","page":1,"per_page":0,"refresh":false}\nreturn msg;",
  69.         "outputs": 1,
  70.         "timeout": 0,
  71.         "noerr": 0,
  72.         "initialize": "",
  73.         "finalize": "",
  74.         "libs": [],
  75.         "x": 510,
  76.         "y": 400,
  77.         "wires": [
  78.             [
  79.                 "93c7b2b927b14214"
  80.             ]
  81.         ]
  82.     },
  83.     {
  84.         "id": "833c3b5c444f548b",
  85.         "type": "function",
  86.         "z": "fdf7dc26597ae619",
  87.         "name": "function 51",
  88.         "func": "var zongshu = msg.payload.data.total;\nvar randomNumber = Math.floor(Math.random() * zongshu);\nvar song_name = msg.payload.data.content[randomNumber-1].name;\n\nmsg.zongshu=zongshu;\nmsg.random = randomNumber;\nmsg.name=song_name;\nreturn msg;",
  89.         "outputs": 1,
  90.         "timeout": 0,
  91.         "noerr": 0,
  92.         "initialize": "",
  93.         "finalize": "",
  94.         "libs": [],
  95.         "x": 870,
  96.         "y": 400,
  97.         "wires": [
  98.             [
  99.                 "a4f751bd5147ca60"
  100.             ]
  101.         ]
  102.     },
  103.     {
  104.         "id": "a4f751bd5147ca60",
  105.         "type": "switch",
  106.         "z": "fdf7dc26597ae619",
  107.         "name": "",
  108.         "property": "name",
  109.         "propertyType": "msg",
  110.         "rules": [
  111.             {
  112.                 "t": "cont",
  113.                 "v": "mp3",
  114.                 "vt": "str"
  115.             },
  116.             {
  117.                 "t": "else"
  118.             }
  119.         ],
  120.         "checkall": "true",
  121.         "repair": false,
  122.         "outputs": 2,
  123.         "x": 1010,
  124.         "y": 400,
  125.         "wires": [
  126.             [
  127.                 "992a2b4398a5dc2f"
  128.             ],
  129.             [
  130.                 "df258a16334b7523"
  131.             ]
  132.         ]
  133.     },
  134.     {
  135.         "id": "32c83ecc50e35841",
  136.         "type": "mqtt in",
  137.         "z": "fdf7dc26597ae619",
  138.         "name": "",
  139.         "topic": "/mrdiynotifier/status",
  140.         "qos": "2",
  141.         "datatype": "auto-detect",
  142.         "broker": "15e9ca6a44eb2b20",
  143.         "nl": false,
  144.         "rap": true,
  145.         "rh": 0,
  146.         "inputs": 0,
  147.         "x": 390,
  148.         "y": 280,
  149.         "wires": [
  150.             [
  151.                 "a502c264232b0900"
  152.             ]
  153.         ]
  154.     },
  155.     {
  156.         "id": "0c920a6280c04f49",
  157.         "type": "mqtt out",
  158.         "z": "fdf7dc26597ae619",
  159.         "name": "",
  160.         "topic": "/mrdiynotifier/play",
  161.         "qos": "",
  162.         "retain": "",
  163.         "respTopic": "",
  164.         "contentType": "",
  165.         "userProps": "",
  166.         "correl": "",
  167.         "expiry": "",
  168.         "broker": "15e9ca6a44eb2b20",
  169.         "x": 1430,
  170.         "y": 380,
  171.         "wires": []
  172.     },
  173.     {
  174.         "id": "992a2b4398a5dc2f",
  175.         "type": "function",
  176.         "z": "fdf7dc26597ae619",
  177.         "name": "function 52",
  178.         "func": "\nvar name = encodeURI(msg.name);\nmsg.payload="http://192.168.1.222:5244/d/nas%20music/%E7%BB%8F%E5%B8%B8%E5%90%AC/"+name;\nreturn msg;",
  179.         "outputs": 1,
  180.         "timeout": 0,
  181.         "noerr": 0,
  182.         "initialize": "",
  183.         "finalize": "",
  184.         "libs": [],
  185.         "x": 1210,
  186.         "y": 380,
  187.         "wires": [
  188.             [
  189.                 "0c920a6280c04f49",
  190.                 "fc79be3ba922821c"
  191.             ]
  192.         ]
  193.     },
  194.     {
  195.         "id": "df258a16334b7523",
  196.         "type": "link out",
  197.         "z": "fdf7dc26597ae619",
  198.         "name": "不是MP3就重新请求",
  199.         "mode": "link",
  200.         "links": [
  201.             "ea373363454b30cb"
  202.         ],
  203.         "x": 1105,
  204.         "y": 460,
  205.         "wires": []
  206.     },
  207.     {
  208.         "id": "ea373363454b30cb",
  209.         "type": "link in",
  210.         "z": "fdf7dc26597ae619",
  211.         "name": "link in 7",
  212.         "links": [
  213.             "df258a16334b7523",
  214.             "5b1f3f7e12124dd3",
  215.             "160e354de1a6bc9c",
  216.             "c57947f6b27e0c0a"
  217.         ],
  218.         "x": 415,
  219.         "y": 440,
  220.         "wires": [
  221.             [
  222.                 "3c8c7825f90a5f3b"
  223.             ]
  224.         ]
  225.     },
  226.     {
  227.         "id": "a502c264232b0900",
  228.         "type": "ha-sensor",
  229.         "z": "fdf7dc26597ae619",
  230.         "name": "D1mini_player状态",
  231.         "entityConfig": "bcd483331e52fdeb",
  232.         "version": 0,
  233.         "state": "payload",
  234.         "stateType": "msg",
  235.         "attributes": [],
  236.         "inputOverride": "allow",
  237.         "outputProperties": [],
  238.         "x": 610,
  239.         "y": 280,
  240.         "wires": [
  241.             []
  242.         ]
  243.     },
  244.     {
  245.         "id": "1112acc17e85cf88",
  246.         "type": "ha-wait-until",
  247.         "z": "fdf7dc26597ae619",
  248.         "name": "",
  249.         "server": "459a05598e74e156",
  250.         "version": 2,
  251.         "outputs": 1,
  252.         "entityId": "sensor.d1mini_player",
  253.         "entityIdFilterType": "exact",
  254.         "property": "state",
  255.         "comparator": "is",
  256.         "value": "idle",
  257.         "valueType": "str",
  258.         "timeout": "",
  259.         "timeoutType": "num",
  260.         "timeoutUnits": "seconds",
  261.         "checkCurrentState": true,
  262.         "blockInputOverrides": true,
  263.         "outputProperties": [],
  264.         "entityLocation": "data",
  265.         "entityLocationType": "none",
  266.         "x": 860,
  267.         "y": 520,
  268.         "wires": [
  269.             [
  270.                 "156cb526d4306d4a"
  271.             ]
  272.         ]
  273.     },
  274.     {
  275.         "id": "5b1f3f7e12124dd3",
  276.         "type": "link out",
  277.         "z": "fdf7dc26597ae619",
  278.         "name": "不是MP3就重新请求",
  279.         "mode": "link",
  280.         "links": [
  281.             "ea373363454b30cb"
  282.         ],
  283.         "x": 1405,
  284.         "y": 480,
  285.         "wires": []
  286.     },
  287.     {
  288.         "id": "964294f2f1016a0c",
  289.         "type": "comment",
  290.         "z": "fdf7dc26597ae619",
  291.         "name": "D1mini-player",
  292.         "info": "",
  293.         "x": 390,
  294.         "y": 160,
  295.         "wires": []
  296.     },
  297.     {
  298.         "id": "9eb7ed31cedb42af",
  299.         "type": "comment",
  300.         "z": "fdf7dc26597ae619",
  301.         "name": "播放",
  302.         "info": "",
  303.         "x": 330,
  304.         "y": 340,
  305.         "wires": []
  306.     },
  307.     {
  308.         "id": "468436a9f17f97d7",
  309.         "type": "delay",
  310.         "z": "fdf7dc26597ae619",
  311.         "name": "",
  312.         "pauseType": "delay",
  313.         "timeout": "30",
  314.         "timeoutUnits": "seconds",
  315.         "rate": "1",
  316.         "nbRateUnits": "1",
  317.         "rateUnits": "second",
  318.         "randomFirst": "1",
  319.         "randomLast": "5",
  320.         "randomUnits": "seconds",
  321.         "drop": false,
  322.         "allowrate": false,
  323.         "outputs": 1,
  324.         "x": 700,
  325.         "y": 520,
  326.         "wires": [
  327.             [
  328.                 "1112acc17e85cf88"
  329.             ]
  330.         ]
  331.     },
  332.     {
  333.         "id": "1c2f09261045f962",
  334.         "type": "ha-switch",
  335.         "z": "fdf7dc26597ae619",
  336.         "name": "D1mini-player开关",
  337.         "version": 0,
  338.         "debugenabled": false,
  339.         "inputs": 0,
  340.         "outputs": 2,
  341.         "entityConfig": "1ca8bde6237bf8a6",
  342.         "enableInput": false,
  343.         "outputOnStateChange": false,
  344.         "outputProperties": [
  345.             {
  346.                 "property": "outputType",
  347.                 "propertyType": "msg",
  348.                 "value": "state change",
  349.                 "valueType": "str"
  350.             },
  351.             {
  352.                 "property": "payload",
  353.                 "propertyType": "msg",
  354.                 "value": "",
  355.                 "valueType": "entityState"
  356.             }
  357.         ],
  358.         "x": 390,
  359.         "y": 220,
  360.         "wires": [
  361.             [],
  362.             []
  363.         ]
  364.     },
  365.     {
  366.         "id": "156cb526d4306d4a",
  367.         "type": "api-current-state",
  368.         "z": "fdf7dc26597ae619",
  369.         "name": "",
  370.         "server": "459a05598e74e156",
  371.         "version": 3,
  372.         "outputs": 2,
  373.         "halt_if": "on",
  374.         "halt_if_type": "str",
  375.         "halt_if_compare": "is",
  376.         "entity_id": "switch.d1mini_playerkai_guan",
  377.         "state_type": "str",
  378.         "blockInputOverrides": false,
  379.         "outputProperties": [
  380.             {
  381.                 "property": "payload",
  382.                 "propertyType": "msg",
  383.                 "value": "",
  384.                 "valueType": "entityState"
  385.             },
  386.             {
  387.                 "property": "data",
  388.                 "propertyType": "msg",
  389.                 "value": "",
  390.                 "valueType": "entity"
  391.             }
  392.         ],
  393.         "for": "0",
  394.         "forType": "num",
  395.         "forUnits": "minutes",
  396.         "override_topic": false,
  397.         "state_location": "payload",
  398.         "override_payload": "msg",
  399.         "entity_location": "data",
  400.         "override_data": "msg",
  401.         "x": 1150,
  402.         "y": 520,
  403.         "wires": [
  404.             [
  405.                 "5b1f3f7e12124dd3"
  406.             ],
  407.             []
  408.         ]
  409.     },
  410.     {
  411.         "id": "baf139d33a7fb182",
  412.         "type": "server-state-changed",
  413.         "z": "fdf7dc26597ae619",
  414.         "name": "",
  415.         "server": "459a05598e74e156",
  416.         "version": 4,
  417.         "exposeToHomeAssistant": false,
  418.         "haConfig": [
  419.             {
  420.                 "property": "name",
  421.                 "value": ""
  422.             },
  423.             {
  424.                 "property": "icon",
  425.                 "value": ""
  426.             }
  427.         ],
  428.         "entityidfilter": "sensor.d1mini_player",
  429.         "entityidfiltertype": "exact",
  430.         "outputinitially": false,
  431.         "state_type": "str",
  432.         "haltifstate": "playing",
  433.         "halt_if_type": "str",
  434.         "halt_if_compare": "is",
  435.         "outputs": 2,
  436.         "output_only_on_state_change": true,
  437.         "for": "10",
  438.         "forType": "num",
  439.         "forUnits": "seconds",
  440.         "ignorePrevStateNull": false,
  441.         "ignorePrevStateUnknown": false,
  442.         "ignorePrevStateUnavailable": false,
  443.         "ignoreCurrentStateUnknown": false,
  444.         "ignoreCurrentStateUnavailable": false,
  445.         "outputProperties": [
  446.             {
  447.                 "property": "payload",
  448.                 "propertyType": "msg",
  449.                 "value": "",
  450.                 "valueType": "entityState"
  451.             },
  452.             {
  453.                 "property": "data",
  454.                 "propertyType": "msg",
  455.                 "value": "",
  456.                 "valueType": "eventData"
  457.             },
  458.             {
  459.                 "property": "topic",
  460.                 "propertyType": "msg",
  461.                 "value": "",
  462.                 "valueType": "triggerId"
  463.             }
  464.         ],
  465.         "x": 410,
  466.         "y": 520,
  467.         "wires": [
  468.             [
  469.                 "468436a9f17f97d7"
  470.             ],
  471.             []
  472.         ]
  473.     },
  474.     {
  475.         "id": "3a4b092b606f2879",
  476.         "type": "mqtt in",
  477.         "z": "fdf7dc26597ae619",
  478.         "name": "A无线开关",
  479.         "topic": "espnow/topic",
  480.         "qos": "0",
  481.         "datatype": "auto-detect",
  482.         "broker": "15e9ca6a44eb2b20",
  483.         "nl": false,
  484.         "rap": true,
  485.         "rh": 0,
  486.         "inputs": 0,
  487.         "x": 340,
  488.         "y": 720,
  489.         "wires": [
  490.             [
  491.                 "4bf283517a0bb126",
  492.                 "ec844c5f740874c5"
  493.             ]
  494.         ]
  495.     },
  496.     {
  497.         "id": "4bf283517a0bb126",
  498.         "type": "switch",
  499.         "z": "fdf7dc26597ae619",
  500.         "name": "",
  501.         "property": "payload",
  502.         "propertyType": "msg",
  503.         "rules": [
  504.             {
  505.                 "t": "eq",
  506.                 "v": "A-1",
  507.                 "vt": "str"
  508.             },
  509.             {
  510.                 "t": "eq",
  511.                 "v": "A-2",
  512.                 "vt": "str"
  513.             },
  514.             {
  515.                 "t": "eq",
  516.                 "v": "A-3",
  517.                 "vt": "str"
  518.             }
  519.         ],
  520.         "checkall": "true",
  521.         "repair": false,
  522.         "outputs": 3,
  523.         "x": 550,
  524.         "y": 720,
  525.         "wires": [
  526.             [
  527.                 "160e354de1a6bc9c",
  528.                 "1af9a25873b49f54"
  529.             ],
  530.             [
  531.                 "c57947f6b27e0c0a"
  532.             ],
  533.             [
  534.                 "f2f7a29ae1c871b0",
  535.                 "9d6834fe15e5930e"
  536.             ]
  537.         ]
  538.     },
  539.     {
  540.         "id": "160e354de1a6bc9c",
  541.         "type": "link out",
  542.         "z": "fdf7dc26597ae619",
  543.         "name": "不是MP3就重新请求",
  544.         "mode": "link",
  545.         "links": [
  546.             "ea373363454b30cb"
  547.         ],
  548.         "x": 675,
  549.         "y": 640,
  550.         "wires": []
  551.     },
  552.     {
  553.         "id": "1af9a25873b49f54",
  554.         "type": "api-call-service",
  555.         "z": "fdf7dc26597ae619",
  556.         "name": "",
  557.         "server": "459a05598e74e156",
  558.         "version": 5,
  559.         "debugenabled": false,
  560.         "domain": "switch",
  561.         "service": "turn_on",
  562.         "areaId": [],
  563.         "deviceId": [],
  564.         "entityId": [
  565.             "switch.d1mini_playerkai_guan"
  566.         ],
  567.         "data": "",
  568.         "dataType": "jsonata",
  569.         "mergeContext": "",
  570.         "mustacheAltTags": false,
  571.         "outputProperties": [],
  572.         "queue": "none",
  573.         "x": 860,
  574.         "y": 640,
  575.         "wires": [
  576.             []
  577.         ]
  578.     },
  579.     {
  580.         "id": "f2f7a29ae1c871b0",
  581.         "type": "api-call-service",
  582.         "z": "fdf7dc26597ae619",
  583.         "name": "",
  584.         "server": "459a05598e74e156",
  585.         "version": 5,
  586.         "debugenabled": false,
  587.         "domain": "switch",
  588.         "service": "turn_off",
  589.         "areaId": [],
  590.         "deviceId": [],
  591.         "entityId": [
  592.             "switch.d1mini_playerkai_guan"
  593.         ],
  594.         "data": "",
  595.         "dataType": "jsonata",
  596.         "mergeContext": "",
  597.         "mustacheAltTags": false,
  598.         "outputProperties": [],
  599.         "queue": "none",
  600.         "x": 760,
  601.         "y": 780,
  602.         "wires": [
  603.             []
  604.         ]
  605.     },
  606.     {
  607.         "id": "9d6834fe15e5930e",
  608.         "type": "mqtt out",
  609.         "z": "fdf7dc26597ae619",
  610.         "name": "",
  611.         "topic": "/mrdiynotifier/stop",
  612.         "qos": "",
  613.         "retain": "",
  614.         "respTopic": "",
  615.         "contentType": "",
  616.         "userProps": "",
  617.         "correl": "",
  618.         "expiry": "",
  619.         "broker": "15e9ca6a44eb2b20",
  620.         "x": 790,
  621.         "y": 860,
  622.         "wires": []
  623.     },
  624.     {
  625.         "id": "c57947f6b27e0c0a",
  626.         "type": "link out",
  627.         "z": "fdf7dc26597ae619",
  628.         "name": "不是MP3就重新请求",
  629.         "mode": "link",
  630.         "links": [
  631.             "ea373363454b30cb"
  632.         ],
  633.         "x": 735,
  634.         "y": 720,
  635.         "wires": []
  636.     },
  637.     {
  638.         "id": "a3d4adb9cd02d6af",
  639.         "type": "inject",
  640.         "z": "fdf7dc26597ae619",
  641.         "name": "",
  642.         "props": [
  643.             {
  644.                 "p": "payload"
  645.             },
  646.             {
  647.                 "p": "topic",
  648.                 "vt": "str"
  649.             }
  650.         ],
  651.         "repeat": "",
  652.         "crontab": "",
  653.         "once": false,
  654.         "onceDelay": 0.1,
  655.         "topic": "",
  656.         "payload": "A-1",
  657.         "payloadType": "str",
  658.         "x": 370,
  659.         "y": 660,
  660.         "wires": [
  661.             [
  662.                 "4bf283517a0bb126"
  663.             ]
  664.         ]
  665.     },
  666.     {
  667.         "id": "d27904daf87e9494",
  668.         "type": "inject",
  669.         "z": "fdf7dc26597ae619",
  670.         "name": "",
  671.         "props": [
  672.             {
  673.                 "p": "payload"
  674.             },
  675.             {
  676.                 "p": "topic",
  677.                 "vt": "str"
  678.             }
  679.         ],
  680.         "repeat": "",
  681.         "crontab": "",
  682.         "once": false,
  683.         "onceDelay": 0.1,
  684.         "topic": "",
  685.         "payload": "A-2",
  686.         "payloadType": "str",
  687.         "x": 390,
  688.         "y": 800,
  689.         "wires": [
  690.             [
  691.                 "4bf283517a0bb126"
  692.             ]
  693.         ]
  694.     },
  695.     {
  696.         "id": "5bdfa5a3ae721c1d",
  697.         "type": "inject",
  698.         "z": "fdf7dc26597ae619",
  699.         "name": "",
  700.         "props": [
  701.             {
  702.                 "p": "payload"
  703.             },
  704.             {
  705.                 "p": "topic",
  706.                 "vt": "str"
  707.             }
  708.         ],
  709.         "repeat": "",
  710.         "crontab": "",
  711.         "once": false,
  712.         "onceDelay": 0.1,
  713.         "topic": "",
  714.         "payload": "A-3",
  715.         "payloadType": "str",
  716.         "x": 390,
  717.         "y": 860,
  718.         "wires": [
  719.             [
  720.                 "4bf283517a0bb126"
  721.             ]
  722.         ]
  723.     },
  724.     {
  725.         "id": "ec844c5f740874c5",
  726.         "type": "debug",
  727.         "z": "fdf7dc26597ae619",
  728.         "name": "debug 368",
  729.         "active": true,
  730.         "tosidebar": true,
  731.         "console": false,
  732.         "tostatus": false,
  733.         "complete": "false",
  734.         "statusVal": "",
  735.         "statusType": "auto",
  736.         "x": 530,
  737.         "y": 640,
  738.         "wires": []
  739.     },
  740.     {
  741.         "id": "fe52ae74185a932e",
  742.         "type": "debug",
  743.         "z": "fdf7dc26597ae619",
  744.         "name": "debug 369",
  745.         "active": true,
  746.         "tosidebar": true,
  747.         "console": false,
  748.         "tostatus": false,
  749.         "complete": "true",
  750.         "targetType": "full",
  751.         "statusVal": "",
  752.         "statusType": "auto",
  753.         "x": 930,
  754.         "y": 300,
  755.         "wires": []
  756.     },
  757.     {
  758.         "id": "fc79be3ba922821c",
  759.         "type": "debug",
  760.         "z": "fdf7dc26597ae619",
  761.         "name": "debug 370",
  762.         "active": true,
  763.         "tosidebar": true,
  764.         "console": false,
  765.         "tostatus": false,
  766.         "complete": "true",
  767.         "targetType": "full",
  768.         "statusVal": "",
  769.         "statusType": "auto",
  770.         "x": 1350,
  771.         "y": 300,
  772.         "wires": []
  773.     },
  774.     {
  775.         "id": "15e9ca6a44eb2b20",
  776.         "type": "mqtt-broker",
  777.         "name": "",
  778.         "broker": "192.168.1.100",
  779.         "port": "1883",
  780.         "clientid": "",
  781.         "autoConnect": true,
  782.         "usetls": false,
  783.         "protocolVersion": "4",
  784.         "keepalive": "60",
  785.         "cleansession": true,
  786.         "autoUnsubscribe": true,
  787.         "birthTopic": "",
  788.         "birthQos": "0",
  789.         "birthRetain": "false",
  790.         "birthPayload": "",
  791.         "birthMsg": {},
  792.         "closeTopic": "",
  793.         "closeQos": "0",
  794.         "closeRetain": "false",
  795.         "closePayload": "",
  796.         "closeMsg": {},
  797.         "willTopic": "",
  798.         "willQos": "0",
  799.         "willRetain": "false",
  800.         "willPayload": "",
  801.         "willMsg": {},
  802.         "userProps": "",
  803.         "sessionExpiry": ""
  804.     },
  805.     {
  806.         "id": "bcd483331e52fdeb",
  807.         "type": "ha-entity-config",
  808.         "server": "459a05598e74e156",
  809.         "deviceConfig": "",
  810.         "name": "",
  811.         "version": "6",
  812.         "entityType": "sensor",
  813.         "haConfig": [
  814.             {
  815.                 "property": "name",
  816.                 "value": "D1mini_player"
  817.             },
  818.             {
  819.                 "property": "icon",
  820.                 "value": ""
  821.             },
  822.             {
  823.                 "property": "entity_category",
  824.                 "value": ""
  825.             },
  826.             {
  827.                 "property": "entity_picture",
  828.                 "value": ""
  829.             },
  830.             {
  831.                 "property": "device_class",
  832.                 "value": ""
  833.             },
  834.             {
  835.                 "property": "unit_of_measurement",
  836.                 "value": ""
  837.             },
  838.             {
  839.                 "property": "state_class",
  840.                 "value": ""
  841.             }
  842.         ],
  843.         "resend": false,
  844.         "debugEnabled": false
  845.     },
  846.     {
  847.         "id": "459a05598e74e156",
  848.         "type": "server",
  849.         "name": "Home Assistant",
  850.         "version": 5,
  851.         "addon": false,
  852.         "rejectUnauthorizedCerts": true,
  853.         "ha_boolean": "y|yes|true|on|home|open",
  854.         "connectionDelay": true,
  855.         "cacheJson": true,
  856.         "heartbeat": false,
  857.         "heartbeatInterval": "30",
  858.         "areaSelector": "friendlyName",
  859.         "deviceSelector": "friendlyName",
  860.         "entitySelector": "friendlyName",
  861.         "statusSeparator": ": ",
  862.         "statusYear": "hidden",
  863.         "statusMonth": "short",
  864.         "statusDay": "numeric",
  865.         "statusHourCycle": "default",
  866.         "statusTimeFormat": "h:m",
  867.         "enableGlobalContextStore": false
  868.     },
  869.     {
  870.         "id": "1ca8bde6237bf8a6",
  871.         "type": "ha-entity-config",
  872.         "server": "459a05598e74e156",
  873.         "deviceConfig": "",
  874.         "name": "",
  875.         "version": "6",
  876.         "entityType": "switch",
  877.         "haConfig": [
  878.             {
  879.                 "property": "name",
  880.                 "value": "D1mini-player开关"
  881.             },
  882.             {
  883.                 "property": "icon",
  884.                 "value": ""
  885.             },
  886.             {
  887.                 "property": "entity_category",
  888.                 "value": ""
  889.             },
  890.             {
  891.                 "property": "entity_picture",
  892.                 "value": ""
  893.             },
  894.             {
  895.                 "property": "device_class",
  896.                 "value": ""
  897.             }
  898.         ],
  899.         "resend": false,
  900.         "debugEnabled": false
  901.     }
  902. ]
复制代码
修改http request节点和其前边的function节点,改为你自己的数据。保存部署就行了


作者: Jarvis    时间: 2024-5-1 12:11
很厉害呀。有一个问题,这种方式连接音箱的话,是否会有电流杂音?
作者: mitu    时间: 2024-5-1 12:28
它的TTS支持中文吗?
作者: silas3082    时间: 2024-5-1 12:44
mitu 发表于 2024-5-1 12:28
它的TTS支持中文吗?

不支持。。。。?
作者: qxdnzx    时间: 2024-5-1 18:02
电路很简单,就不知道这个音质好不,如果不行就做语音提醒
作者: ilongjiang    时间: 2024-5-2 20:43
流复制出错
作者: silas3082    时间: 2024-5-3 12:55
Jarvis 发表于 2024-5-1 12:11
很厉害呀。有一个问题,这种方式连接音箱的话,是否会有电流杂音?

有杂音。。。。
作者: Jarvis    时间: 2024-5-3 14:24
silas3082 发表于 2024-5-3 12:55
有杂音。。。。

嗯,感谢。杂音问题确实不太好解决
作者: silang521    时间: 2024-5-5 09:23
mitu 发表于 2024-5-1 12:28
它的TTS支持中文吗?

借助中文tts可以实现中文tts,我这边已经实现
作者: silang521    时间: 2024-5-5 09:25
杂音问题上功放板就能解决
作者: silas3082    时间: 2024-5-5 11:26
silang521 发表于 2024-5-5 09:25
杂音问题上功放板就能解决

好的,,谢谢提醒
作者: mitu    时间: 2024-5-11 16:31
经过实验,杂音比较大
作者: zhang18    时间: 2024-6-27 20:57
老哥,你好,能否在更新下你的那个电视语音小雅播放电影的流程啊,跪求,hassos感觉不能用
作者: alonemars    时间: 2024-11-10 17:12
复制代码导入流程提示出错,没用过nodered麻烦楼主帮看一下什么原因。

SyntaxError: JSON.parse: expected ',' or '}' after property value in object at line 68 column 34 of the JSON data

payload = {"path":"/nas





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