HADashboard and post_service_active or post_service_inactive

Hello,

I’m creating a HADashboard for controlling my Dyson Pure Cool devices. I’m running into a bit of trouble and I’m not sure what I’m doing wrong. Everything is working except for turning on/office oscillating. I would love some input.

Also, Where can I found documentation on post_service_active/post_service_inactive? I don’t fully understand how you should use them, etc.

Here is my code in HADashboard:

dyson_fan_oscillate:
  widget_type: switch
  entity: fan.office_dyson
  title: Fan Oscillate
  icon_on: mdi-rotate-3d-variant
  icon_off: mdi-rotate-3d-variant
  post_service_active:
    service: fan/oscillate
    entity_id: fan.office_dyson
    oscillating: True
  post_service_inactive:
    service: fan/oscillate
    entity_id: fan.office_dyson
    oscillating: False

In case anyone is interested, Rene and Lyra over on the appdaemon discord channel helped me figure this out:

dyson_fan_oscillate:
  widget_type: switch
  entity: fan.office_dyson
  title: Fan Oscillate
  icon_on: mdi-rotate-3d-variant
  icon_off: mdi-rotate-3d-variant
  post_service_active:
    service: fan/oscillate
    entity_id: fan.office_dyson
    oscillating: "True"
  post_service_inactive:
    service: fan/oscillate
    entity_id: fan.office_dyson
    oscillating: "False"

However, the issue here is that the state of the device wont be retained. The correct way is to use a switch template with HA to call fan.oscillate service and then call the switch template from the dashboard.

Thanks again Rene and Lyra