VSCode Mode Error

When I add mode: restart to my trigger it says “Property mode is not allowed”. My YAML looks like this:

- alias: Downstairs Bathroom Light On With Motion 
  initial_state: true
  trigger:
    platform: state
    entity_id: binary_sensor.downstairs_bathroom_light_motion_sensor
    to: 'on'
  mode: restart
  action:
    - service: switch.turn_on
      entity_id: switch.downstairs_bathroom_light

The HA docs show this so I think I have it correct:

automation:
  - trigger:
      - ...
    mode: queued
    max: 25
    action:
      - ...

Does this only work through the Automations Editor or am I just overlooking something? Currently on Home Assistant 0.113.1

I copy-pasted your automation into my test system, running 0.113.1, and it passed Configuration Check with no errors.


EDIT
Can you post the full text of the message or is “Property mode is not allowed” all of it?

what HA version are you on? as @123 eluded, this only works in 0.113+

He did say:

But it would be worth checking on the configuration / info page in case the update rolled back silently.

Interesting. That error comes up in VSCode before I save the change so I never got to the check config part. I just figured there was a legitimate issue so never moved past that.

The Home assistant VSCode extension has not been updated for these new features yet. Your code is valid.

Other things the addon does not yet recognise:

The new “not” condition.

http external_url or internal_url

Good to know. Thanks.

When reporting error messages, it’s helpful to indicate where they were seen.

FWIW, version 1.81 of the Home Assistant Config Helper was (very) recently released and it no longer carps about the mode option:

Screenshot from 2020-07-28 11-49-08

1 Like

And the VSCode addon for HassOS has just been updated too.

Can you please edit the post title so as not to ‘mislead’ other people and also mark it as solved, don’t care who by but Tom pointed out why.

Title changed.

1 Like

Thanks Tom.