找回密码
 立即注册

微信扫码登录

搜索
查看: 1087|回复: 17

[技术讨论] 新日两轮电动车利用nodered接入ha

[复制链接]

3

主题

24

回帖

505

积分

高级会员

积分
505
金钱
478
HASS币
0
发表于 2025-9-5 12:33:33 | 显示全部楼层 |阅读模式
本帖最后由 1124620045 于 2025-9-15 16:52 编辑

使用手机抓取登录时加密的账号密码字符串
使用流程登录后token储存在上下文流程变量中供相关节点进行调用

点击【时间戳】节点即可获取车辆状态参数(参数对应的状态名称需要自行理解,ha实体也需要自行创建)

注意事项:
1. 使用手机端同一个账号获取车辆状态可能会导致手机车控部分掉线,出现手机钥匙失效的情况。相反手机端掉线会自动重新获取token,导致nodered中的token失效
解决办法:将车辆分享给另外一个账号,一个账号用来日常使用,一个账号只用来获取车辆状态
2. 用于获取车辆数据的账号不要在APP上面登录,如果登录nodered上token将失效


3.抓包域名需要手动添加端口号
4.登录时选择账号密码,把加密后的账号密码字符串填入nodered节点
一个凑合能用的流  在账号登陆与GPS设备数据处理节点中有需要填入部分已标出导入填完后可以自己添加一个触发节点到账号登陆节点触发一下就可以在上下文数据中查看相关数据了

