Rest switches use in automation?

Hello guys!

I have this in configuration.yaml file. It is a REST integration with Broadlink S3 Hub. Everything seems to be working fine, HOWEVER, I can’t seem to use them in the current way in automations.
Can you tell me how can I change the configuration so they can appear in the automations. Basically, I want to be able to switch them on or off depending on motion event, door open, etc.

This is my configuration:

switch:
    - platform: rest
      name: Hall lights
      resource: http://192.168.0.80:5000/00000000000000000000a043b0388e4b/1
      body_on: '{"active": "true"}'
      body_off: '{"active": "false"}'
      is_on_template: "{{ value_json.is_active }}"
      scan_interval: 5
    - platform: rest
      name: Hall RGB strip
      resource: http://192.168.0.80:5000/00000000000000000000a043b038849a/1
      body_on: '{"active": "true"}'
      body_off: '{"active": "false"}'
      is_on_template: "{{ value_json.is_active }}"
    - platform: rest
      name: Bathroom lights
      resource: http://192.168.0.80:5000/00000000000000000000a043b038d063/1
      body_on: '{"active": "true"}'
      body_off: '{"active": "false"}'
      is_on_template: "{{ value_json.is_active }}"
    - platform: rest
      name: Bathroom fan
      resource: http://192.168.0.80:5000/00000000000000000000a043b038d063/2
      body_on: '{"active": "true"}'
      body_off: '{"active": "false"}'
      is_on_template: "{{ value_json.is_active }}"
    - platform: rest
      name: Laundry lights
      resource: http://192.168.0.80:5000/00000000000000000000a043b038c19d/1
      body_on: '{"active": "true"}'
      body_off: '{"active": "false"}'
      is_on_template: "{{ value_json.is_active }}"
    - platform: rest
      name: Laundry fan
      resource: http://192.168.0.80:5000/00000000000000000000a043b038c19d/2
      body_on: '{"active": "true"}'
      body_off: '{"active": "false"}'
      is_on_template: "{{ value_json.is_active }}"
    - platform: rest
      name: Bedroom lights
      resource: http://192.168.0.80:5100/00000000000000000000a043b084adb1/1
      body_on: '{"active": "true"}'
      body_off: '{"active": "false"}'
      is_on_template: "{{ value_json.is_active }}"
    - platform: rest
      name: Office lights
      resource: http://192.168.0.80:5100/00000000000000000000a043b0388859/1
      body_on: '{"active": "true"}'
      body_off: '{"active": "false"}'
      is_on_template: "{{ value_json.is_active }}"
    - platform: rest
      name: Wardrobe lights
      resource: http://192.168.0.80:5100/00000000000000000000a043b03886da/1
      body_on: '{"active": "true"}'
      body_off: '{"active": "false"}'
      is_on_template: "{{ value_json.is_active }}"

Looking forward to your replies

I assume you are trying to use device automations?

Use service calls instead. e.g. service: switch_turn_off

Can you give me some details how I can turn it into a service?

I think I got it,

Looks like this for my case:

turn_hall_light_on:
  url: http://192.168.0.80:5000/00000000000000000000a043b0388e4b/1
  method: POST
  payload: '{"active": "true"}'

Hi! I am trying to use my broad link s3 hub with home assistant and I have a 4 button broad link sub device and I don’t know how to integrate it with home assistant. could you help me? sorry for my English.