Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95468

I need help with this Nest Script Please

$
0
0

@Matt112 wrote:

I have been using this script for months but something in the updates to HA isn’t playing nice with it and I can’t figure it out. Any help would be appreciated.

script:
  nest_eco_on:
    alias: Nest Thermostat - Set to ECO mode
    sequence:
      # Only turn on ECO mode if thermostat is not off and not already in ECO
      # mode.
      - condition: template
        value_template: >
          {{ states('sensor.kitchen_thermostat_hvac_mode')
             not in ['off', 'eco'] }}
      # Save current operation mode.
      - service: input_text.set_value
        entity_id: input_text.previous_hvac_mode
        data_template:
          value: "{{ states('sensor.kitchen_thermostat_hvac_mode') }}"
      # Turn on ECO mode.
      - service: climate.set_preset_mode
        entity_id: climate.kitchen
        data:
          preset_mode: eco

  nest_eco_off:
    alias: Nest Thermostat - Return from ECO mode
    sequence:
      # Only set back to previous mode if thermostat is still in ECO mode.
      - condition: template
        value_template: >
          {{ is_state('sensor.kitchen_thermostat_hvac_mode', 'eco') }}
      # Restore previous operation mode.
      - service: climate.set_hvac_mode
        entity_id: climate.kitchen
        data_template:
          hvac_mode: "{{ states('input_text.previous_hvac_mode') }}"

This is the error I am seeing in the logs.

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/core.py”, line 1240, in _safe_execute
await self._execute_service(handler, service_call)
File “/usr/src/homeassistant/homeassistant/core.py”, line 1255, in _execute_service
await handler.func(service_call)
File “/usr/src/homeassistant/homeassistant/components/script/ init .py”, line 207, in service_handler
await script.async_turn_on(variables=service.data, context=service.context)
File “/usr/src/homeassistant/homeassistant/components/script/ init .py”, line 284, in async_turn_on
await self.script.async_run(kwargs.get(ATTR_VARIABLES), context)
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 802, in async_run
await run.async_run()
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 523, in async_run
await self._async_run()
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 540, in _async_run
await self._async_step(log_exceptions=not propagate_exceptions)
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 154, in _async_step
self, f" async {cv.determine_script_action(self._action)}_step"
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 624, in _async_call_service_step
*self._prep_call_service_step(), blocking=True, context=self._context
File “/usr/src/homeassistant/homeassistant/core.py”, line 1210, in async_call
processed_data = handler.schema(service_data)
File “/usr/local/lib/python3.7/site-packages/voluptuous/validators.py”, line 208, in call
return self._exec((Schema(val) for val in self.validators), v)
File “/usr/local/lib/python3.7/site-packages/voluptuous/validators.py”, line 287, in _exec
raise e if self.msg is None else AllInvalid(self.msg, path=path)
File “/usr/local/lib/python3.7/site-packages/voluptuous/validators.py”, line 283, in _exec
v = func(v)
File “/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py”, line 272, in call
return self._compiled([], data)
File “/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py”, line 817, in validate_callable
return schema(data)
File “/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py”, line 272, in call
return self._compiled([], data)
File “/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py”, line 594, in validate_dict
return base_validate(path, iteritems(data), out)
File “/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py”, line 432, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: value is not allowed for dictionary value @ data[‘hvac_mode’]

Posts: 7

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95468

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>