# Node-red error message

**URL:** <https://discourse.nodered.org/t/node-red-error-message/60467>\
**Category:** General\
**Tags:** home-assistant\
**Created:** [28 March 2022 18:11 UTC](https://discourse.nodered.org/t/node-red-error-message/60467 "2022-03-28T18:11:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bercolly](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@Bercolly](https://discourse.nodered.org/u/Bercolly)\
**Post date:** [28 March 2022 18:11 UTC](https://discourse.nodered.org/t/node-red-error-message/60467/1 "2022-03-28T18:11:41Z")

</div>

Hi,

I am trying to return to homeassistant a date,  
here is the nodered flow :

````auto
[
    {
        "id": "625950af552cf8f3",
        "type": "tab",
        "label": "Flow 3",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "91ada0aaf9b139d5",
        "type": "api-call-service",
        "z": "625950af552cf8f3",
        "name": "",
        "server": "11a90641.be375a",
        "version": 5,
        "debugenabled": false,
        "domain": "input_datetime",
        "service": "set_datetime",
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "input_datetime.sba_echeance_date"
        ],
        "data": "{ \"date\" : \"{{ Date.parse(msg.sba_echeance)}}\"}",
        "dataType": "json",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 340,
        "y": 200,
        "wires": [
            []
        ]
    },
    {
        "id": "0ff847984b24abda",
        "type": "inject",
        "z": "625950af552cf8f3",
        "name": "le 2022-05-19",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "sba_echeance",
                "v": "2022-05-25",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 110,
        "y": 120,
        "wires": [
            [
                "91ada0aaf9b139d5",
                "46e23037060b2e5f"
            ]
        ]
    },
    {
        "id": "4398e38709e3b3fa",
        "type": "comment",
        "z": "625950af552cf8f3",
        "name": "envoi date",
        "info": "",
        "x": 80,
        "y": 80,
        "wires": []
    },
    {
        "id": "46e23037060b2e5f",
        "type": "debug",
        "z": "625950af552cf8f3",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 290,
        "y": 160,
        "wires": []
    },
    {
        "id": "11a90641.be375a",
        "type": "server",
        "name": "Home Assistant",
        "version": 2,
        "addon": true,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": false,
        "cacheJson": false,
        "heartbeat": false,
        "heartbeatInterval": 30
    }
]```

**Here is the response :**

````

28/03/2022, 20:04:50[node: 46e23037060b2e5f](http://homeassistant:8123/api/hassio_ingress/5cfC6wrjf4bmTuPrwzIFRzOHnGhybvYJ5ogTJ7MrUz4/#)msg : Object

object

\_msgid: "1fda3381d1c8021f"

payload: 1648490690536

sba\_echeance: "2022-05-25"

28/03/2022, 20:04:50[node: 91ada0aaf9b139d5](http://homeassistant:8123/api/hassio_ingress/5cfC6wrjf4bmTuPrwzIFRzOHnGhybvYJ5ogTJ7MrUz4/#)msg : string[76]

"Call-service error. Could not parse date for dictionary value @ data['date']"

```auto

Regards,
Bernard
```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 March 2022 20:32 UTC](https://discourse.nodered.org/t/node-red-error-message/60467/2 "2022-03-28T20:32:54Z")

</div>

This looks like a question that needs Home Assistant knowledge. Few, if any, here use HA, so you might be better asking in an HA forum.

---

<div class="post-metadata">

**Author:** ![Bercolly](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@Bercolly](https://discourse.nodered.org/u/Bercolly)\
**Post date:** [28 March 2022 21:25 UTC](https://discourse.nodered.org/t/node-red-error-message/60467/3 "2022-03-28T21:25:44Z")

</div>

I will get a try on HA forum.  
Thanks.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [28 March 2022 21:40 UTC](https://discourse.nodered.org/t/node-red-error-message/60467/4 "2022-03-28T21:40:37Z")

</div>

The date input just requires the string no need to use Date.parse().  
so

```auto
{ "date" : "{{msg.sba_echeance}}"}

```

should be all you need.

> **[Input Datetime](https://www.home-assistant.io/integrations/input_datetime/#input_datetimeset_datetime)**
>
> Instructions on how to integrate the Input Datetime integration into Home Assistant.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [27 May 2022 21:40 UTC](https://discourse.nodered.org/t/node-red-error-message/60467/5 "2022-05-27T21:40:53Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
