another question - will this work if you have ‘migrated’ your account to google from the original nest account?
The Nest public API doesn’t allow you to set the target humidity, but this uses the private API which does allow you to. However, Nest just made a change that broke the PHP Nest login, at least for those with original Nest accounts. Apparently if you’ve migrated to a Google account it still works, but I haven’t had time to research that yet to be sure the Home Assistant Nest component still works if you migrate, or if there are other ramifications.
Same here, this PHP script has stopped working for me, still on a Nest account for now, hesitant to migrate. I will be following this thread and the opened issue by joe248 with great interest as this humidity control automation was very useful to me. Thanks for the work that you are putting in and for sharing this.
Take a look at my github issue - I posted a fix. Let me know if it works for you.
Thanks for all of your feedback - I hope to try this out this weekend.
Could you please help me understand what to use for login info - would this be our google login now after the migration?
define(‘USERNAME’, ‘YOUR_NEST_USERNAME’);
define(‘PASSWORD’, ‘YOUR_NEST_PASSWORD’);
Yes, it should just be whatever credentials you would use to log in to the Nest app.
Thanks Joe.
Has anyone had success with using another source of weather data to trigger this script?
I noticed that the WU API is not possible without a personal weather station (which I do not have).
I’ve been using Dark Sky. Set up the platform and then your shell command will become something like:
shell_command:
update_nest_target_humidity: '/usr/bin/php /home/homeassistant/custom/scripts/update_nest_target_humidity.php {{states.sensor.dark_sky_temperature.state}} {{states.sensor.dark_sky_humidity.state}}'
thanks - is there a location where you have posted your latest code?
I just edited my original post with my current code. Not much has changed besides using Dark Sky instead of Weather Underground, and I now bump up the target humidity by 5% when the heat is running to improve efficiency with regards to usage of the furnace fan. See my comment in the code for the explanation.
Super - thanks Joe. I imagine the kitchen hvac sensor you reference is your nest?
That’s correct
Hi everyone,
Sorry… newbie questions…
So far, I have done the following:
-
setup darksky API & added to configuration.yaml -> working!
-
downloaded the ’ nest.class.php nest API into director -> done
-
created a ’ update_nest_target_humidity.php’ file
a) updated the nest.class.php file location
b) updated my login information -
added configuration.yaml changes -> not sure if I did this correctly…
some questions:
- does the name of darksky need to match b/t what is called in the config & your trigger?
i.e. my configuration file states:
sensor:
- platform: darksky
…whereas your configuration.yaml calls out
entity_id: sensor.dark_sky_temperature
- Where do I add the start of your configuration update…? …the ‘configurator’ is flagging this
- alias: "Nest auto target humidity control"
end of the stream or a document separator is expected at line 69, column 1:
- alias: "Nest auto target humid ...
^
- how do I tell HA that my nest is a sensor… do I need to add ad section in configuration.yaml for my nest?
THANKS!
- Dark Sky will add sensors with names like sensor.dark_sky_xxx for all
monitored_conditions
you have in your config. You’ll need to add at least ‘temperature’ and ‘humidity’ to yourmonitored_conditions
list in your config. - Sorry this wasn’t more clear. This goes under your automations, so it should look like:
automation:
- alias: "Nest auto target humidity control"
...
- Yes, you need to add the Nest integration to your configuration by following the instructions here
I think I have everything setup… but getting an error. My guess is that my Nest is not setup correctly in my configuration.yaml file. Could you please provide an example?
I think this might be the case since I cannot find a nest sensor similar as what you show in your example above:
- platform: state
entity_id: sensor.kitchen_thermostat_hvac_state
Error while executing automation automation.nest_auto_target_humidity_control. Unknown error for call_service at pos 1:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 437, in action
await script_obj.async_run(variables, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 190, in async_run
await self._handle_action(action, variables, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 274, in _handle_action
await self._actions[_determine_action(action)](action, variables, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 357, in _async_call_service
context=context,
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 97, in async_call_from_config
domain, service_name, service_data, blocking=blocking, context=context
File "/usr/src/homeassistant/homeassistant/core.py", line 1236, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1261, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/components/shell_command/__init__.py", line 78, in async_service_handler
process = await create_process
File "/usr/local/lib/python3.7/asyncio/subprocess.py", line 217, in create_subprocess_exec
stderr=stderr, **kwds)
File "/usr/local/lib/python3.7/asyncio/base_events.py", line 1529, in subprocess_exec
bufsize, **kwargs)
File "/usr/local/lib/python3.7/asyncio/unix_events.py", line 190, in _make_subprocess_transport
**kwargs)
It sounds like you don’t have a Nest developer account so you won’t be able to use the official Home Assistant Nest integration. However, you shouldn’t need it to use my script. Just remove the two automation triggers related to the thermostat and keep the outside temperature trigger.
thank you! I will try that today.
By the way, have you found your nest to report a fairly accurate humidity reading? Mine seems to report high (~15% higher than a handheld device). So, I was thinking of using a ‘DHT22’ sensor for reading the current humidity.
Thanks @joe248. I tried removing the nest triggers.
looking at the error log some more, I think the issue is calling php. Since I am using hassio and not raspbian , i don’t find php in that directory either in bash… is there a way to check if php is indeed installed & determine the location?
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/php': '/usr/bin/php'
I find my Nest to be within about 5% or so of other humidity sensors.
If you have PHP installed, running the command which php
should tell you where it is located.
thanks - I re-installed home assistant on top of raspbian. I think I finally configured it… but i keep seeing these errors:
humidity.log
11-28-2019 13:12:11 Setting Nest target humidity to 40% for outside temp 37.4 (current humidity inside = %, outside = 65.0%)
11-28-2019 13:12:12 ERROR: Nest returned:
sudo /usr/bin/php update_nest_target_humidity.php
PHP Notice: Undefined offset: 0 in /home/homeassistant/.homeassistant/nest.class.php on line 895
PHP Notice: Undefined property: stdClass::$link in /home/homeassistant/.homeassistant/nest.class.php on line 345
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 345
PHP Notice: Trying to get property 'structure' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 345
PHP Notice: Undefined offset: 1 in /home/homeassistant/.homeassistant/nest.class.php on line 345
PHP Notice: Undefined property: stdClass::$ in /home/homeassistant/.homeassistant/nest.class.php on line 346
PHP Notice: Trying to get property 'away' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 346
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 347
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 347
PHP Notice: Trying to get property 'current_schedule_mode' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 347
PHP Notice: Undefined property: stdClass::$shared in /home/homeassistant/.homeassistant/nest.class.php on line 348
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 348
PHP Notice: Trying to get property 'target_temperature_type' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 348
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 349
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 349
PHP Notice: Trying to get property 'eco' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 349
PHP Notice: Trying to get property 'mode' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 349
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 357
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 357
PHP Notice: Trying to get property 'away_temperature_low_enabled' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 357
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 364
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 364
PHP Notice: Trying to get property 'away_temperature_low_enabled' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 364
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 368
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 368
PHP Notice: Trying to get property 'away_temperature_high_enabled' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 368
PHP Notice: Undefined property: stdClass::$shared in /home/homeassistant/.homeassistant/nest.class.php on line 399
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 399
PHP Notice: Trying to get property 'current_temperature' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 399
PHP Notice: Undefined offset: 0 in /home/homeassistant/.homeassistant/nest.class.php on line 895
PHP Notice: Undefined offset: 0 in /home/homeassistant/.homeassistant/nest.class.php on line 895
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 851
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 851
PHP Notice: Trying to get property 'temperature_scale' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 851
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 400
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 400
PHP Notice: Trying to get property 'current_humidity' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 400
PHP Notice: Undefined property: stdClass::$shared in /home/homeassistant/.homeassistant/nest.class.php on line 401
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 401
PHP Notice: Trying to get property 'hvac_ac_state' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 401
PHP Notice: Undefined property: stdClass::$shared in /home/homeassistant/.homeassistant/nest.class.php on line 402
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 402
PHP Notice: Trying to get property 'hvac_heater_state' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 402
PHP Notice: Undefined property: stdClass::$shared in /home/homeassistant/.homeassistant/nest.class.php on line 403
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 403
PHP Notice: Trying to get property 'hvac_alt_heat_state' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 403
PHP Notice: Undefined property: stdClass::$shared in /home/homeassistant/.homeassistant/nest.class.php on line 404
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 404
PHP Notice: Trying to get property 'hvac_fan_state' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 404
PHP Notice: Undefined property: stdClass::$shared in /home/homeassistant/.homeassistant/nest.class.php on line 405
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 405
PHP Notice: Trying to get property 'auto_away' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 405
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 408
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 408
PHP Notice: Trying to get property 'leaf' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 408
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 409
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 409
PHP Notice: Trying to get property 'battery_level' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 409
PHP Notice: Undefined property: stdClass::$shared in /home/homeassistant/.homeassistant/nest.class.php on line 412
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 412
PHP Notice: Trying to get property 'hvac_heater_state' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 412
PHP Notice: Undefined property: stdClass::$shared in /home/homeassistant/.homeassistant/nest.class.php on line 413
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 413
PHP Notice: Trying to get property 'hvac_heat_x2_state' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 413
PHP Notice: Undefined property: stdClass::$shared in /home/homeassistant/.homeassistant/nest.class.php on line 414
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 414
PHP Notice: Trying to get property 'hvac_heat_x3_state' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 414
PHP Notice: Undefined property: stdClass::$shared in /home/homeassistant/.homeassistant/nest.class.php on line 415
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 415
PHP Notice: Trying to get property 'hvac_alt_heat_state' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 415
PHP Notice: Undefined property: stdClass::$shared in /home/homeassistant/.homeassistant/nest.class.php on line 416
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 416
PHP Notice: Trying to get property 'hvac_alt_heat_x2_state' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 416
PHP Notice: Undefined property: stdClass::$shared in /home/homeassistant/.homeassistant/nest.class.php on line 417
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 417
PHP Notice: Trying to get property 'hvac_aux_heater_state' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 417
PHP Notice: Undefined property: stdClass::$shared in /home/homeassistant/.homeassistant/nest.class.php on line 418
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 418
PHP Notice: Trying to get property 'hvac_emer_heat_state' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 418
PHP Notice: Undefined property: stdClass::$shared in /home/homeassistant/.homeassistant/nest.class.php on line 421
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 421
PHP Notice: Trying to get property 'hvac_ac_state' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 421
PHP Notice: Undefined property: stdClass::$shared in /home/homeassistant/.homeassistant/nest.class.php on line 422
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 422
PHP Notice: Trying to get property 'hvac_cool_x2_state' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 422
PHP Notice: Undefined property: stdClass::$shared in /home/homeassistant/.homeassistant/nest.class.php on line 423
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 423
PHP Notice: Trying to get property 'hvac_cool_x3_state' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 423
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 427
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 427
PHP Notice: Trying to get property 'auto_away_enable' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 427
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 429
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 429
PHP Notice: Trying to get property 'away_temperature_low_enabled' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 429
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 430
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 430
PHP Notice: Trying to get property 'away_temperature_high_enabled' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 430
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 436
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 436
PHP Notice: Trying to get property 'time_to_target' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 436
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 438
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 438
PHP Notice: Trying to get property 'serial_number' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 438
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 439
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 439
PHP Notice: Trying to get property 'temperature_scale' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 439
PHP Notice: Undefined offset: 0 in /home/homeassistant/.homeassistant/nest.class.php on line 895
PHP Notice: Undefined property: stdClass::$track in /home/homeassistant/.homeassistant/nest.class.php on line 920
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 920
PHP Notice: Trying to get property 'online' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 922
PHP Notice: Trying to get property 'last_connection' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 923
PHP Notice: Trying to get property 'last_connection' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 924
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 926
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 926
PHP Notice: Trying to get property 'local_ip' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 926
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 927
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 927
PHP Notice: Trying to get property 'mac_address' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 927
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 443
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 443
PHP Notice: Trying to get property 'leaf_threshold_cool' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 443
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 444
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 444
PHP Notice: Trying to get property 'leaf_threshold_heat' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 444
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 444
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 444
PHP Notice: Trying to get property 'leaf_threshold_heat' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 444
PHP Notice: Undefined offset: 0 in /home/homeassistant/.homeassistant/nest.class.php on line 895
PHP Notice: Undefined offset: 0 in /home/homeassistant/.homeassistant/nest.class.php on line 895
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 851
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 851
PHP Notice: Trying to get property 'temperature_scale' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 851
PHP Notice: Undefined property: stdClass::$device in /home/homeassistant/.homeassistant/nest.class.php on line 447
PHP Notice: Trying to get property '' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 447
PHP Notice: Trying to get property 'has_humidifier' of non-object in /home/homeassistant/.homeassistant/nest.class.php on line 447
PHP Notice: Undefined property: stdClass::$humidity in /home/homeassistant/.homeassistant/update_nest_target_humidity.php on line 16
PHP Fatal error: Uncaught Exception: Missing input for outside temperature in /home/homeassistant/.homeassistant/update_nest_target_humidity.php:24
Stack trace:
#0 {main}
thrown in /home/homeassistant/.homeassistant/update_nest_target_humidity.php on line 24