Problems with node-red-contrib-google

i don´t no what should i insert in JSON and scope:

It would be helpful if you provided the full name (node-red-contrib-?????) of the node you are using. That way others don't have to spend time seazrching for the node.

Also it's elpful to supply

  1. what platform you are runnig NR on
  2. OS you are using
  3. version of NR and node.js (can be found on NR startup log)
  4. dashboard version (if the dashboard is involved)
  5. a description of what you are trying to do

node-red-contrib-google

And the other information I requested?

sorry could only upload 2 pictures

You didn't need to load a image, you could have looked at it and answered the questions.

so

  1. what platform you are runnig NR on
    ?? don't know from the image
  2. OS you are using
    some version or other of windows
  3. version of NR and node.js (can be found on NR startup log)
    node-red v1.0.3
    node.js v12.16.1
  4. dashboard version (if the dashboard is involved)
    dashboard v2.19.4
  5. a description of what you are trying to do
    hmmm.......nope, can figure that out from an image

I think the os version doesn't matter, but you can see it in the last picture (Windows_NT 10.0.18362 x64 LE). I would like to read the events from a Google calendar.

Flow:

[
    {
        "id": "895d2f6.6d24e5",
        "type": "tab",
        "label": "Flow 6",
        "disabled": false,
        "info": ""
    },
    {
        "id": "2842d683.53728a",
        "type": "google",
        "z": "895d2f6.6d24e5",
        "name": "Müllkalender",
        "google": "3b40a2c0.c0d46e",
        "api": "calendar:v3",
        "operation": "events.list",
        "x": 750,
        "y": 160,
        "wires": [
            [
                "39811ee3.ab4cfa"
            ]
        ]
    },
    {
        "id": "675a8d24.7a937c",
        "type": "template",
        "z": "895d2f6.6d24e5",
        "name": "Next Abfall Event",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "{\n    \"calendarId\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxx@group.calendar.google.com\",\n    \"maxResults\": \"1\",\n    \"orderBy\": \"startTime\",\n    \"singleEvents\": \"true\",\n    \"timeMin\": \"{{payload}}\"\n}",
        "output": "json",
        "x": 570,
        "y": 200,
        "wires": [
            [
                "2842d683.53728a"
            ]
        ]
    },
    {
        "id": "fc03e8a3.0cfc6",
        "type": "inject",
        "z": "895d2f6.6d24e5",
        "name": "",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "repeat": "",
        "crontab": "*/20 17 * * *",
        "once": true,
        "onceDelay": 0.1,
        "x": 170,
        "y": 200,
        "wires": [
            [
                "49f93b6.736cb44"
            ]
        ]
    },
    {
        "id": "49f93b6.736cb44",
        "type": "moment",
        "z": "895d2f6.6d24e5",
        "name": "",
        "topic": "",
        "input": "",
        "inputType": "msg",
        "inTz": "Europe/Berlin",
        "adjAmount": 0,
        "adjType": "days",
        "adjDir": "add",
        "format": "",
        "locale": "C",
        "output": "",
        "outputType": "msg",
        "outTz": "Europe/Berlin",
        "x": 360,
        "y": 200,
        "wires": [
            [
                "675a8d24.7a937c"
            ]
        ]
    },
    {
        "id": "9ad6abbf.f3d1",
        "type": "function",
        "z": "895d2f6.6d24e5",
        "name": "Set Tonne",
        "func": "if (msg.payload == \"true\") {\n    if (msg.tonne == \"Biotonne\") {\n        msg.payload = \"Bio Tonne\";\n        msg.bmp = '74';\n        node.status({ fill: \"green\", shape: \"ring\", text:  msg.payload + \" stored\" });\n    }\n    else if (msg.tonne == \"Gelber Sack\") {\n        msg.payload = \"Gelber Sack\";\n        msg.bmp = '75';    \n        node.status({ fill: \"yellow\", shape: \"ring\", text:  msg.payload + \" stored\" });\n    }\n    else if (msg.tonne == \"Altpapier\") {\n        msg.payload = \"Altpapier\";\n        msg.bmp = '76';\n        node.status({ fill: \"blue\", shape: \"ring\", text:  msg.payload + \" stored\" });\n    }\n    else if (msg.tonne == \"Restmüll\") {\n        msg.payload = \"Restmüll\";\n        msg.bmp = '77';    \n        node.status({ fill: \"grey\", shape: \"ring\", text:  msg.payload + \" stored\" });\n    }\n    return msg;\n} else {\n    msg.show = false;\n    node.status({ fill: \"red\", shape: \"ring\", text:  \"Keine Tonne\" + \" stored\" });\n    return msg;\n}\n",
        "outputs": 1,
        "noerr": 0,
        "x": 420,
        "y": 260,
        "wires": [
            [
                "f3dc6b87.a54c3"
            ]
        ]
    },
    {
        "id": "6fceeed7.a808e",
        "type": "Screen Init",
        "z": "895d2f6.6d24e5",
        "name": "Screen Init",
        "inscreenName": "muellkalender",
        "induration": "10",
        "x": 770,
        "y": 260,
        "wires": [
            [
                "379fdb48.d747dc"
            ]
        ]
    },
    {
        "id": "f3dc6b87.a54c3",
        "type": "Switch Animation",
        "z": "895d2f6.6d24e5",
        "name": "Switch Animation",
        "aktiv": "true",
        "animation": "fade",
        "x": 590,
        "y": 260,
        "wires": [
            [
                "6fceeed7.a808e"
            ]
        ]
    },
    {
        "id": "edbf5221.49d28",
        "type": "Text",
        "z": "895d2f6.6d24e5",
        "name": "Text",
        "intextString": "{{payload}}",
        "inbigFont": "false",
        "inscrollText": "auto",
        "inscrollTextDelay": "0",
        "incenterText": "false",
        "inposX": "7",
        "inposY": "1",
        "incolorR": "255",
        "incolorG": "255",
        "incolorB": "255",
        "x": 1050,
        "y": 260,
        "wires": [
            [
                "fb9a73bc.f0fce8"
            ]
        ]
    },
    {
        "id": "379fdb48.d747dc",
        "type": "Bitmap Animation",
        "z": "895d2f6.6d24e5",
        "name": "Bitmap",
        "indata": "{{bmp}}",
        "inanimationDelay": "80",
        "inrubberbanding": "false",
        "inlimitLoops": "1",
        "x": 920,
        "y": 260,
        "wires": [
            [
                "edbf5221.49d28"
            ]
        ]
    },
    {
        "id": "39811ee3.ab4cfa",
        "type": "function",
        "z": "895d2f6.6d24e5",
        "name": "parse event",
        "func": "//Aktuelle Datum im ISO Format für heute und morgen\nvar today       = new Date(); \nvar tomorrow    = new Date();  \n\n//Datum von Morgen im ISO Format\ntomorrow.setDate(today.getDate()+1); \n\nvar parts = msg.payload.items[0].summary.split(\" am \");\nvar date = parts[1].split(\".\");\nvar datum = new Date(date[2], date[1]-1, date[0]);\n//var tonne = parts[0];\n\nif (datum.getTime() >= today.getTime() & \n    datum.getTime() <= tomorrow.getTime()) {\n    msg.payload = \"true\";\n  }\nelse\n{\n    msg.payload = \"false\";\n  }\n\nmsg.tonne = parts[0]; \n\nnode.send(msg);",
        "outputs": 1,
        "noerr": 0,
        "x": 910,
        "y": 200,
        "wires": [
            [
                "9ad6abbf.f3d1"
            ]
        ]
    },
    {
        "id": "c6786322.82016",
        "type": "comment",
        "z": "895d2f6.6d24e5",
        "name": "AbfallKalender [muellkalender]",
        "info": "",
        "x": 190,
        "y": 160,
        "wires": []
    },
    {
        "id": "fb9a73bc.f0fce8",
        "type": "link out",
        "z": "895d2f6.6d24e5",
        "name": "",
        "links": [
            "647804e.74ecdfc"
        ],
        "x": 1135,
        "y": 260,
        "wires": []
    },
    {
        "id": "3b40a2c0.c0d46e",
        "type": "google-conn",
        "z": "",
        "name": "Google",
        "key": "",
        "scopes": ""
    }
]

Please ensure that whenever you post any code, you do so in the format that the forum expects, otherwise other forum users will no be able to assist you.

See this post;

Instead of reposting your code again below, use the pencil icon in your post above and edit it as per the sharing guide.

ok, i understand.

1 Like

Well looking at that node, I see

  1. it states it is a work in progress
  2. it hasn't got much (any) documentation,
  3. it hasn't been updated in over two years
  4. there are 8 open issues dating back to April of 2018 and none seem to have any response from the author

I'd be looking for another solution.

thanks for your effort, I have now found another solution, I import my local calendar from Thunderbird and put it on my Raspberry. From there I query the events with ical/upcoming.

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