Day view of calendar doesn't display any tasks

@Farmer-Ed I’m gonna start calling you “Wizard” Farmer-Ed. Ok, I got a message that says access was granted:
image

1 Like

Cool at least that is progress. I got to run for now but can answer any other questions tomorrow.

Were you able to authenticate with the Google API too?

Thanks for all the help. No, not yet. I’m still trying to figure out where to find the nodes. I just did a search on the palette, and I think I found the Oauth2 for google.

I had some issues with some of them nodes on the palette and ended up building my own flow.

Use the import option and copy the contents of the json file in my git hub repo.
Think you need to install the dashboard from the palette first though.


Ok, this is progress. I’m guessing what I need to do now is work on the Dashboard. I’ll try and touch base again tomorrow. Thanks, Kyle

1 Like

Wonder what node is giving you that warning?
Looks like something may need updating, no harm to check it out with the instructions at the end.
Don’t think any of my nodes had that dependency, perhaps another you tried from the palette?

When I run the command npm list agent-base in my node red directory I get one node using agent-base@6.0.2 and it is a Google contrib node that I had installed from the palette.

It dose look like you are making progress though.

One issue that I remembered that may effect you, but perhaps not too badly if you are going to run the calendar updates manually is to put the Google API in production mode you need to have an SSL cert and provide a https redirect endpoint, It will still work in developer mode but will require you to do a full login with your Google username and password once a week.

Rebooted everything this morning. However, now I do not get any messages on the side panel. Do I need to change anything within the Google Oauth2? This is the node I got from your Github flow.
image

I presume you have entered your Google client_id and secret?
Probably don’t need to change anything else but the redirect should be added in your Google Console where you got the client_id and secret under authorized redirect URLs.

And you need a debug node on the bottom output also.
The inject node should make the oauth2 node generate a URL to authenticate on the bottom output, you can copy that URL into a browser and enter your Google username and password.

(you will get a warning about giving access to an unverified app, basically asking if you trust the supplier of the API client_id/secret which is yourself)

I have a more advanced flow which, allows you to login through the dashboard which will be more user friendly in the long run. But there is quite a bit more to it, make sure to install the dashboard first if you have not already.

Sorry, I’m just trying to power through this…hope I’m not wearing you out. Can you explain what you mean by “install the dashboard?” Here is what I’ve done:

  1. I confirmed Client ID and Secret.
  2. I confirmed Redirect URLs from google and changed the dashboard on the Oauth2. It added an endpoint to the address.
  3. After Deploying and Injecting, I still don’t get any text.
  4. I fiddled around with the Oauth2 Refresh and connected it to the Oauth2, but only got a “Google Authorization error”, which is better than no message:) I disconnected and redeployed the first flow indicated in the directions.
    image


like this, note top debug node is changed to msg.result.

When you press inject a URL should be sent to msg.payload on bottom debug node.

The Dashboard field does not do anything, unless you setup a dashboard so you can ignore for now. The dashboard allows you to build a more friendly User Interface but you can completely ignore that for now.

No idea how you ended up with the /endpoint
some installs of node-red seem to require /endpoint though.

You can test by navigating with your browser.
try: http://127.0.0.1:1880/Google/Oauth2 and http://127.0.0.1:1880/endpoint/Google/Oauth2
which ever one you can view is the correct one for your redirect URL (It will say authorization failed).

Awesome. The address without the endpoint is the correct one, and it is properly placed in the Redirect line.
After adding the msg.result, I received a message with a url. I copied/pasted and got a window with a Sign in with Google asking for me to choose an account to continue with “HRL FarmOS Node-Red” which is the name I gave during the Google set-up. If I click on my email, I do an Authorization error.

I’ve reread your instructions at this point on your website, and it seems like I need to be able to successfully sign-in at this point.

You are getting somewhere now though!
I’d delete your e-mail from the post if I were you though.

Maybe I left a step out.
You need to add test users in your Google Console

Wahoo!!! Alright, I have progressed all the way to the window that states:


This button is the same address as the Dashboard url in the Oauth2, so I think I understand why clicking that button only gets me the “Cannot GET /endpoint/Google/oauth2” It looks like at this point, I need to figure out a way to connect my Logs in FarmOS to the Google Calendar. Is this the flow you are working on right now in Github? Thanks! Feel like I actually got through this…albeit like a mouse in a maze with an all-seeing guide:)

1 Like

Yes, that button is there for using with dashboard which allows you to build more user friendly GUI’s. The default address of the dashboard would be http://127.0.0.1:1880/ui but you haven’t installed or configured that yet.

The refresh node lets you get new access tokens without having to go through all of that every time. While you are in Testing mode you will need to sign in once a week, but will just need to refresh in between. In production mode you only need to sign in once and can refresh indefinitely but you need to use a public domain name for redirect URL with https and SSL certs.

What I’m working on at the moment is a propper farmOS module which does not require Node-Red, but it may be a while before its ready for Farmier.

You have the hard bit done now, so what are you trying to achieve?
Every log sent to calendar on creation?
Only certain log types?
Only pending Logs?
Or Something Else?

Here are some Read and write examples for the Calendar

I’d recommend using a separate calendar from your personal one or existing farm one to do some testing on.

The Dashboard allows you to build simple GUI layouts
So basically simple webpages with buttons to automatically navigate to the google login screen (and back)

or
to interact with the farmOS API

or visualize data

For the time being, yes, I think every log that has been created. It would be ideal if it captures all logs already created for the future, but it wouldn’t have to capture past logs. The main motivation here is for me to share the calendar with other workers on the farm for an easy to read set of to-dos.

So all pending logs should cover that.

The following will fetch all pending observation logs with an API node
log/observation?filter[status]=pending

After setting this up, I injected the FarmOS Oauth2 and then injected the API. It looks like I’m not picking up any logs…Does log type have to be an observation? Most of mine are activities or inputs.

Remove the timestamp and topic from the inject node (don’t know why they are there by default)
No observation is just an example, replace with your log types.

log/activity

or filtered for just pending logs

log/activity?filter[status]=pending

If you leave it blank it will return the links of every API endpoint log/activity

Gotcha. Understand about switching out different log types in the API section of the node. However, if I leave it blank, I don’t get any data. If I put Activity, it is showing some results. For now, I can stick with that, but normally, I have a mixture of activities and inputs. I don’t know where to drop the timestamp/topic. The inject button seems blank.