mikejac / node-red-contrib-google-smarthome

A collection of Node-RED nodes to control your smart home devices via Google Assistant.
GNU General Public License v3.0
115 stars 36 forks source link

again a device linking problem #180

Closed NikAWing closed 11 months ago

NikAWing commented 2 years ago

Hello all!

I'm really new to node red and google actions, but I get things done step by step :) After IFTTT became a no-go solution, I'm glad I've found out about node-red-contrib-google-smarthome.

To be honest, setting it up with google is really difficult, I'm glad there is a how-to, though the how-to also has puzzling parts (e.g. "Client ID and Secret: The same strings you generated and entered on Google Search Console earlier", google search console?)

Anyway, I have it running, I can reach it via reqbin, I can reach it when I try to link it in the google home app. If I change the settings from "use google login" to other credentials, it also changes in the "add device" process in google home app. BUT: no matter what I select (and for now I use google login), the device will not be added to google home app. All it says is "Could not reach [test] devicename. Please try again." (I replaced my test device with "devicename")

I looked through the issues (and solved issues) and restartet node red to see the debug messages. But I see no errors.

The moment I click the "Link" button I see this:

HttpAuth:httpAuthRegister(GET /oauth)
GET /oauth?response_type=code&client_id=[...]

The moment I log in via google, I see this:

HttpAuth:httpAuthRegister(GET /oauth)
GET /oauth?response_type=code&client_id=
HttpAuth:httpAuthRegister(POST /oauth): body = {"username":"","password":"","client_id":[etc ...]
HttpAuth:httpAuthRegister(POST /oauth): Google login
HttpAuth:httpAuthRegister(POST /oauth): email [...] valid: true
HttpAuth:handleUserAuth(): login successful
HttpAuth:handleUserAuth(): authCode successful; authCode = [...]
POST /oauth 302 84.697 ms - 1776
HttpAuth:httpAuthRegister(GET /oauth)
GET /oauth?response_type=code&client_id=[...] 200 5.646 ms - 7981

I have attached a debug node to the management node and there nothing appears.

Where should I look at to fix this?

Thanks for hints and with best regards, Nik

NikAWing commented 1 year ago

I just switched from Raspi3B+ to a new NUC Box running Ubuntu. Oh wow, that was more work than expected, I started a week ago and it took the whole weekend to set everything up. Just today I had success with caddy, I forgot to forward ports 80 and 443 to the box and I also had the eMail section between 2 destinations, it has to be on top of everything as in the node-red example. And having at least 3 webservers (apache2, lighttpd and caddy) doesn't make it easier :) for me it's still hard to see if I could use less and still have the same results.

Btw, I think google smarthome is not yet working perfectly itself, you can not see the temperatures in the Home app, but google assistant reads them if you ask. What I still don't get: how to name the sensors to make google assistant read the value instead using the google search engine to give a reply.

Soon I'll try to find out how to ask google assistant if doors are open or lights are on and to make them switchable or get alarms. But I need a break for a moment, lol

edit: @ChutneyMary I didn't refresh the thread so I saw your last reply after sending mine and you had the same problem, lol ;D

Caprico85 commented 1 year ago

Sorry for your trouble. I really thought Caddy would simply use the given port to get the certificates. When I wrote this article I even tested it with port 443 disabled. But it seems I still had the old certificate on disk, so Caddy didn't have a problem. Now that I tested it again I see Caddy really uses 443. I updated my instructions on caddy once again.

NikAWing commented 1 year ago

I suppose it wants to know if https is supported for the cert :)

NikAWing commented 11 months ago

I'll close this issue here. Everything seems to work as expected and also the google home app was improved, it shows everything quite nice now :)

Thanks again for the support!