DeepSeek smart home integration, free and open source

Run the Gladys assistant on DeepSeek V4: low-cost models and web search, with your API key.
Overview
This integration runs the assistant of Gladys on DeepSeek, which serves its own V4 models through an official API at a very low price. Once you choose it in Settings → Artificial Intelligence, every AI request of Gladys goes to DeepSeek: the chat and the devices it controls, the scenes it creates, the "ask the AI" scene action and the weekly digest. It works with your own DeepSeek key, with or without a Gladys Plus account.
It also adds a scene action that asks a question with web search, a scene action that reads the balance of the account, three scene triggers (the assistant fails, answers again, the balance runs low) and a dashboard widget with the balance, the estimated cost of the day and of the month, the requests and the tokens.
Not affiliated with DeepSeek. Not tested with a real DeepSeek key yet: feedback welcome.
Prerequisites
- Gladys Assistant 5.3.0 or later.
- A DeepSeek platform account and an API key: platform.deepseek.com/api_keys → Create new API key.
- A topped-up balance: DeepSeek is prepaid (platform.deepseek.com/top_up). Each answer is taken from the balance; when it is spent, the assistant stops (error 402) until the next top-up.
- Prices (per million tokens, peak hours): V4.1 Flash $0.30 for input, $0.006 for input already in the context cache, $1.20 for output; V4 Pro three to four times more. Outside 01:00–04:00 and 06:00–10:00 UTC on weekdays, everything is half price (weekends and Chinese public holidays included). The reasoning counts as output. A household spends a fraction of a cent to a few cents a day.
- What leaves your home: every chat message, the history, the tools Gladys offers and their results (the state of the devices the assistant reads) and the chat images go to DeepSeek over HTTPS. DeepSeek is a company based in Hangzhou, China: its privacy policy says the data is stored in the People's Republic of China and may be used to improve its models. The answers control your devices and create scenes.
Configuration
| Field or button | Default | Meaning |
|---|---|---|
| DeepSeek API key | — | Required (it starts with sk-). Never shown again, never logged |
| Chat model | DeepSeek V4.1 Flash | Answers the chat, creates scenes, writes the weekly digest |
| Router model | DeepSeek V4.1 Flash | Sorts every message before the answer, always without thinking, within 20 seconds |
| Other model id | — | Only when a model is set to "Other model": the exact id from the DeepSeek docs |
| Reasoning of the chat model | Low | Off, low, high or maximum: more reasoning, better scenes, slower and costlier answers |
| Maximum answer length (tokens) | 8192 | Reasoning included |
| Low balance alert | 1 | The "balance is running low" trigger fires below this amount (account currency), 0: off |
| Test the connection | — | One short answer from each model with its time, then the balance of the account |
The status of the configuration screen says whether DeepSeek accepts the key and whether the balance can still pay, without spending anything.
Usage
- Integrations → DeepSeek → Configuration: paste the API key, keep the default models, press Test the connection.
- Settings → Artificial Intelligence: choose DeepSeek.
- Talk to Gladys in the chat: "turn on the living room", "what is the temperature in the bedroom?", "create a scene that closes the shutters at sunset".
Choosing the models
- DeepSeek V4.1 Flash (default): fast and cheap, reliable with tools, reads the images of the chat.
deepseek-flashalways points to the latest Flash version. - DeepSeek V4 Pro: the larger model, for complex scenes; three to four times the price, reads no image.
- Other model: any id from the DeepSeek docs, for example a successor. Its cost is not estimated.
The thinking mode (reasoning) gives better scenes. With tools, DeepSeek needs the reasoning of every earlier answer of the conversation: the integration keeps it in memory. After a restart of the integration, an ongoing conversation goes on without thinking (a new one thinks again). The router never thinks.
Dashboard widget
The DeepSeek usage widget shows the balance of the account (read from DeepSeek every 30 minutes and after the requests), the estimated cost of the day and of the month, the requests and errors of the day, the tokens per day over 30 days, whether DeepSeek answers, the models, the current price (peak or off-peak, until when), the last request and the last error. The costs are estimated by the integration from the published prices: the balance stays the reference (Chinese public holidays, which are off-peak, are counted at the peak price).

