Hikvision Player is a Home Assistant custom media_player platform that plays Home Assistant media through a Hikvision device's ISAPI two-way audio backchannel.
It is intended for Hikvision door stations, intercoms, and cameras that expose:
/ISAPI/System/TwoWayAudio/channels
The integration creates a Home Assistant media player entity. Calling media_player.play_media on that entity decodes the selected audio, converts it to the G.711 codec expected by the Hikvision device, opens the ISAPI talkback channel, streams the audio in real time, and closes the channel again.
Some Hikvision devices have a usable built-in speaker, but Home Assistant's camera and event integrations usually focus on video, motion, sensors, relays, and snapshots. They do not provide a simple media player target for announcements, chimes, gate messages, or local audio files.
This component was developed to fill that gap:
- Use a Hikvision intercom or camera speaker as a Home Assistant announcement target.
- Play short local media files without a separate speaker near the door or gate.
- Reuse Home Assistant media sources and automations.
- Avoid requiring the Hikvision mobile app for simple one-way playback.
It is not a full intercom, SIP, camera, or event integration. It only handles one-way playback from Home Assistant to a Hikvision ISAPI two-way audio channel.
- Creates
media_playerentities for Hikvision ISAPI talkback endpoints. - Supports Home Assistant media browser/media source IDs.
- Supports
/local/...files from Home Assistant'swwwdirectory. - Supports HTTP/HTTPS media URLs reachable by Home Assistant.
- Converts supported input audio to 8 kHz mono G.711 u-law or A-law.
- Uses HTTP Digest authentication for Hikvision ISAPI.
- Opens and closes the talkback channel for each playback.
- Provides a YAML reload service:
hikvision_player.reload.
- A Hikvision device with ISAPI two-way audio enabled.
- A user account with permission to use ISAPI/two-way audio.
- Home Assistant running this custom component.
- Network access from Home Assistant to the Hikvision device.
- Audio files small enough for Home Assistant to download/decode. The integration currently limits downloaded media to 20 MB.
The device must report one of these audio codecs:
G.711ulawG.711alaw
- Open HACS.
- Add this repository as a custom repository.
- Select category
Integration. - Install
Hikvision Player. - Restart Home Assistant.
Copy this directory:
custom_components/hikvision_player
into your Home Assistant config directory:
<config>/custom_components/hikvision_player
Restart Home Assistant.
This integration is currently configured with YAML.
Add one or more players under media_player::
media_player:
- platform: hikvision_player
name: Front gate
host: 192.168.1.12
port: 80
username: admin
password: !secret hikvision_isapi_password
unique_id: hikvision_player_front_gate
- platform: hikvision_player
name: Front door
host: 192.168.1.13
username: admin
password: !secret hikvision_isapi_password
unique_id: hikvision_player_front_doorport defaults to 80 when omitted.
unique_id is optional but recommended. It keeps entity IDs stable if the device name or host changes later.
After editing YAML, either restart Home Assistant or call:
service: hikvision_player.reloadPlace a file here:
/config/www/audio/front_gate_chime.mp3
Call:
service: media_player.play_media
target:
entity_id: media_player.front_gate
data:
media_content_type: music
media_content_id: /local/audio/front_gate_chime.mp3You can use the media browser and choose the Hikvision Player entity as the playback target. The integration resolves Home Assistant media source IDs before streaming to the Hikvision device.
Example service call:
service: media_player.play_media
target:
entity_id: media_player.front_door
data:
media_content_type: music
media_content_id: media-source://media_source/local/doorbell/message.mp3Home Assistant downloads the media first, then streams it to the Hikvision device. The Hikvision device does not need direct internet access to the URL.
service: media_player.play_media
target:
entity_id: media_player.front_gate
data:
media_content_type: music
media_content_id: https://example.com/audio/delivery.mp3service: media_player.media_stop
target:
entity_id: media_player.front_gatealias: Front gate opening announcement
trigger:
- platform: state
entity_id: binary_sensor.front_gate_opening
to: "on"
action:
- service: media_player.play_media
target:
entity_id: media_player.front_gate
data:
media_content_type: music
media_content_id: /local/audio/gate_opening.mp3alias: Doorbell chime through Hikvision speaker
trigger:
- platform: state
entity_id: binary_sensor.front_door_button
to: "on"
action:
- service: media_player.play_media
target:
entity_id: media_player.front_door
data:
media_content_type: music
media_content_id: /local/audio/door_chime.wavThis integration does not generate TTS by itself. A common pattern is to generate or store short announcement files elsewhere, then play the resulting local file or URL through media_player.play_media.
- Home Assistant calls
media_player.play_media. - The integration resolves media source IDs,
/local/...paths, or remote URLs. - Audio is decoded with
miniaudio. - The audio is converted to mono 8 kHz G.711 u-law or A-law, depending on what the Hikvision device reports.
- The integration opens the ISAPI two-way audio channel.
- The G.711 bytes are streamed to
/ISAPI/System/TwoWayAudio/channels/{id}/audioDataat real-time speed. - The channel is closed after playback.
- Confirm ISAPI is enabled on the Hikvision device.
- Confirm the account has two-way audio/talkback permission.
- Confirm Home Assistant can reach the device on the configured host and port.
- Check Home Assistant logs for
hikvision_player.
The integration currently supports only G.711ulaw and G.711alaw. If your device reports another codec, open an issue with the XML returned by:
http://<device>/ISAPI/System/TwoWayAudio/channels
Remove passwords and private addresses before posting logs or XML.
Remote media downloads are limited to 20 MB. Use short announcement files where possible.
The current implementation uses raw HTTP sockets to the Hikvision ISAPI port and is designed for local-network HTTP access. HTTPS support is not implemented.
- Store passwords in
secrets.yaml. - Use a dedicated Hikvision user with only the permissions required for two-way audio when possible.
- Keep this on a trusted local network.
- Do not publish logs containing camera passwords, private URLs, or internal network details.
This is a small, purpose-built integration maintained on a best-effort basis. Issues and pull requests are welcome, especially with:
- Hikvision model number and firmware version.
- Home Assistant version.
- Sanitized ISAPI responses.
- Logs showing the exact failure.