Cron json as variables

Hello I´m using some cron with fix values.
I want to refer to two Dashboard object for both variables toGrid and toSolar to adjust these values easier.

How is that possible?

Cron field:

{"toGrid":20.3,"toSolar":22.0}

[
    {
        "id": "0336f4fd93f378eb",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "421982f94b43cd4a",
        "type": "cronplus",
        "z": "0336f4fd93f378eb",
        "name": "Jede Minute Feb 1. bis 20.",
        "outputField": "payload",
        "timeZone": "",
        "storeName": "",
        "commandResponseMsgOutput": "output1",
        "defaultLocation": "",
        "defaultLocationType": "default",
        "outputs": 1,
        "options": [
            {
                "name": "schedule1",
                "topic": "Minute",
                "payloadType": "json",
                "payload": "{\"toGrid\":20.3,\"toSolar\":22.0}",
                "expressionType": "cron",
                "expression": "0 * * 1-20 FEB *",
                "location": "",
                "offset": "0",
                "solarType": "all",
                "solarEvents": "sunrise,sunset"
            }
        ],
        "x": 460,
        "y": 180,
        "wires": [
            []
        ]
    }
]

No answer here? Is my wish not possible? Maybe there are better solutions as my?

cronplus is 100% dynamic. Your dashboard would need to "create dynamic schedules".

Alternatively, you could use a change node to update the values to those created by your dashboard.

e.g. cron-plus --> change (update msg.payload.toGrid, update msg.payload.toSolar) --> next node

Alternatively, you could use a JSONata payload and dynamically create the payload using $flowContext for example!

Thanks for your feedback. In the meantime I thought it would be better to have a number from an MQTT device. But how I can integrate any number in the cron?

store the number in context

retrieve the number from context - use a change node or the other methods mentioned in last post.

OK thanks I will try that - I´m not an expert, but I do my best :wink:

Have Cron-plus inject a simple message at your sheduled times.
Use a change node, or other means, to insert the current values for msg.payload.toGrid and msg.payload.toSolar.

1 Like