Scenes
- Action "DeepSeek: ask with web search": DeepSeek searches the web with its own search engine and answers in a few sentences. Fields: the question (scene variables allowed), extra instructions, deep search (the model thinks, searches several times and opens pages: slower, more tokens). Outputs: the answer and the sources, one per line. The search is free; the pages read count as input tokens. Always V4.1 Flash, the only model with the web tools.
- Action "DeepSeek: read the balance": outputs the balance, its currency and whether it is enough to answer. Free.
- Trigger "DeepSeek: the assistant fails": once per failure (key refused, balance spent, service busy, model unavailable, API unreachable, too slow, DeepSeek error), with the kind, the message, the request and the model.
- Trigger "DeepSeek: the assistant answers again": the first answer after a failure, with the minutes of failure.
- Trigger "DeepSeek: the balance is running low": when the balance falls below the alert amount, with the balance, the currency and the amount. Once, then again only after a top-up (and once more after a restart if still below).
Examples: every morning, ask with web search for the news of the day and send the answer by Telegram; when the balance is running low, send a message to the administrator; every Monday, read the balance and send it by e-mail.
Troubleshooting
- "DeepSeek refused the API key": copy the key again from platform.deepseek.com/api_keys; a deleted key gives the same message.
- "The balance of the DeepSeek account is spent": top it up on platform.deepseek.com/top_up. The assistant answers again at the next message.
- "DeepSeek is busy": too many concurrent requests or an overloaded service; the integration already retries a few times. Try again in a moment.
- "DeepSeek does not know the model": the model id is wrong or retired; choose a model of the list.
- "cannot read images": choose DeepSeek V4.1 Flash as the chat model.
- "The answer was cut at max_tokens": raise the maximum answer length.
- "The content review of DeepSeek refused the answer": DeepSeek filters some subjects; rephrase.
- Logs: Settings → Supervision, the logs of the integration. Never share your API key.
Configuration settings
These are the settings DeepSeek asks for in its configuration screen in Gladys.
| Setting | Type | Required | Description |
|---|---|---|---|
| Getting started | section | No | DeepSeek runs its own V4 models at a very low price. Create an account and a key on platform.deepseek.com, top up the balance (prepaid), paste the key below, then select this integration in Settings, Artificial Intelligence. DeepSeek, a company based in China, then receives every chat message, the history, the state of the devices the assistant reads and the chat images; its privacy policy says the data is stored in the People’s Republic of China and may be used to improve its models. |
| Prices and balance | section | No | DeepSeek is prepaid: each answer is taken from the balance, and the assistant stops when it is spent (top-ups on platform.deepseek.com/top_up). V4.1 Flash costs 0.30 dollar per million input tokens and 1.20 per million output tokens, fifty times less for input already in the context cache; V4 Pro costs three to four times more. Outside 01:00–04:00 and 06:00–10:00 UTC on weekdays, everything is half price. A household spends a few cents a day. |
| DeepSeek API key | secret | Yes | Created on platform.deepseek.com/api_keys (it starts with sk-). It stays in Gladys and is never shown again nor logged. |
| Chat model | select | Yes | Answers the chat, creates the scenes and writes the weekly digest. V4.1 Flash is fast, cheap and reads the images of the chat; V4 Pro is the larger model, three to four times the price, and reads no images. |
| Router model | select | Yes | Sorts every chat message before the answer, always without thinking, and must reply within 20 seconds: V4.1 Flash is the right choice. |
| Other model id | string | No | Only for “Other model”: the exact id from the DeepSeek docs (Models & Pricing), such as a newer model. Its cost is then not estimated. |
| Reasoning of the chat model | select | Yes | The thinking mode gives better scenes but slower answers that use more tokens. The router never thinks. |
| Maximum answer length (tokens) | number | No | The reasoning counts in it too. Raise it if the logs say an answer hit max_tokens. |
| Low balance alert | number | No | The “balance is running low” scene trigger fires when the balance falls below this amount, in the currency of the account (0 turns it off). |
How to install DeepSeek in Gladys
- In Gladys, open Integrations: DeepSeek appears in the catalog, next to the native integrations, with a community badge.
- Click Install. Gladys pulls the Docker image (
ghcr.io/william-de71/gladys-deepseek:0.1.0), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration). - Open the Configuration screen of the integration, fill in the settings, and save.
- You can also install it directly from its repository URL: https://github.com/William-De71/gladys-deepseek.
DeepSeek requires Gladys >=5.3.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.
Not running Gladys yet? It is free and open source: follow the installation guide to get started.
About external integrations
DeepSeek is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by William-De71, not by the Gladys core team.
- Browse all integrations, native and community
- Build and publish your own external integration
- Source code on GitHub — source of this documentation