N8n.io integration

Well,

Thanks for pointing it, I did not follow. As I automated everything, I did not see it :slight_smile:

I set a protection just picking the 0.x.x to avoid including untested breaking changes.

I will need further investigation to test the 1.x to see if everything is Ok. Then I will follow the 1.x versions as I did previously.

If you want to contribute, I can create a specific branch in the GitHub - Rbillon59/home-assistant-addons: Repository of self made addons and let you test it ?

OFC I will mention your github in the repository as contributors for doing this :slight_smile:

Please let me know. I’am currently quite busy to work deeply on this one.

2 Likes

I’d love to help, really, but I’m not the right person. I’d love nothing more than being able to contribute and speed up the process.

I barely get around n8n and HA myself, and especially their setups. I’m no dev. I would not know where to start to use the branch from github instead of the master, how to install that in HA as a diff instance of the current one…

After all that is sorted then I’d be fully happy to test all my workflows extensively making sure everything works, but that’s as end user. :frowning:

I’ve tried reading the migration guide and the major things I picked up are

  • The changes to the WEBHOOK_TUNNEL_URL, but from my understanding it’s a matter of a name change.
  • Deprecation of MySQL and MariaDB. But no clue how this affects. For instance I use MariaDB as db in my HA. Not sure if that means I’ll need to switch or it’s unrelated in this case.

If I can help in anything at a adv user level, please let me know and I’ll do my best to help.

1 Like

Hello, I’ve pushed the migration to the 1.8.2 version.

Fell free to update and discuss any encountered issue ! (Looking at you @Chaoscontrol :stuck_out_tongue_winking_eye:)

The github action have been updated to follow major version as well

Cheers

1 Like

Amazing, thanks!
I just risked it and updated it and so far it seems good. At least I could access fine without doing anything special.

It detected my subdomain as dangerous, which is something that happened during the original set up. But this might be more of a me issue as I have a reverse proxy to access etc. Will have to dust off and debug again.

Aside from that, I will report in a couple days as all my automations run at 00:00h once a day. But looks promising.

Questions: didn’t their migration guide say MariaDB was deprecated? I use MariaDB in HA as my db and was worried I’d have to change to PostgreSQL.
I also noticed the WEBHOOK_TUNNEL_URL being removed, but I am still using it in my config for some Google auth. Do you know if it will still work?

Many thanks!

Hey,

thank you for taking a look.

Yes the cert error is tied to your reverse proxy settings.

How the automation went ?

About your question, the database deprecation is about n8n itself. Let me explain a bit. the n8n lives in a Docker container and do not connect to external database. In other cases than home assistant, you would like to connect it to an external database like mysql / postgres or whatever.

But in our case, we are using the default settings which is a sqlite database. Sqlite is a database as a file living inside the container. So it does not refer to your Home assistant database directly

About the WEBHOOK_TUNNEL_URL, they seems to have changed the way to expose your webhook, with a new command line start (not env var). Taking that change into account, I’ve added the cmd_line_args to the addon config. You should be able to set start --tunnel as commandline args. It haven’t been tested yet* so please feel free to try it :slight_smile:

Thanks

Great stuff, thanks for the explanation. Makes sense, the db thing was what worried me the most. Good it wasn’t that impactful on HA.

I’m terrified of CLI, so really can’t test much for you. I’ve noticed the setting I had has changed into an env_vars_list, and it has been retained.

Log says: exported WEBHOOK_URL=http://localhost:5678

Automations have worked just fine. So apparently nothing broke.

However, I went to double check into the Google OAuth I have set up, and while it seem ok (it shows the Redirect URL as the one in the webhook, which I think it’s what’s supposed to do), I wanted to force check and clicked reconnect again. And this happened:

So now I guess something should be fixed but I’m not sure what. Any idea?

Is there an HACS integration for n8n that would allow communication with the API from Home Assistant?

2 Likes

I keep getting this error when I tried to update n8n addon from 1.0.29. Why is that? I get this message when trying to update to any version after 1.0.29.

2024-04-25 19:44:40.847 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on 3cfc8f0f_hass-n8n
2024-04-25 19:44:47.793 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon 3cfc8f0f_hass-n8n
2024-04-25 19:44:47.793 INFO (MainThread) [supervisor.backups.manager] Backup 1e552ca2 starting stage finishing_file
2024-04-25 19:44:47.796 INFO (MainThread) [supervisor.backups.manager] Creating partial backup with slug 1e552ca2 completed
2024-04-25 19:44:47.796 INFO (MainThread) [supervisor.docker.addon] Updating image 3cfc8f0f/amd64-addon-hass-n8n:1.0.29 to 3cfc8f0f/amd64-addon-hass-n8n:1.0.34
2024-04-25 19:44:48.943 INFO (MainThread) [supervisor.docker.addon] Starting build for 3cfc8f0f/amd64-addon-hass-n8n:1.0.34
2024-04-25 19:44:49.630 INFO (MainThread) [supervisor.api.middleware.security] /network/interface/default/info access from ccab4aaf_frigate-fa
2024-04-25 19:44:55.590 ERROR (MainThread) [supervisor.docker.addon] Can't build 3cfc8f0f/amd64-addon-hass-n8n:1.0.34: Get "https://docker.n8n.io/v2/": remote error: tls: internal error
2024-04-25 19:44:55.590 ERROR (MainThread) [supervisor.docker.addon] Build log: 
Step 1/14 : ARG N8N_VERSION=1.36.4


