How to set target_temperature with Firebase in Java?


#1

Hello.
I’m making the server to communicate with nest using REST.

But now I have to use firebase instead of REST in my serverside.

I’ve checked github “nestlabs/android-sdk”, and found the way to set target_temperature_f.

I can not use the entire android-sdk, so I have to code by myself.

The simple code that I made after studying nestlabs/android-sdk, is below.

	long temperature = 84;		
	final StringBuilder mBuilder;
	mBuilder = new StringBuilder();
	mBuilder.append("/").append("devices");
	mBuilder.append("/").append("thermostats");
	mBuilder.append("/").append("[my devcieID]");
	mBuilder.append("/").append("target_temperature_f");		
	Firebase mFirebaseRef = new Firebase("wss://developer-api.nest.com");       
            mFirebaseRef.child(mBuilder.toString()).setValue(temperature);

With the code, I could not control thermostat…

I think the accesstoken must be needed to control it, but there is no part to use accesstoken in nestlabs/android-sdk.

Could you give me advice to control set temperature with similar way to upper code?