-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
local_smarthome path replaced by the original smarthome path #265
Conversation
Hello @ckhmer1
Of course I want to help you . Can you exactly explain, what has to be done and which test you would like to see? One other thing. @rockstar2020 mentioned this in his post today in topic #258 A Name is required and currently it is not in the documentation and I do not use it. |
Hello @FireWizard52, Regarding the name in the mDNS config, in my opinion we should add also it in both places, in the Google configuration as well as in the Node-RED configuration, together with the service name. |
If You check in the commits, there are changes for the App.js. The new app version is 2.1. |
Hello @ckhmer1 Thanks, I noticed it, by inspecting I tried to patch, but got errors.
I did this before as indicated by Paul Reed (#128) I got:
Regards |
Hi, git apply 265.diff My suggestion is to reinstall the node using: npm uninstall node-red-contrib-google-smarthome and then apply the patch. |
hello @ckhmer1, I previously patched with 259, but that was 13 days ago. After that I installed 0.2.10. So in my opinion it is the original 0.2.10. |
No don't uninstall, just reinstall from your user directory (.node-red) and it will overwrite what you have currently installed, leaving your configuration intact, just like when you do an update. |
Same as you @FireWizard52 I can't apply the patch either;
But, it could be installed directly from Claudios repo like this; I'll also give it a try shortly... |
I took the following steps:
So it failed again. |
@FireWizard52 If you install it direct from @ckhmer1 repo using the command in my last post, it install fine. (but not currently working for local execution!) Installed Claudio's branch, updated app.js to (v2.1), restarted node-RED, restarted all devices... Although it is working fine with cloud execution, I'm getting a 404 error I'm going to leave it while, and see if it sorts itself out... |
@ckhmer1 and @Paul-Reed, Paul I was a few minutes behind you. Your message came in, while I was rebooting I had no issues with old nodes, as I already replaced these some time ago. At the moment, when I restarted my Google Home device (Google Nest Hub) I got the following in the Node RED Debug pane: Looking to Chrome Inspect gives me: So this looks very identical, as what @Paul-Reed got. Cloud execution works fine here too |
@ckhmer1 , Should we test again or should we wait? |
I decided not to wait and to test your latest commit. The result is POSITIVE. No errors in the Node-RED Debug pane, as shown previously. Google Chrome (Inspect Console) did not show any error and Local fulfillment is working again. Good job! Thanks |
@FireWizard52 , Thanks |
Hello @rockstar2020, You asked:
No, I did not. So currently I do not have any name configured in the Google Actions Console. I tried it in order to see, if it would make any difference. It did not, but at that moment I was not aware of the error in the IP Address (127.0.1.1 instead of 127.0.0.1, what it should have been) He does not want to change more than one issue at the time. I fully understand that. So I got it working as soon as I corrected the error with the IP Address in my /etc/hosts file. At that moment It was directly discovered by the mDNS Discovery app. I also found that the "/etc/hostname" should only contain the host name and NOT the domain name. So I got it working and I offered my support to test the new commit by Claudio. To try it, you have the install @ckhmer1 's version from his repo. Do it as follows:
Regards |
Thanks a lot @FireWizard52 for your detailed explanation. |
Hi all, |
@FireWizard52 @ckhmer1 My node-RED log (in debug) also suggests LE is working OK;
So not sure why my log is showing |
Good, that it is working for you too. |
AAAAAAaaaahhhh !! |
Dear all, We have now more than 1 path to control the Google Home device.
Option 3 shows also a green/red dot. Is it an idea to use a different color, e.g. blue dot, to see the difference? |
Unfortunately local fulfilment still does not work for me. Now I understand why I don't get any errors if I put a name. I think it's because Google device is looking for the name I indicated and since there's no such name in my network it doesn't spit any errors. But if there's no name it scans the network and when it tries to authenticate it gives above errors. |
You wrote:
Wouldn't the 'blue dot' be immediately replaced by the green/red circle/dot as it was fulfilled. (ie the blue dot would only be visible for 5 or 6 milliseconds? No, this input data is only a status update to the Google Device node. It does not activate e.g. a switch. Currently, if a switch has been operated by local fulfillment, I see the green/red circle. If, because some external automations, updates the switch, I see a green/red dot. But is this caused by an external automation or single action or a voice command, using the Google cloud server? |
Hello @rockstar2020, I looked in detail to your post and then specifically the error. It expects "nodered-google" but it got "googlecast" Is your Google actions configuration correct and does it state nodered-google? |
Yes @FireWizard52 , that's why I think when I add a "Name" field it doesn't look for Google Cast devices in my network and hence it doesn't throw any errors. |
Detailed info, you will find here: https://developers.google.com/assistant/smarthome/concepts/local As far as I understand. The app.js is uploaded to the Google server. During reboot of your Google Device this app is loaded into a "sandbox" on your Google device, so that it is able to communicate directly with Smart Home node in Node RED. But If I'm wrong, please correct me.
The Google Device runs the app.js If you search in the app.js for "nodered-google", you will find:
This is the error you get. By means of mDNS (multicast DNS) the Google device will find your IP Address. (Similar as the mDNS Discovery app) You asked also:
Yes it is correct. See my logging below. I really think your issue is that mDNS discovers "googlecast" and not "nodered-google". |
Thanks @FireWizard52 , you are exactly right about how the app.js gets loaded onto the Google Device. That is also my understanding. |
I discovered 1 issue. I updated one node in Node-RED, which had nothing to do with Smart Home (it was the Worldmap node I use for some application). Therefore I had to restart Node Red and after NR had started again, local fulfillment did not work. Chrome inspect, shows: A restart from my Google Device solved this issue. I do not hope that every update of NR or one of its nodes, also require to restart the Google Device. |
I'm not sure that it depends on this PR, I'll try to reproduce it. |
I've tried, but can't replicate the problem here @FireWizard52 |
Thanks @Paul-Reed for the feedback. |
Yes, I applied your update first. |
Hello @ckhmer1, I applied the update this morning and it functions well, as I would expect. Local fulfillment is working on all switches. But I wonder, should it also work on sensors, thermostat and other devices? I don't see it, yet. What is the intended functionality/use of allowing to refresh the Auth token? Thanks for your reporting, while updating some of your NR nodes. I will monitor it, but it might have been a single incident |
Yes, I noticed that, but wondered if it is was because the sensor data is stored in the google Homegraph, and not locally, and therefore needs to be expedited via the cloud?? |
Thanks for your response.
If that is the case, then it is normal, that I see as status indicator a dot and not a circle under the device. |
The local fulfillment is in the common code, it should work for every device except the one configured with the second authentication, of I remember well. The refresh token is for increase security, updating the token as soon as possible. |
#Thanks Claudio, @ckhmer1 for your explanation.
This makes it more interesting, if you were be able to see the difference between "Cloud fulfillment" and the input from an external source.
Is a user action required? E.g. do we have to create a flow for it? Thanks for all your efforts. Great job. Regards |
I've just asked for a sensor temperature reading, and found the node-RED log entry, which suggests that it was in fact executed locally (despite the node only showing a dot, and not a ring).
|
Do you think having the info that a request is coming from a local fulfillment in the output message is useful? You don't need a flow for refreshing the Auth code, is all in the common code. |
For me it is okay, as it is today. Is it useful to have that info also in the output message? It would be nice if e.g. the sensor node also can indicate that the query has been fulfilled locally. |
No, the sensor node only receives an input every 10 minutes, and that did not coincide with the query. |
Finally had the time to test it. For me, local fulfillment works too with Claudio's changes. Therefore merged! Thank you! I think the problem with the sensor node is because the status icon is only set on EXEC requests. EXEC requests only happen when Google sends a new state value for a device. Asking for the sensor sends a QUERY request instead. QUERY only asks for the current state, but it does not set a new state. Without a change to the state of a device, there was no need to alter the status icon and text (at least before local fulfillment was implemented). So the device nodes simply keep their old icon (which usually is the filled circle they got when you injected a value). To show a ring icon for sensors, we would have to update the status icon on QUERY requests too (PRs welcome!) |
Reading the Local fulfillment documentation I've read the sentence "No modification of your hardware is expected to integrate local fulfillment.".
In the Add local fulfillment to your smart home Action documentation the SYNC response custom data contains the authToken.
Why don't use the authToken field to deliver the access token and use the original smart-home path?
In this way, we have no authenticated path where everyone can send commands to the smart home.
I've added auth token for the local request, this token is updated every time a sync request is received.
Unfortunately, I'm not able to test it completely, because I'm still not able to make the local execution work.
Is someone able to test it?
Thanks