Script help with condition

This seems like it should work, but I get an error. Any suggestions as to where I’m going wrong.

ecobee_home_mode:
  alias: "Ecobee Home Mode"
  sequence:
    - condition: template
      value_template: "{{ states.climate.downstairs.attributes.climate_mode =! 'Home' }}"
    - service: climate.set_hold_mode
      entity_id:
       - climate.downstairs
       - climate.upstairs
      data:
        hold_mode: 'home'

I get this error
2018-08-16 17:41:50 ERROR (MainThread) [homeassistant.config] Invalid config for [script]: [condition] is an invalid option for [script]. Check: script->script->ecobee_home_mode->sequence->0->condition. (See /home/homeassistant/.homeassistant/configuration.yaml, line 288). Please check the docs at https://home-assistant.io/components/script/

Assuming your entity id and state is correct, try ā€œ!=ā€ instead of ā€œ=!ā€.

1 Like

Yup, thanks!!