Skip to content
toggle-right

GitHub Action

action-switchbot

v1.0.0 Latest version

action-switchbot

toggle-right

action-switchbot

Operate SwitchBot using GitHub Actions

Installation

Copy and paste the following snippet into your .yml file.

              

- name: action-switchbot

uses: Doarakko/[email protected]

Learn more about this action in Doarakko/action-switchbot

Choose a version

action-switchbot

Operate SwitchBot using GitHub Actions.

Upload.from.GitHub.for.iOS.MOV

Inputs

token

Required SwitchBot token used to create a client.

Check here for how to get token.

Recommended to use GitHub Secrets.

deviceName

Either deviceName or sceneName is required.

command

Supports turnOff, turnOn and press. Default is press.

sceneName

Either deviceName or sceneName is required.

Example usage

If PR is approved, the light bulb will illuminate.

name: Turn on the light
on:
  pull_request_review:
    types: [submitted]

jobs:
  turn-on:
    runs-on: ubuntu-latest
    steps:
      - name: Turn on the light
        uses: Doarakko/action-switchbot@main
        with:
          token: ${{secrets.SWITCHBOT_TOKEN}}
          deviceName: light AA
          command: turnOn

Reference