Skip to content

Doarakko/action-switchbot

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

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