Dyson Automation

Having some issues while automating some functions on my dyson:

here’s my simple automation script:

  alias: Turn on Living Room Fan when above 25C
  trigger:
  - above: '25'
    entity_id: sensor.living_room_temperature
    platform: numeric_state
  condition:
  - condition: state
    entity_id: fan.living_room
    state: 'off'
  action:
  - service: fan.turn_on
  - data:
      speed: '9'
    service: fan.set_speed
  - data:
      oscillate: true
    service: fan.oscillate

The automation works fine, however I am struggling to set the oscillation to true, see the error below:

2019-08-26 11:13:50 ERROR (MainThread) [homeassistant.components.automation] Error while executing automation automation.turn_on_living_room_fan_when_above_25c. Invalid data for call_service at pos 3: extra keys not allowed @ data['oscillate']

Any advice?
Thanks,
Davide

There is no ‘oscillate’ attribute for the dyson fan: https://www.home-assistant.io/components/dyson/#attributes

@tom_l odd as I can enable/disable the oscillation on the fan, see below:

Any advice?

Maybe this climate service? https://www.home-assistant.io/components/climate/#service-climateset_swing_mode

To Add, see the reference on the Dyson repo

It seems the oscillating functionality is supported.

from homeassistant.components.fan import (
    **SUPPORT_OSCILLATE,**
    SUPPORT_SET_SPEED,
    FanEntity,
    SPEED_LOW,
    SPEED_MEDIUM,
    SPEED_HIGH,
)

Yeah but there does not seem to be a service to set the oscillate mode in the fan integration.

EDIT: Or maybe there is.

Try this:

  - service: fan.oscillate
    data:
      entity_id: fan.living_room
      oscillating: 'true'

It seems to be a parameter

See my edited post above.

All of your actions are missing the entity id for the service to act on.

  action:
  - service: fan.turn_on
    entity_id: fan.living_room

  - service: fan.set_speed
    data:
      entity_id: fan.living_room
      speed: '9'

  - service: fan.oscillate
    data:
      entity_id: fan.living_room
      oscillate: true

Same issue as per my in itial post :frowning:
Code:

- id: '1566822854112'
  alias: Turn on Living Room Fan when above 25C
  trigger:
  - above: '25'
    entity_id: sensor.living_room_temperature
    platform: numeric_state
  condition:
  - condition: state
    entity_id: fan.living_room
    state: 'off'
  action:
  - service: fan.turn_on
    entity_id: fan.living_room
  - service: fan.set_speed
    data:
      entity_id: fan.living_room
      speed: '9'
  - service: fan.oscillate
    data:
      entity_id: fan.living_room
      oscillate: true

Error:
2019-08-26 13:39:28 ERROR (MainThread) [homeassistant.components.automation] Error while executing automation automation.turn_on_living_room_fan_when_above_25c. Invalid data for call_service at pos 3: extra keys not allowed @ data['oscillate']

To add:
I’ve built the automation via the Automation Editor GUI.
Running on:

arch: armv7
channel: stable
hassos: "2.12"
homeassistant: 0.97.2
hostname: hassio
logging: info
machine: raspberrypi3
supervisor: "184"
supported_arch:
- armv7
- armhf
timezone: Europe/London

Thanks!

Try

oscillating: true

Oscillating definitely improved the situation (thanks @tom_l !) , however the fan dies right after being turned on.

Resolved as below, by adding a delay condition of 1 sec:

  alias: Turn on Living Room Fan when above 25C
  trigger:
  - above: '25'
    entity_id: sensor.living_room_temperature
    platform: numeric_state
  condition:
  - condition: state
    entity_id: fan.living_room
    state: 'off'
  action:
  - service: fan.turn_on
    entity_id: fan.living_room
  - service: fan.set_speed
    data:
      entity_id: fan.living_room
      speed: '9'
  - delay: '00:00:01'
  - service: fan.oscillate
    data:
      entity_id: fan.living_room
      oscillating: true

Damn warm nights in UK :fire:
Thanks @tom_l