Closed vjooris closed 4 years ago
Eco temperatures: $nest->setEcoTemperatures(...)
Safety temperatures: checking
You should be able to use this for setting your Nest’s safety temperatures:
public function setSafetyTemperatures($low, $high, $serial = NULL)
{
$this -> prepareForGet();
$serial = $this -> getDefaultSerial($serial);
$data = json_encode(array(
'lower_safety_temp_enabled' => TRUE,
'lower_safety_temp' => $this -> temperatureInCelsius($low, $serial),
'upper_safety_temp_enabled' => TRUE,
'upper_safety_temp' => $this -> temperatureInCelsius($high, $serial)));
return $this -> doPost('/v2/put/device.' . $serial, $data);
}
thank you for your that fast answers. I'll search how to implement the safety température, It looks difficult to me, I could better understands an answer like the one of @gboudreau for the setEcoTemperature ...
I was able to set the Eco Temperature. but for the safety/emergency temperature... whaw... and I do not dear to modify the class by myself (it's too risqué) from what I understood, the @zecanard code is for setting the safety temperature, not reading the current value. It should be very Nic if it was included (the reading) in the getDeviceInfo() function, and if a function like$nest->setSafetyTemperatures(...) should exists. ... Thank you for your understanding
For the safety temperatures, I made the changes to add a setter function.
Update your class from my repository, and you'll be able to use $nest->setSafetyTempertures(...)
the same way.
tant you ! and Can I read it too ?
Update again (just added something to read those values), then:
$info = $nest->getDeviceInfo();
echo $info->current_state->safety_temperatures->lower;
echo $info->current_state->safety_temperatures->upper;
GREAT ! (I've a lot of work to do now )
should I dare to ask, if possible, to have the same info for outside parameters reported by the Net (temperature, humidity, meter info, ???) ? This way I've all my Nest on my domestic box :-)
Update again (just added something to read those values), then:
$info = $nest->getDeviceInfo(); echo $info->current_state->safety_temperatures->lower; echo $info->current_state->safety_temperatures->upper;
one thing, just to be "consistant" with previous developments, for eco_temperatures you have low & high, why not keeping the same vocabulary for safety_temperatures ? For me their is NO problem (of course), but if you want to standardize, it is perhaps better now, that this version of the new code is not yet much used ?
I agree - submitted PR, but looks like gboudreau took the names from nest as they use upper and lower. I'll defer to them approving or rejecting the request.
This is not an issue, but a suggestion. (if there is an other place to post suggestions, thank you to let me know, I didn't found it, sorry)
Based on your API, I've create a php to allow my domestic box to control my Nest Learning Thermostat. This was a must have for me => thank you.
Should it be possible to allow/add the following in your API :
Thank you