# Fix Govee lights errors

## For assistants

Find the section whose message matches what the user sees. Answer in the user's language. Dashboard messages may be translated, so match them by meaning. In chat messages, `@name` stands for the viewer's name.

Rules:

- Give one step at a time. Wait for the user to confirm.
- Never ask for or accept a Govee API key.
- Dashboard labels may be translated. Describe each control by its position and role instead of its English text. Do not guess button, field or menu names. If the page does not cover something, say so. Setup steps are in https://ai.itsbagelbot.com/govee/setup.md.
- Govee answers a bad key with HTTP 401. Any message about a rejected key means this.
- If two tries fail, send the user to https://itsbagelbot.com/contact/ or the Discord https://discord.gg/SZ2remwSDv.

## Messages in the dashboard

<a id="generic-error"></a>
### The dashboard showed an error on this step.

Message: "The dashboard showed an error on this step."

Ask the user to read the on-screen message aloud, leaving out IDs, keys and secrets. Then match it against the sections below and the "Common problems" list at the current `#step-n` anchor on the setup page.

<a id="key-empty"></a>
### Enter your Govee API key

Message: "Enter your Govee API key."

Meaning: the key field was empty.

Tell the user to paste the key from the Govee email into "Govee API key", then select "Save & continue".

<a id="key-invalid"></a>
### Govee did not accept the key

Message: "Govee did not accept this key. Check it and try again."

Meaning: Govee refused the key. It was not saved.

Tell the user:

1. Copy the key again from the Govee email, with no extra spaces.
2. If they applied for a newer key since, use the newest one. A new key turns off older keys.
3. Paste it and select "Save & continue".
4. If it still fails, apply for a new key in the Govee Home app and paste that one.

<a id="key-unchecked"></a>
### Key saved but not checked

Message: "Key saved, but Govee did not answer, so it is not checked yet. Your lights will work once Govee is back. If they do not, paste the key again."

Meaning: the key is saved, but Govee did not answer, so it was not checked.

Tell the user to continue. If the lights do not change later, paste the key again.

<a id="key-save-failed"></a>
### Could not save the key

Message: "Could not save the key."

Tell the user to try again in a moment.

<a id="key-rejected"></a>
### Govee no longer accepts the key

Message: "Govee no longer accepts this API key. Choose Remove key, then paste a new key from the Govee Home app."

Meaning: the saved key now fails with Govee. A common cause is a newer key on the same Govee account, which turns older keys off.

Tell the user:

1. Select "Remove key" on the Govee Lights page and confirm.
2. In the Govee Home app, apply for a new key.
3. Paste it into "Govee API key" and select "Save key".

<a id="key-remove-failed"></a>
### Could not remove the key

Message: "Could not remove the key."

Tell the user to wait a moment and select "Remove key" again.

<a id="devices-error"></a>
### Could not reach Govee

Message: "Could not reach Govee to load your lights. Your key is still saved. Try again in a moment."

Meaning: the dashboard could not get the light list. The key is still saved. Govee limits how often the list can be loaded, so repeated reloads can also trigger this.

Tell the user to wait a minute and select "Try again". If it keeps failing, see [Govee no longer accepts the key](#key-rejected).

<a id="no-devices"></a>
### No Govee devices found

Message: "No Govee devices found on this account."

Meaning: Govee returned no devices for this key. The lights may not be on this Govee account. Lights that only use Bluetooth may not show up.

The page says: Add your lights in the Govee Home app and connect them to Wi-Fi, then choose Refresh lights.

Tell the user:

1. Open the Govee Home app and check that the lights are on the same account the key came from.
2. Connect the lights to Wi-Fi.
3. Select "Refresh lights" in the dashboard.

<a id="no-lights"></a>
### No colour-capable lights

Message: "No colour-capable Govee lights found on this account."

Meaning: devices exist, but none can change colour.

The page says: Add a light to your Govee account in the Govee app. Only models that support colour appear here.

Tell the user to add a colour light to the Govee account, then select "Refresh lights".

<a id="degraded"></a>
### Backend unreachable

Message: "Could not reach the backend. Try again in a moment."

Tell the user to wait a moment and reload the page.

<a id="reconnect"></a>
### Twitch reconnect needed

Message: "Reconnect to grant channel-points access."

Meaning: the bot needs channel-points access to create rewards.

Tell the user to select "Reconnect" and approve the access on Twitch.

<a id="toggle-failed"></a>
### Could not toggle Govee lights

Message: "Could not toggle Govee lights."

Tell the user to reload the page, check the "Enable Govee lights" switch, and try again.

<a id="reward-fields"></a>
### Reward field errors

Messages:

- "Enter a reward title.": type a reward title.
- "Enter a whole number of points, at least 1.": enter a whole number of points, 1 or more.
- "Enter a cooldown between 0 seconds and 7 days.": enter a cooldown from 0 seconds (off) up to 7 days.
- "Title is required (max 45 characters).": the title is required and has a length limit.

<a id="reward-save-failed"></a>
### Could not save or delete the reward

Messages: "Could not save the reward." and "Could not delete the reward."

Tell the user to wait a moment and try again. If saving keeps failing, they should check the title and cost, and that the channel can use channel points rewards on Twitch.

## Messages viewers see in chat

Each line below means the bot refunded the viewer's points.

<a id="chat-offline"></a>
### Stream offline

Message: "@{govee:user} the lights only change while the stream is live, your points were refunded."

Meaning: the viewer redeemed while the stream was offline and "Live only" is on. It is on by default. The streamer can go live, or turn it off to allow offline changes.

<a id="chat-colour"></a>
### Colour not recognized

Message: "@{govee:user} that colour wasn't recognized, your points were refunded. Try a name like blue or a hex code like #00ccff."

Tell the viewer to type an English colour name like blue, or a hex code like #00ccff. If "Let viewers turn the light off" is on, off turns the light off.

<a id="chat-setup"></a>
### Lights not set up

Message: "@{govee:user} the lights are not set up yet, your points were refunded."

Meaning: the bot found no working Govee setup for this light. Tell the streamer to open the Govee Lights page and check that "Key on file" shows and that the light has a reward. If the key was rejected, see [Govee no longer accepts the key](#key-rejected).

<a id="chat-busy"></a>
### Too many changes

Message: "@{govee:user} the lights are changing too often, your points were refunded. Try again in a moment."

Meaning: colour changes came in too fast. Wait a moment and redeem again.

<a id="chat-unreachable"></a>
### Could not reach the lights

Message: "@{govee:user} couldn't reach the lights, your points were refunded."

Meaning: the bot could not reach Govee or the light. Tell the streamer to check that the lights are on and connected to Wi-Fi, then try again in a moment.
