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

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

[技术探讨] nodered中git history节点传参报错

[复制链接]

6

主题

70

帖子

883

积分

高级会员

Rank: 4

积分
883
金钱
813
HASS币
10
发表于 2025-2-17 11:43:50 | 显示全部楼层 |阅读模式


是想通过上一个funcation函数传输日期参数获取历史值,手动填写日期格式 2025-02-14T23:59:00+00:00  
不报错,通过函数获取传递给get history节点就报错了,来为大佬帮忙看下呢

微信图片_20250217114333.png
回复

使用道具 举报

50

主题

1949

帖子

7633

积分

论坛元老

Rank: 8Rank: 8

积分
7633
金钱
5674
HASS币
40
发表于 2025-2-17 13:06:52 | 显示全部楼层
git history,节点看看传递的参数默认是不是需要留空
折腾精神永存,感恩感谢论坛每一位愿意分享和帮助过我的大佬,论坛有你更精彩
回复

使用道具 举报

6

主题

70

帖子

883

积分

高级会员

Rank: 4

积分
883
金钱
813
HASS币
10
 楼主| 发表于 2025-2-17 14:08:11 | 显示全部楼层
导出json如下  麻烦大家帮忙看下
[
    {
        "id": "2f872d0f32d6c25d",
        "type": "api-get-history",
        "z": "d9447677b2be8105",
        "name": "获取历史状态",
        "server": "2c1f138838630b28",
        "version": 0,
        "startdate": "msg.payload.start",
        "enddate": "msg.payload.end",
        "entityid": "sensor.today_all_dianjia",
        "entityidtype": "is",
        "useRelativeTime": false,
        "relativeTime": "2 hour",
        "flatten": false,
        "output_type": "array",
        "output_location_type": "msg",
        "output_location": "payload",
        "x": 680,
        "y": 960,
        "wires": [
            [
                "36d7e1d806c565ab"
            ]
        ]
    },
    {
        "id": "36d7e1d806c565ab",
        "type": "debug",
        "z": "d9447677b2be8105",
        "name": "debug 427",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1110,
        "y": 960,
        "wires": []
    },
    {
        "id": "ca5b914ab6776a45",
        "type": "function",
        "z": "d9447677b2be8105",
        "name": "function 9",
        "func": "\nmsg.payload = {\n    "start": "2025-02-14T23:45:00+00:00",\n    "end": "2025-02-14T23:59:00+00:00"\n}\n\n// 返回消息\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 360,
        "y": 960,
        "wires": [
            [
                "2f872d0f32d6c25d",
                "a1c6f499ae7160ca"
            ]
        ]
    },
    {
        "id": "afe261d310b9cf49",
        "type": "inject",
        "z": "d9447677b2be8105",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 130,
        "y": 960,
        "wires": [
            [
                "ca5b914ab6776a45"
            ]
        ]
    },
    {
        "id": "a1c6f499ae7160ca",
        "type": "debug",
        "z": "d9447677b2be8105",
        "name": "debug 429",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 690,
        "y": 1100,
        "wires": []
    },
    {
        "id": "2c1f138838630b28",
        "type": "server",
        "name": "Home Assistant",
        "version": 5,
        "addon": false,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true,
        "cacheJson": true,
        "heartbeat": true,
        "heartbeatInterval": "30",
        "areaSelector": "id",
        "deviceSelector": "id",
        "entitySelector": "id",
        "statusSeparator": ": ",
        "statusYear": "hidden",
        "statusMonth": "short",
        "statusDay": "numeric",
        "statusHourCycle": "default",
        "statusTimeFormat": "h:m",
        "enableGlobalContextStore": false
    }
]
回复

使用道具 举报

6

主题

70

帖子

883

积分

高级会员

Rank: 4

积分
883
金钱
813
HASS币
10
 楼主| 发表于 2025-2-17 14:09:27 | 显示全部楼层
jjcs 发表于 2025-2-17 13:06
git history,节点看看传递的参数默认是不是需要留空

默认没有留空
回复

使用道具 举报

50

主题

1949

帖子

7633

积分

论坛元老

Rank: 8Rank: 8

积分
7633
金钱
5674
HASS币
40
发表于 2025-2-17 14:35:12 | 显示全部楼层

你先得明确history节点,支不支持外部传递msg参数,还是只能写死
折腾精神永存,感恩感谢论坛每一位愿意分享和帮助过我的大佬,论坛有你更精彩
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2025-3-5 02:03 , Processed in 0.058103 second(s), 29 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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