Govee Appliance Power State Control

A simple blueprint to control a Govee Appliance’s power state (on/off)

FIRST, Add this to your configuration.yaml file, making sure to supply the correct API Key:

rest_command:
  govee_heater_powerstate:
    url: https://openapi.api.govee.com/router/api/v1/device/control
    method: POST
    headers:
      Content-Type: application/json
      Govee-API-Key: your-api-key
    content_type: "application/json; charset=utf-8"
    payload: >-
      {
        "requestId": "uuid",
        "payload": {
          "sku": "{{ model }}",
          "device": "{{ device }}",
          "capability": {
            "type": "devices.capabilities.on_off",
            "instance": "powerSwitch",
            "value": {{ onoff }}
          }
        }
      }

Then, use this blueprint:
(For the device ID, you’ll have to get that from this page on Govee’s website.
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

blueprint:
  name: Govee Appliance Power State Control
  description: Controls Govee Appliances through the developer API
  domain: script
  input:
    model:
      name: Device Model
      description: This is the model of the device that you want to control.
      selector:
        text:
    device:
      name: Device ID
      description: This is the device ID of the device that you want to control.
      selector:
        text:
    onoffboolean:
      name: Desired Power State
      description: Choose whether you want the device to turn on or off.
      selector:
        boolean:
sequence:
  - variables:
      onoffboolean: !input "onoffboolean"
  - service: rest_command.govee_heater_powerstate
    data:
      onoff: >-
        {% if onoffboolean == true %}
          1
        {% else %}
          0
        {% endif %}
      device: !input device
      model: !input model