Step 2/14 : FROM docker.n8n.io/n8nio/n8n:${N8N_VERSION}


2024-04-25 19:44:56.103 INFO (MainThread) [supervisor.updater] Fetching update data from https://version.home-assistant.io/beta.json

Hello,

It does not seems to be related with the plugin itself. I’am able to pull the n8n docker image without any issue :

$ docker pull docker.n8n.io/n8nio/n8n:1.36.4
1.36.4: Pulling from n8nio/n8n
bca4290a9639: Already exists
31e174fedd23: Pull complete
df998480d81d: Download complete
e6f4e57cc59e: Download complete
d9aa7efe069e: Download complete
89368adbe7af: Download complete
4f4fb700ef54: Download complete
f957c89b510f: Waiting
dc562193ebf3: Waiting
aa6eeff09f88: Waiting

The error in your logs (Get "https://docker.n8n.io/v2/": remote error: tls: internal error) is probably due to a networking issue (VPN, Firewalls …)

I just discovered this addon, nice work! I’m currently running n8n in a Docker container but got stuck, so I thought I’d reach out here for some advice.

I’m trying to use the todo.get_items service and need to figure out how to process the response in n8n. Has anyone managed to do this, or does anyone have any tips on how I might proceed?

Hi,
Is it possible to setup with nabucasa cloud? im having issues pointing it to the ssl file ect

Running HA on a RaspberryPi 2B. Getting the following error message…

no matching manifest for linux/arm/v7 in the manifest list entries

Rbp is a no-go for N8N?

edit: hmz… i now see Rbp 2B is ARMv6, issue with NodeJS… so also incompatible with N8N.

Hello,

The raspberry 2B is an armhf architecture. Currently most of the docker images are compatible with amd64 and arm64 (thanks the Apple silicon for that), and so is the n8n image.

The arm64 arch on raspberries is available since the raspberry pi Zero 2.

Then the Rpi 3 and Rpi 4 are also on arm64.

So unfortunately no, you cannot do it on rpi 2

Never tried, I can’t tell, sorry

I installed the addon but struggled to find a solution for this error message when first time trying to login:

Your n8n server is configured to use a secure cookie,

however you are visiting this via an insecure URL

To fix this, please consider the following options:

  • Setup TLS/HTTPS (recommended), or
  • If you are running this locally, try using localhost instead
  • If you prefer to disable this security feature (not recommended), set the environment variable N8N_SECURE_COOKIE to false

Hello,

You can try to set the env var in the addon configuration like the following :

That worked well. Thank you.

Hello,
I also have problems with the Nginx Proxy Manager.
I really dont understand what is happening in the back end with the ports.
What exactly do I have to do that I can use the n8n addon?
I run Homeassistant as the HAOS.
For simplicity:
local homeassistant IP: 192.168.0.1
external duckdns Adress: https://mysmarthome.duckdns.org

Do I have to forward something in the Nginx Proxy Manager? If so, what exactly there are multiple fields. Domain Name, scheme (https/http), IP and port.

With some experimentation I got the cookie not accepted warning. (But I dont know which settings I used to get there (I experimented a lot))

Thank you for your help.

Ok, I got it.
Add a new proxy host:
(sub)domain = n8n.mysmarthome.duckdns.org
scheme = http
IP = homeassistant (or your real IP)
port = 5678 (or the port your declared in the configuration of n8n)

activate SSL with Lets Encrypt

n8n config:
protocol = http
env_vars_list:
WEBHOOK_URL: http://my-ha-ip:5678

1 Like

@Rbillon59 thank you so much for this, for me it saves a lot of hassle to have this as a HA add-on :grinning:
I did find it difficult though for linking this to Google API (OAuth2) and I don’t know of an easy workaround.
With Docker installed in my local machine, I can authenticate with the default WEBHOOK_URL = http://localhost:5678
(and Google API accepts this as a redirect URI)
But with n8n inside HA, localhost is no longer an option.
And other than localhost, Google API doesn’t accept IP addresses, or a domain name without it being https.
So I ended up installing nginx Proxy Manager and adding a new subdomain with SSL just for this.
I wish I knew of something simpler but this is working so no actual complaints from me :joy:

Thank you.