A community Home Assistant integration that brings the DeepSeek API to your smart home — conversation agent plus a deepseek.generate service for automations. Not affiliated with DeepSeek.
- 🤖 Conversation Agent: Use DeepSeek as your Home Assistant voice/chat assistant
- 🔧 Config Flow: Easy UI-based setup - no YAML required
- 🎯 Multiple Models: Support for
deepseek-chat,deepseek-reasoner,deepseek-coder - 💭 Reasoning Support: Optional reasoning display with
deepseek-reasonermodel - 🌐 Multi-language: Support for all languages DeepSeek understands
- ⚡ Fast & Efficient: Async implementation with proper error handling
- 🔌 OpenAI-Compatible: Uses DeepSeek's OpenAI-compatible API
- Open HACS in Home Assistant
- Click "Integrations"
- Click the "+" button (Explore & Add Repositories)
- Search for "DeepSeek"
- Click "Install"
- Restart Home Assistant
- Copy the
custom_components/deepseekfolder to your Home Assistantcustom_componentsdirectory - Restart Home Assistant
- Go to Settings → Devices & Services → Add Integration
- Search for "DeepSeek"
- Visit DeepSeek Platform
- Sign up or log in
- Go to API Keys section
- Create a new API key
- Copy the key (you'll only see it once!)
- Add Integration: Go to Settings → Devices & Services → Add Integration → Search "DeepSeek"
- Enter API Key: Paste your DeepSeek API key
- Configure Options (optional):
- Model: Choose between
deepseek-chat,deepseek-reasoner, ordeepseek-coder - Max Tokens: Response length limit (default: 2048)
- Temperature: Creativity level (0.0-2.0, default: 0.7)
- Show Reasoning: Display reasoning steps (only for
deepseek-reasoner)
- Model: Choose between
- Complete: The integration is now ready!
Once installed, DeepSeek becomes available as a conversation agent:
- Voice Commands: "Hey Assistant, ask DeepSeek what's the weather forecast"
- Chat Interface: Use the chat feature in Home Assistant
- Automations: Trigger DeepSeek responses in automations
The integration registers a Home Assistant AI Task entity so it can be selected from the AI-Task picker in the visual automation editor and used with the standard ai_task.generate_data action. This is the recommended way to integrate DeepSeek into modern automations.
- action: ai_task.generate_data
data:
task_name: weather_summary
instructions: >-
Today's forecast: {{ states('weather.home') }},
high {{ state_attr('weather.home', 'temperature') }}°C.
Summarise it in one short sentence.
entity_id: ai_task.deepseek
response_variable: result
- action: notify.mobile_app
data:
message: "{{ result.data }}"Pass a structure: schema and the integration will set DeepSeek's response_format=json_object, so the model replies with parseable JSON, which the framework returns as a dict in result.data.
- action: ai_task.generate_data
data:
task_name: forecast_extract
instructions: >-
From this forecast — {{ states('weather.home') }} — produce
structured data.
entity_id: ai_task.deepseek
structure:
summary:
selector:
text:
high_c:
selector:
number:
rain_chance_percent:
selector:
number:
response_variable: result
- action: persistent_notification.create
data:
message: "{{ result.data.summary }} (rain {{ result.data.rain_chance_percent }}%)"If DeepSeek returns something that isn't valid JSON for a structured task, the automation step fails with a clear DeepSeek returned a non-JSON response for a structured task error rather than silently mis-parsing.
For one-off prompts or when you don't want a target entity, the deepseek.generate action is still available and unchanged. The AI Task entity above is the recommended path going forward.
Use DeepSeek as a building block in automations, scripts, and other integrations. The service takes a prompt and returns the model's reply, which you can capture into a variable with response_variable and use in subsequent steps.
| Field | Type | Required | Description |
|---|---|---|---|
prompt |
string | yes | The user message sent to the model. |
system_prompt |
string | no | Optional system instructions placed before the prompt. |
model |
string | no | Override the model configured for this entry (deepseek-v4-flash, etc.). |
max_tokens |
int | no | Maximum tokens to generate (1–8192). |
temperature |
float | no | Sampling temperature (0–2). |
top_p |
float | no | Nucleus sampling threshold (0–1). |
config_entry |
string | no | Specific DeepSeek entry to use, when more than one is configured. |
text: "The model's reply..."
model: "deepseek-v4-flash"
finish_reason: "stop"
usage:
prompt_tokens: 24
completion_tokens: 86
total_tokens: 110automation:
- alias: Morning weather summary
trigger:
- platform: time
at: "07:00:00"
action:
- service: deepseek.generate
data:
system_prompt: >-
You are a concise weather presenter. Reply in one short sentence.
prompt: >-
Today's forecast: {{ states('weather.home') }},
high {{ state_attr('weather.home', 'temperature') }}°C,
wind {{ state_attr('weather.home', 'wind_speed') }} km/h.
response_variable: weather_reply
- service: notify.mobile_app
data:
message: "{{ weather_reply.text }}"script:
living_room_status:
sequence:
- service: deepseek.generate
data:
model: deepseek-v4-pro
temperature: 0.3
prompt: >-
Lights: {{ states('light.living_room') }}.
Temperature: {{ states('sensor.living_room_temperature') }}°C.
Write a friendly one-line status update for the living room.
response_variable: status
- service: tts.cloud_say
data:
entity_id: media_player.living_room
message: "{{ status.text }}"You can also call the service directly from Developer Tools → Actions to test prompts and see the full response object.
deepseek-chat(Default)- DeepSeek-V3-class model in non-thinking mode — works cleanly with this integration's plain chat-completions API.
- Recommended for everyday conversations and Assist tool calling.
deepseek-reasoner- DeepSeek-R1-class model in non-thinking mode.
- Reasonable choice for harder questions where you want the larger model.
deepseek-v4-flash(advanced — opt-in, see caveat below)deepseek-v4-pro(advanced — opt-in, see caveat below)
Caveat for the
deepseek-v4-*models: these run in DeepSeek's thinking mode by default and stream areasoning_contentfield that must be re-fed on every follow-up turn. This integration does not yet round-trip that field, so multi-turn conversations with a v4 model fail with400 — reasoning_content in the thinking mode must be passed back to the API. Stick todeepseek-chat/deepseek-reasoneruntil v4 thinking-mode support lands.
- General use / Assist:
deepseek-chat - Complex reasoning:
deepseek-reasoner - Creative tasks: higher temperature (0.8–1.2)
- Precise / factual tasks: lower temperature (0.2–0.5)
- Ensure you copied the key correctly
- Check if the key has expired
- Verify you have API access on DeepSeek Platform
- Check your internet connection
- Verify DeepSeek API status at status.deepseek.com
- Ensure your firewall allows connections to
api.deepseek.com
- Check the logs for detailed errors
- Verify the model is available in your region
- Ensure you have sufficient API credits
Enable debug logging for detailed information:
logger:
default: info
logs:
custom_components.deepseek: debugcustom_components/deepseek/
├── __init__.py # Main integration setup
├── manifest.json # Integration metadata
├── config_flow.py # UI configuration
├── const.py # Constants
├── conversation.py # Conversation agent
├── strings.json # UI strings
├── translations/ # Translations
│ └── en.json
├── services.yaml # Service definitions
└── README.md # This file
# Run validation
hassfest validate
# Test with Home Assistant dev container
hass --script ensure_config- Fork the repository
- Create a feature branch
- Make your changes
- Run validation tests
- Submit a pull request
- API Keys: Stored securely in Home Assistant's config
- Data: Conversations are sent to DeepSeek's API
- No Local Storage: No conversation data is stored locally
- Rate Limiting: Built-in rate limit handling
Refer to DeepSeek's Privacy Policy for more information.
- GitHub Issues: Report bugs or request features
- Documentation: DeepSeek API Docs
- Community: Home Assistant Community
MIT License - see LICENSE file for details.
- Community-built integration, not affiliated with DeepSeek.
- Uses the OpenAI Python client against the DeepSeek-compatible API at
https://api.deepseek.com. - Thanks to all contributors and testers.
DeepSeek: Making AI accessible for everyone's smart home. 🏠✨