andrei-tatar / nora-service

NORA backend service
https://node-red-google-home.herokuapp.com
34 stars 30 forks source link

How to get the state of the Device #18

Closed srinidhichiru closed 4 years ago

srinidhichiru commented 4 years ago

Hi andrei, first of all iam very glad i found Nora services to work on my test bench. Actually iam working on Nodered since a couple of months and created a Dashboard with local server. i could control all my devices also can find the live ness of my modules with the help of LWT( Last Will and Testament). Now all my conditions got satisfied with local Dashboard. when it comes to Google home with the help of your Nora Services, i could able to get payload from Nora - nodes and device respond to the command very well. Now i have 2 problems:

  1. I could not get the status of the module (aliveness ) Even if the module is in off condition google shows it is alive and gives the command. (attaching a screen which i required) offline

  2. If i operate the device with my local Dashboard, the status of the relay could not be updated on google immediately as i need to refresh my page to get it.

Is there anything iam missing in my loop.. please help me in this regard

Thanking you in advance

andrei-tatar commented 4 years ago
  1. Each node has an online property. You need to set it to true or false in order for google to know if a device is online or not.

  2. Google Home doesn't support live updates. This is not something I have control over. You can try opening an issue with google home (if there isn't one already).

srinidhichiru commented 4 years ago

Thank you @andrei-tatar for your immediate response.

  1. As per the instructions I found only limited properties to feed into the node. Now that you said there is a property “online “ to be feed back, I will try that and let you know. Before that could you please confirm the structure of JSON to inject all the possible properties back to node could be lot more easier for me to work on.

  2. Thank you for info, I will check this out.

andrei-tatar commented 4 years ago
  1. Depends on the node. Actually, I looked a bit through the code and online can't be changed from the input message payload. Not sure why I remembered that. It will need a code change in order to support it.
srinidhichiru commented 4 years ago
  1. Yes I did observed one thing. When I powered off my device which is running nodered, I found the the property “online” became false and also observed offline on google home page. What does this situation means?
andrei-tatar commented 4 years ago

It's as expected.

srinidhichiru commented 4 years ago

Let me know after you resolve this issue. Will be waiting for your reply. Thank you advance.

srinidhichiru commented 4 years ago

Sir, Is there any progress in this regard.

andrei-tatar commented 4 years ago

Should work now with node-red-contrib-nora@0.0.34. All devices accept a payload with a boolean property called online. This will tell google if the device is online or not.

srinidhichiru commented 4 years ago

Sir, i hope you are working on the subject mentioned feature for as i am eagerly waiting. i saw a realize version 0.34.

andrei-tatar commented 4 years ago

@srinidhichiru Check the previous message:

Should work now with node-red-contrib-nora@0.0.34. All devices accept a payload with a boolean property called online. This will tell google if the device is online or not.

srinidhichiru commented 4 years ago

sir, if you don't mind can you post an example flow(node-red) as i commented here after my trials. Feel i may be missing something in the flow from my side.

srinidhichiru commented 4 years ago

Sir, Sorry for the delay. And finally got the result what i was expecting with your modification in node-red-contrib-nora@0.0.34. Iam really thankful to your work and attention to the problem. Finally i would like to know how many devices can be operated on one account at max.