[
    {
        "id": "910e49601765fe85",
        "type": "function",
        "z": "d5fc7a0af200ba50",
        "name": "获取电动车基本信息",
        "func": "// 构建请求的配置对象\nmsg = {\n    // URL(含路径)\n    url: "https://lism.lixcx.com:32026/smartBike/consumer/deviceIndex/v2/deviceList",\n    // 请求方法:GET\n    method: "GET",\n    // URL 参数(会自动拼接到 URL 后)\n    params: {\n        deviceCode: "W3R1WTHD0C8"\n    },\n    // 请求头信息\n    headers: {\n        "Content-Type": "application/json;charset=UTF-8",\n        "source": "app-smartbike",\n        "Authorization": flow.get("电动车保存参数.token.token"),\n        "Host": "lism.lixcx.com:32026",\n        "Connection": "Keep-Alive",\n        "Accept-Encoding": "gzip",\n        "User-Agent": "okhttp/3.12.0"\n    }\n};\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 980,
        "y": 580,
        "wires": [
            [
                "50f7fcee91f2f3d5"
            ]
        ]
    },
    {
        "id": "33236a8d0e2466d8",
        "type": "http request",
        "z": "d5fc7a0af200ba50",
        "name": "",
        "method": "use",
        "ret": "obj",
        "paytoqs": "ignore",
        "url": "",
        "tls": "",
        "persist": true,
        "proxy": "",
        "insecureHTTPParser": true,
        "authType": "",
        "senderr": true,
        "headers": [],
        "x": 1180,
        "y": 480,
        "wires": [
            [
                "e892ed2cf48fdcb8"
            ]
        ]
    },
    {
        "id": "2bf723aa70ed1af8",
        "type": "function",
        "z": "d5fc7a0af200ba50",
        "name": "账号登陆",
        "func": "//加密后的账号密码字符串\nlet pwd ="在此填入加密后的账号密码字符串"  \nconst headers = {\n    "source": "app-smartbike",\n    "Content-Type": "application/json;charset=UTF-8",\n    "Host": "lism.lixcx.com:32026",\n    "Connection": "Keep-Alive",\n    "Accept-Encoding": "gzip",\n    "User-Agent": "okhttp/3.12.0"\n};\n\n// 构造请求体(JSON 格式)\nconst payload = {\n    "bioIdentification": "0",\n    "key": pwd\n};\n\n// 设置消息对象(供 http request 节点使用)\nmsg.url = "https://lism.lixcx.com:32026/UserCenter/auth/account/login/password";\nmsg.method = "POST";\nmsg.headers = headers;\nmsg.payload = payload;\n\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1000,
        "y": 480,
        "wires": [
            [
                "33236a8d0e2466d8"
            ]
        ]
    },
    {
        "id": "e892ed2cf48fdcb8",
        "type": "change",
        "z": "d5fc7a0af200ba50",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "电动车保存参数.token",
                "pt": "flow",
                "to": "payload.obj",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1420,
        "y": 480,
        "wires": [
            []
        ]
    },
    {
        "id": "50f7fcee91f2f3d5",
        "type": "http request",
        "z": "d5fc7a0af200ba50",
        "name": "",
        "method": "use",
        "ret": "obj",
        "paytoqs": "ignore",
        "url": "https://lism.lixcx.com:32026/smartBike/consumer/deviceIndex/v2/deviceList",
        "tls": "",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "",
        "senderr": false,
        "headers": [],
        "x": 1180,
        "y": 580,
        "wires": [
            [
                "edb55047c750087f"
            ]
        ]
    },
    {
        "id": "edb55047c750087f",
        "type": "change",
        "z": "d5fc7a0af200ba50",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "电动车保存参数.bike",
                "pt": "flow",
                "to": "payload.obj",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1410,
        "y": 580,
        "wires": [
            []
        ]
    },
    {
        "id": "415fcf7f3c0e0489",
        "type": "function",
        "z": "d5fc7a0af200ba50",
        "name": "获取电动车基本信息",
        "func": "// 构建请求的配置对象\nmsg = {\n    // URL(含路径)\n    url: `https://lism.lixcx.com:32026/smartBike/consumer/deviceIndex/deviceInfo?bindingId=${flow.get("电动车保存参数.bike.bike[0].id")}&deviceType=${flow.get("电动车保存参数.bike.bike[0].deviceType")}&templateId=${flow.get("电动车保存参数.bike.bike[0].templateId")}&type=${flow.get("电动车保存参数.bike.bike[0].type")}&version=v2`,\n    // 请求方法:GET\n    method: "GET",\n    // URL 参数(会自动拼接到 URL 后)\n    params: {\n       deviceCode: "W3R1WTHD0C8"\n    },\n    // 请求头信息\n    headers: {\n        "Content-Type": "application/json;charset=UTF-8",\n        "source": "app-smartbike",\n        "Authorization": flow.get("电动车保存参数.token.token"),\n        "Host": "lism.lixcx.com:32026",\n        "Connection": "Keep-Alive",\n        "Accept-Encoding": "gzip",\n        "User-Agent": "okhttp/3.12.0"\n    }\n};\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 980,
        "y": 660,
        "wires": [
            [
                "cd8097f3a5bfa970"
            ]
        ]
    },
    {
        "id": "cd8097f3a5bfa970",
        "type": "http request",
        "z": "d5fc7a0af200ba50",
        "name": "",
        "method": "use",
        "ret": "obj",
        "paytoqs": "ignore",
        "url": "",
        "tls": "",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "",
        "senderr": false,
        "headers": [],
        "x": 1180,
        "y": 660,
        "wires": [
            [
                "3e03b06ae3439d9c"
            ]
        ]
    },
    {
        "id": "3e03b06ae3439d9c",
        "type": "change",
        "z": "d5fc7a0af200ba50",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "电动车保存参数.2",
                "pt": "flow",
                "to": "payload.obj.bike",
                "tot": "msg",
                "dc": true
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1400,
        "y": 660,
        "wires": [
            []
        ]
    },
    {
        "id": "949b104e6ff9be59",
        "type": "function",
        "z": "d5fc7a0af200ba50",
        "name": "获取历史骑行信息",
        "func": "const todayStart = new Date(new Date().setHours(0, 0, 0, 0)).getTime();\nconst todayEnd = new Date(new Date().setHours(24, 0, 0, 0) - 1).getTime();\n// 获取前一天的日期对象\nconst yesterday = new Date();\nyesterday.setDate(yesterday.getDate() - 1);\nconst yesterdayStart = new Date(yesterday);\nyesterdayStart.setHours(0, 0, 0, 0);\nconst yesterdayStartTimestamp = yesterdayStart.getTime();\n// 构建请求的配置对象\nmsg = {\n    // URL(含路径)\n    url: `https://lism.lixcx.com:32026/smartBike/consumer/travel/getHistoricalTrack?bikeId=577937&startDate=${todayStart}&endDate=${todayEnd}&pageNo=0&pageSize=1`,\n                                                                                                                                                           \n    // 请求方法:GET\n    method: "GET",\n    // URL 参数(会自动拼接到 URL 后)\n    // 请求头信息\n    headers: {\n        "Content-Type": "application/json;charset=UTF-8",\n        "source": "app-smartbike",\n        "Authorization": flow.get("电动车保存参数.token.token"),\n        "Host": "lism.lixcx.com:32026",\n        "Connection": "Keep-Alive",\n        "Accept-Encoding": "gzip",\n        "User-Agent": "okhttp/3.12.0"\n    }\n};\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 970,
        "y": 740,
        "wires": [
            [
                "570ca6888b29ed18"
            ]
        ]
    },
    {
        "id": "570ca6888b29ed18",
        "type": "http request",
        "z": "d5fc7a0af200ba50",
        "name": "",
        "method": "use",
        "ret": "obj",
        "paytoqs": "ignore",
        "url": "",
        "tls": "",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "",
        "senderr": false,
        "headers": [],
        "x": 1160,
        "y": 740,
        "wires": [
            [
                "889389db9b0c4b12"
            ]
        ]
    },
    {
        "id": "889389db9b0c4b12",
        "type": "change",
        "z": "d5fc7a0af200ba50",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "电动车保存参数3",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1400,
        "y": 740,
        "wires": [
            []
        ]
    },
    {
        "id": "881871cf4252b4c9",
        "type": "function",
        "z": "d5fc7a0af200ba50",
        "name": "获取GPS定位信息",
        "func": "// 构建请求的配置对象\nmsg = {\n    // URL(含路径)\n    url: `https://lism.lixcx.com:32026/smartBike/consumer/deviceIndex/getLocationInfo?templateCode=${flow.get("电动车保存参数.bike.bike[0].templateCode")}&boxCode=${flow.get("电动车保存参数.bike.bike[0].boxCode")}`,\n    // 请求方法:GET\n    method: "GET",\n    // URL 参数(会自动拼接到 URL 后)\n  \n    // 请求头信息\n    headers: {\n        "Content-Type": "application/json;charset=UTF-8",\n        "source": "app-smartbike",\n        "Authorization": flow.get("电动车保存参数.token.token"),\n        "Host": "lism.lixcx.com:32026",\n        "Connection": "Keep-Alive",\n        "Accept-Encoding": "gzip",\n        "User-Agent": "okhttp/3.12.0"\n    }\n};\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 970,
        "y": 840,
        "wires": [
            [
                "33c81c1286ed1b2b"
            ]
        ]
    },
    {
        "id": "33c81c1286ed1b2b",
        "type": "http request",
        "z": "d5fc7a0af200ba50",
        "name": "",
        "method": "use",
        "ret": "obj",
        "paytoqs": "ignore",
        "url": "",
        "tls": "",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "",
        "senderr": false,
        "headers": [],
        "x": 1180,
        "y": 840,
        "wires": [
            [
                "42fda26999f467dd"
            ]
        ]
    },
    {
        "id": "42fda26999f467dd",
        "type": "change",
        "z": "d5fc7a0af200ba50",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "电动车保存参数4",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1400,
        "y": 840,
        "wires": [
            [
                "9561c7ac40cfed7c"
            ]
        ]
    },
    {
        "id": "f028c385e8f0d8be",
        "type": "function",
        "z": "d5fc7a0af200ba50",
        "name": "获取报警信息",
        "func": "// 构建请求的配置对象\nmsg = {\n    // URL(含路径)\n    url: `https://lism.lixcx.com:32026/smartBike/consumer/faultAlarm/myFaultAlarmList?bikeBaseId=${flow.get("电动车保存参数.bike.bike[0].deviceId")}&pageNo=0&pageSize=10`,\n    // 请求方法:GET\n    method: "GET",\n    // URL 参数(会自动拼接到 URL 后)\n    \n    // 请求头信息\n    headers: {\n        "Content-Type": "application/json;charset=UTF-8",\n        "source": "app-smartbike",\n        "Authorization": flow.get("电动车保存参数.token.token"),\n        "Host": "lism.lixcx.com:32026",\n        "Connection": "Keep-Alive",\n        "Accept-Encoding": "gzip",\n        "User-Agent": "okhttp/3.12.0"\n    }\n};\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 940,
        "y": 920,
        "wires": [
            [
                "6faf44d8cbe575a0"
            ]
        ]
    },
    {
        "id": "a5a052c0195028fa",
        "type": "inject",
        "z": "d5fc7a0af200ba50",
        "name": "2",
        "props": [],
        "repeat": "15",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "x": 490,
        "y": 600,
        "wires": [
            [
                "e86fcf8397750828"
            ]
        ]
    },
    {
        "id": "6faf44d8cbe575a0",
        "type": "http request",
        "z": "d5fc7a0af200ba50",
        "name": "",
        "method": "use",
        "ret": "obj",
        "paytoqs": "ignore",
        "url": "",
        "tls": "",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "",
        "senderr": false,
        "headers": [],
        "x": 1160,
        "y": 920,
        "wires": [
            [
                "134f5a0c0cdcbd4a"
            ]
        ]
    },
    {
        "id": "134f5a0c0cdcbd4a",
        "type": "change",
        "z": "d5fc7a0af200ba50",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "电动车保存参数5",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1380,
        "y": 920,
        "wires": [
            [
                "2f4f02adea61f7ab",
                "7dc4f317d7b9f566"
            ]
        ]
    },
    {
        "id": "3851aaaf14fa5432",
        "type": "ha-button",
        "z": "d5fc7a0af200ba50",
        "name": "",
        "version": 0,
        "debugenabled": false,
        "outputs": 1,
        "entityConfig": "6db902a159e407bd",
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "topic",
                "propertyType": "msg",
                "value": "",
                "valueType": "triggerId"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "x": 770,
        "y": 480,
        "wires": [
            [
                "2bf723aa70ed1af8",
                "36c8aab541e68baa"
            ]
        ]
    },
    {
        "id": "36c8aab541e68baa",
        "type": "delay",
        "z": "d5fc7a0af200ba50",
        "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": 800,
        "y": 540,
        "wires": [
            [
                "910e49601765fe85",
                "e6109909f8faf3e7"
            ]
        ]
    },
    {
        "id": "e6109909f8faf3e7",
        "type": "delay",
        "z": "d5fc7a0af200ba50",
        "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": 920,
        "y": 620,
        "wires": [
            [
                "415fcf7f3c0e0489",
                "7c78b8d9e55ed699"
            ]
        ]
    },
    {
        "id": "7c78b8d9e55ed699",
        "type": "delay",
        "z": "d5fc7a0af200ba50",
        "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": 920,
        "y": 700,
        "wires": [
            [
                "949b104e6ff9be59",
                "bbb71e049d0b76e8"
            ]
        ]
    },
    {
        "id": "bbb71e049d0b76e8",
        "type": "delay",
        "z": "d5fc7a0af200ba50",
        "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": 920,
        "y": 780,
        "wires": [
            [
                "881871cf4252b4c9",
                "6fe65fd399fccae9"
            ]
        ]
    },
    {
        "id": "6fe65fd399fccae9",
        "type": "delay",
        "z": "d5fc7a0af200ba50",
        "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": 920,
        "y": 880,
        "wires": [
            [
                "f028c385e8f0d8be"
            ]
        ]
    },
    {
        "id": "9561c7ac40cfed7c",
        "type": "function",
        "z": "d5fc7a0af200ba50",
        "name": "GPS设备数据处理",
        "func": "//if(!flow.get("电动车保存参数4.obj.reportTime")){\nconst headers = {\n    "Content-Type": "application/x-www-form-urlencoded"\n};\nlet aa = flow.get("电动车保存参数4");\nlet bb =aa.obj.location.split(/,/)\n// 构造请求体(JSON 格式)\nconst payload = {\n    "latitude":bb[1]-0.00063,\n    "longitude":bb[0]-0.00363 ,\n    "device": flow.get("电动车保存参数.2.typeName") ,\n    "accuracy": aa.obj.precision ,\n    "battery": flow.get("电动车保存参数.2.batterySoc[0]"),\n    "speed":flow.get("电动车保存参数.2.reportTime"),\n    "altitude":flow.get("电动车保存参数.2.voltage")\n};\n\n// 设置消息对象(供 http request 节点使用)\nmsg.url = "在此填入GPSLoggerapi";\nmsg.method = "POST";\nmsg.headers = headers;\nmsg.payload = payload;\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1650,
        "y": 840,
        "wires": [
            [
                "b470cd6dfc67533d"
            ]
        ]
    },
    {
        "id": "b470cd6dfc67533d",
        "type": "http request",
        "z": "d5fc7a0af200ba50",
        "name": "",
        "method": "use",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "",
        "tls": "",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "",
        "senderr": false,
        "headers": [],
        "x": 1840,
        "y": 840,
        "wires": [
            []
        ]
    },
    {
        "id": "7dc4f317d7b9f566",
        "type": "function",
        "z": "d5fc7a0af200ba50",
        "name": "function 89",
        "func": "if (flow.get("电动车保存参数3.obj.data").length !== 0){\n    // 1. 从上下文获取上一次的输入值(初始值设为false/0)\n    let prevValue = flow.get("prevValue") || false; \n    // 2. 获取当前输入值(根据实际输入调整,如msg.payload)\n    let currentValue = flow.get("电动车保存参数.2.accState"); \n    \n    // 3. 对比判断:上升沿(前低后高)\n    if (!prevValue && currentValue) {\n        flow.set("骑行状态", "行驶中"); // 可自定义输出内容(如true、1等)\n         // 触发时输出消息\n      }\n      \n    // 4. 对比判断:下降沿(前高后低)\n      if (prevValue && !currentValue) {\n        var xjy = 1\n        flow.set("骑行状态", "行驶结束");\n                // return msg;\n      }\n                  \n // 5. 更新上下文,存储当前值为下一次的“前值”\nflow.set("prevValue", currentValue);\n// 非沿变化时不输出消息(如需默认输出可取消注释下方)\n// return null;\n                  \nlet ss =flow.get("电动车保存参数.2.travelTime");\nlet gg = 0\nss = (ss / 1000 / 60).toFixed(3)\nflow.set("电动车保存参数.qxtime", ss ||0); //时间\n  let kk = Number((flow.get("电动车保存参数3.obj.data[0].amapDistance") / 1000).toFixed(3))  //公里数\nss = ss/60\nflow.set("电动车保存参数.gls", kk ||0);\ngg= (flow.get("电动车保存参数.gls") /ss).toFixed(3) //评价时速\nflow.set("电动车保存参数.pjsd", gg);\nlet totalMileage =Number(flow.get("mileage.totalMileage")||0)\n\nlet mileage = Number(flow.get("电动车保存参数.gls"))\nif (xjy==1){\n    flow.set("mileage.mileage", Number(kk));           \n    totalMileage= totalMileage+mileage\n    flow.set("mileage.bcxhgls", flow.get("mileage.bcxhgls")+mileage);\n    flow.set("mileage.totalMileage", totalMileage.toFixed(3));\n}\nif (Number(flow.get("电动车保存参数.2.batterySoc[0]")) === 100 &&flow.get("mileage.bcxhgls")!==0){  \n     flow.set("mileage.bcxhgls", 0);\n}\n}",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "// 部署节点后,此处添加的代码将运行一次。 \n flow.set("mileage.mileage", flow.get("电动车保存参数.gls"));",
        "finalize": "",
        "libs": [],
        "x": 1690,
        "y": 940,
        "wires": [
            []
        ]
    },
    {
        "id": "2f4f02adea61f7ab",
        "type": "link out",
        "z": "d5fc7a0af200ba50",
        "name": "link out 7",
        "mode": "link",
        "links": [
            "49b5810fce89cedf",
            "017f55b4cf2f4a7a"
        ],
        "x": 1585,
        "y": 920,
        "wires": []
    },
    {
        "id": "3107c38d83ce69eb",
        "type": "inject",
        "z": "d5fc7a0af200ba50",
        "name": "1",
        "props": [],
        "repeat": "60",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "x": 490,
        "y": 540,
        "wires": [
            [
                "fe6589719c0512ce"
            ]
        ]
    },
    {
        "id": "fe6589719c0512ce",
        "type": "switch",
        "z": "d5fc7a0af200ba50",
        "name": "",
        "property": "电动车保存参数.2.accState",
        "propertyType": "flow",
        "rules": [
            {
                "t": "cont",
                "v": "false",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 650,
        "y": 540,
        "wires": [
            [
                "36c8aab541e68baa"
            ]
        ]
    },
    {
        "id": "e86fcf8397750828",
        "type": "switch",
        "z": "d5fc7a0af200ba50",
        "name": "",
        "property": "电动车保存参数.2.accState",
        "propertyType": "flow",
        "rules": [
            {
                "t": "cont",
                "v": "true",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 670,
        "y": 600,
        "wires": [
            [
                "36c8aab541e68baa"
            ]
        ]
    },
    {
        "id": "6db902a159e407bd",
        "type": "ha-entity-config",
        "server": "ba8d295cd9043319",
        "deviceConfig": "d0d327350361c36c",
        "name": "登录",
        "version": "6",
        "entityType": "button",
        "haConfig": [
            {
                "property": "name",
                "value": "登录"
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "entity_picture",
                "value": ""
            },
            {
                "property": "entity_category",
                "value": ""
            },
            {
                "property": "device_class",
                "value": ""
            }
        ],
        "resend": false,
        "debugEnabled": false
    },
    {
        "id": "ba8d295cd9043319",
        "type": "server",
        "name": "Home Assistant",
        "version": 5,
        "addon": false,
        "rejectUnauthorizedCerts": false,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true,
        "cacheJson": true,
        "heartbeat": true,
        "heartbeatInterval": "30",
        "areaSelector": "friendlyName",
        "deviceSelector": "friendlyName",
        "entitySelector": "friendlyName",
        "statusSeparator": ": ",
        "statusYear": "numeric",
        "statusMonth": "numeric",
        "statusDay": "numeric",
        "statusHourCycle": "h23",
        "statusTimeFormat": "h:m",
        "enableGlobalContextStore": false
    },
    {
        "id": "d0d327350361c36c",
        "type": "ha-device-config",
        "name": "电动车",
        "hwVersion": "",
        "manufacturer": "新日",
        "model": "",
        "swVersion": ""
    }
]


            
由于还不完善nodered的流就不放了有需要的可以自行编写(期待有大佬直接做成插件)

捕获.PNG

1

1

2

2
回复

使用道具 举报

3

主题

24

回帖

505

积分

高级会员

积分
505
金钱
478
HASS币
0
 楼主| 发表于 2025-9-5 12:45:15 | 显示全部楼层
放两张半成品图片
ha中实体.PNG
GPS实体.PNG

评分

参与人数 2金钱 +28 收起 理由
隔壁的王叔叔 + 12 高手,这是高手!
hhh. + 16 高手,这是高手!

查看全部评分

回复

使用道具 举报

27

主题

312

回帖

2407

积分

金牌会员

积分
2407
金钱
2068
HASS币
0
发表于 2025-9-5 17:53:32 | 显示全部楼层
为什么9号的没人接入
回复

使用道具 举报

3

主题

24

回帖

505

积分

高级会员

积分
505
金钱
478
HASS币
0
 楼主| 发表于 2025-9-5 19:14:54 | 显示全部楼层
kaka0992 发表于 2025-9-5 17:53
为什么9号的没人接入

因为我没九号😂原本打算买九号的结果预算不足
回复

使用道具 举报

27

主题

312

回帖

2407

积分

金牌会员

积分
2407
金钱
2068
HASS币
0
发表于 2025-9-5 21:10:15 | 显示全部楼层
1124620045 发表于 2025-9-5 19:14
因为我没九号😂原本打算买九号的结果预算不足

我把账号分享给你吧
回复

使用道具 举报

3

主题

24

回帖

505

积分

高级会员

积分
505
金钱
478
HASS币
0
 楼主| 发表于 2025-9-5 22:00:31 | 显示全部楼层
1124620045 发表于 2025-9-5 19:14
因为我没九号😂原本打算买九号的结果预算不足

试了一下用手机直接抓包还抓不了
回复

使用道具 举报

Ari 手机认证

0

主题

689

回帖

2979

积分

金牌会员

积分
2979
金钱
2290
HASS币
0
发表于 2025-9-8 10:05:42 | 显示全部楼层
1124620045 发表于 2025-9-5 22:00
试了一下用手机直接抓包还抓不了

试了九号吗?我也想接入九号的
回复

使用道具 举报

3

主题

24

回帖

505

积分

高级会员

积分
505
金钱
478
HASS币
0
 楼主| 发表于 2025-9-9 18:41:47 | 显示全部楼层
Ari 发表于 2025-9-8 10:05
试了九号吗?我也想接入九号的

用电脑抓包应该可以,九号APP做了防hook和ssl证书验证
回复

使用道具 举报

20

主题

76

回帖

875

积分

论坛分享达人

积分
875
金钱
779
HASS币
10
发表于 7 天前 | 显示全部楼层
雅迪可否行啊?手机连电动车蓝牙解锁的
回复

使用道具 举报

3

主题

24

回帖

505

积分

高级会员

积分
505
金钱
478
HASS币
0
 楼主| 发表于 6 天前 | 显示全部楼层
wz199021 发表于 2025-9-10 16:31
雅迪可否行啊?手机连电动车蓝牙解锁的

理论上是可以的抓包试试
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-9-17 03:12 , Processed in 0.961359 second(s), 14 queries , MemCached On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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