[
{
"id": "3cf60ddc3d8a32de",
"type": "function",
"z": "0af7ec16ee706e56",
"name": "function 3",
"func": "let battery_level=20;\nmsg.payload = {\n "data": {\n "entity_id": "media_player.xiaomi_lx5a_c964_play_control",\n "text": `主人,门锁电量${battery_level},请及时充电`\n }\n}\n\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 340,
"y": 700,
"wires": [
[
"8d1f0d64d8ce669d"
]
]
},
{
"id": "8d1f0d64d8ce669d",
"type": "api-call-service",
"z": "0af7ec16ee706e56",
"name": "小爱音箱",
"server": "39747b58.21e974",
"version": 5,
"debugenabled": false,
"domain": "xiaomi_miot",
"service": "intelligent_speaker",
"areaId": [],
"deviceId": [],
"entityId": [
"media_player.xiaomi_lx5a_c964_play_control"
],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 500,
"y": 700,
"wires": [
[]
]
},
{
"id": "bd5a2683856b72b0",
"type": "inject",
"z": "0af7ec16ee706e56",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 190,
"y": 700,
"wires": [
[
"3cf60ddc3d8a32de"
]
]
},
{
"id": "39747b58.21e974",
"type": "server",
"name": "Home Assistant",
"version": 5,
"addon": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"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:s",
"enableGlobalContextStore": true
}
]