How to add lights in Home Simulator


#1

Hi Team,

I think home simulator allowsto add Thermostat, Protect and Camera only. Can some one tell me how can I test the turn off/turn on feature without using the physical devices.

Also, Where can I see the Thermostat state when I toggle between Away/home in the Home simulator ?

Thanks,
Krishna


#2

I set ‘away/home’ on Structure but which is not getting reflected on Home simulator even after I logged out and logged in again. But when I debugged my code it is giving the proper awayState.

Is it a known issue?


#3

The home simulator is only for nest devices and cannot add a light. Which on/off feature are you referring to?

You can also login to https://home.nest.com and see the Home and Away status reflected there.


#4

Thanks for your reply.
Any sample code in android for turning off/on lights is helpful. As per my requirement i have to turn off/on the lights whenever there is a change in the Nest away/home states.

Thanks,
Krishna


#5

Nest does not control lights. You will have to consult the light bulb manufacturer and look at their API if you’d like to control them. Control is not done through Nest and we can only help on Nest products.


#6

Thanks for your response.

I have one more query, does nest service/cloud sends any notifications to my android application when ever i change the profile setting away/home? If so, what type of notifications are they? How do I register for these notifications?

Thanks,
Krishna


#7

ah that I can answer! Yes the API provides 3 methods for getting updates. The options are REST polling, REST Streaming, and Firebase. We have an Android SDK here: https://github.com/nestlabs/android-sdk

As well as a sample app for it here: https://github.com/nestlabs/android-sdk-sample

These use the Firebase protocol, but you could also use REST polling or Streaming. I’d suggest looking more at the documentation here: https://developers.nest.com/documentation/cloud/get-started


#8

Sir,
Request you to please answer to the questions rather than redirecting with links. I went through the links those are not explaining clearly.

Why don’t you answer to those questions ? If you don’t know, i request you to please contact the development team and let me know.

Thanks for your understanding.

Thanks,
Krishna


#9

I request you to please help me. It is a blocker for me.

Thanks,
Krishna


#10

You will have to read the docs to understand how to get started with authorization, device management, and making API calls. You have 3 methods for connections REST Streaming, Firebase, and Polling and will have to determine which protocol fits best for your use cases and infrastructure.

If you’re looking for a specific example on how to write the Away state using an HTTP GET call here is the example that is from the API read examples section.

in cURL
curl -X PUT
-H “Content-Type: application/json”
-H “Authorization: Bearer c.lPg4Z…”
-d “{“away”: “home”}”
https://developer-api.nest.com/structures/STRUCTURE_ID

Here is how you could read using GET:

https://developer-api.nest.com/structures/STRUCTURE_ID/away?auth=<AUTH_TOKEN>


#11

Hi urman,

But I see Nest playstore app is controlling the Lifx lights. Do you mean even Nest playstore app also uses the Lifx API to control the Lifx bulbs when user sets away/home profile?.Similarly to control other devices it uses their APIs. Can you please confirm ?

Thanks.


#12

LIFX uses the Nest API to read the Home/Away state. Nest doesn’t use the LIFX API.