Value from JSON extract

Hello,

sorry for the question, this topic were similar as exist topics in forum, but they didn´t fit for me.

I have different Cron objects with ever 2 values and I need the extract object A as number. Example A with value (number) 20 in october.

Can somebody help me please.
Thanks

[
    {
        "id": "1a08b1a47399bbfe",
        "type": "cronplus",
        "z": "203feb89db46103a",
        "name": "Oct",
        "outputField": "payload",
        "timeZone": "",
        "persistDynamic": false,
        "commandResponseMsgOutput": "output1",
        "outputs": 1,
        "options": [
            {
                "name": "schedule1",
                "topic": "Value",
                "payloadType": "json",
                "payload": "{\"A\":20,\"B\":25}",
                "expressionType": "cron",
                "expression": "0 * * * OCT *",
                "location": "",
                "offset": "0",
                "solarType": "all",
                "solarEvents": "sunrise,sunset"
            }
        ],
        "x": 970,
        "y": 1240,
        "wires": [
            [
                "f0e9c52bb2bfc324"
            ]
        ]
    },
    {
        "id": "f0e9c52bb2bfc324",
        "type": "change",
        "z": "203feb89db46103a",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "limits",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1210,
        "y": 1200,
        "wires": [
            [
                "35264a76071e9c1f"
            ]
        ]
    },
    {
        "id": "35264a76071e9c1f",
        "type": "change",
        "z": "203feb89db46103a",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload.A",
                "pt": "msg",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1410,
        "y": 1200,
        "wires": [
            [
                "061259f520e53288"
            ]
        ]
    },
    {
        "id": "061259f520e53288",
        "type": "debug",
        "z": "203feb89db46103a",
        "name": "OUTPUT only value A in form of number",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1700,
        "y": 1200,
        "wires": []
    },
    {
        "id": "62e8ef35aa2f2783",
        "type": "cronplus",
        "z": "203feb89db46103a",
        "name": "Aug",
        "outputField": "payload",
        "timeZone": "",
        "persistDynamic": false,
        "commandResponseMsgOutput": "output1",
        "outputs": 1,
        "options": [
            {
                "name": "schedule1",
                "topic": "Value",
                "payloadType": "json",
                "payload": "{\"A\":8,\"B\":12}",
                "expressionType": "cron",
                "expression": "0 * * * AUG *",
                "location": "",
                "offset": "0",
                "solarType": "all",
                "solarEvents": "sunrise,sunset"
            }
        ],
        "x": 970,
        "y": 1180,
        "wires": [
            [
                "f0e9c52bb2bfc324"
            ]
        ]
    }
]

Hi @Herbert

Sorry - I can't quite decipher what you need.
I don't use the cronplus, but I can see from the export it outputs a payload of (example)

{
  'A' :20,
  'B' :25
}

If you wanted that to become the below for the next Node...

{
  payload: 20
}

You need to switch around your change Node (you have it the other way)

Screenshot 2023-10-19 at 20.04.18

Apologies if I have this wrong

You were right.Thanks for your quick feedback.

:hugs:

I reed from the other topics it right, but I confised to write the correct text (payload.A) in right line.
I didn´t find my mistake.

Again THANKS and have a NICE day :wink:

1 Like

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