Custom Home Assistant integration for controlling JBL 4305P powered speakers via their local NSDK API.
- π΅ Input Switching: Select between Google Cast, Bluetooth, AirPlay, Spotify Connect, and other available inputs
- π Auto-Discovery: Automatically discovers available inputs and paired Bluetooth devices
- π Real-time Updates: Monitors current input and playback state
- βοΈ Configurable: Set custom update intervals and log levels
- π± Multiple Speakers: Support for multiple JBL 4305P speakers on your network
- Open HACS in Home Assistant
- Click on "Integrations"
- Click the three dots in the top right and select "Custom repositories"
- Add
https://github.com/mcinnes01/jbl-4305p-hassand select "Integration" as the category - Click "Install"
- Restart Home Assistant
When youβre ready to publish a new version:
- Update CHANGELOG.md with a new section:
## [0.1.2] - YYYY-MM-DD- Add bullet points of changes
- Run the workflow "Prepare Release" from the GitHub Actions tab
- Inputs: version (e.g., 0.1.2), optional notes (used if CHANGELOG section missing)
- The workflow will:
- Update
manifest.jsonversion - Commit and tag
v0.1.2 - Create the GitHub Release with notes
- Update
- HACS will detect the new release and show an update in Home Assistant
- Copy the
custom_components/jbl_4305pfolder to your Home Assistantconfig/custom_components/directory - Restart Home Assistant
- Go to Settings β Devices & Services
- Click Add Integration
- Search for "JBL 4305P"
- Enter your speaker's IP address (e.g.,
192.168.1.75) - Optionally set:
- Speaker name (or leave blank to use the name from the speaker)
- Update interval (default: 30 seconds)
- Log level (default: info)
- Click Submit
The integration will automatically discover available inputs including:
- Google Cast (Chromecast built-in)
- Bluetooth devices (currently paired)
- AirPlay
- Spotify Connect
- Tidal Connect
- Roon
- UPnP/DLNA
After adding the integration, you can configure additional options:
- Go to Settings β Devices & Services
- Find your JBL 4305P speaker
- Click Configure
- Adjust:
- Update Interval: How often to poll the speaker (10-300 seconds)
- Log Level: Set logging verbosity (debug, info, warning, error)
- Rediscover Inputs: Enable this to rescan for new Bluetooth devices or inputs
Once configured, you'll have a select.jbl_4305p_input_source entity (or similar, based on your speaker name).
In the UI:
- Go to the device page and use the dropdown to select an input
With Automations:
service: select.select_option
target:
entity_id: select.jbl_4305p_input_source
data:
option: "Google Cast"Available Options:
Google Cast- Chromecast built-inBluetooth - [Device Name]- Specific Bluetooth device (e.g., "Bluetooth - Lounge TV")AirPlay- Apple AirPlaySpotify Connect- Spotify Connect- And others based on what's available on your speaker
Switch to Bluetooth when TV turns on:
automation:
- alias: "Switch speakers to TV audio"
trigger:
- platform: state
entity_id: media_player.living_room_tv
to: "on"
action:
- service: select.select_option
target:
entity_id: select.jbl_4305p_input_source
data:
option: "Bluetooth - Lounge TV"The integration automatically discovers Bluetooth devices that are:
- Currently paired with the speaker
- Actively playing or recently played
To add new Bluetooth devices:
- Pair the device with your speaker using the speaker's Bluetooth button
- Start playing audio from the device
- In Home Assistant, go to the integration options and enable "Rediscover Inputs"
- Save - the new device will be added to the input list
Each Bluetooth device gets its own input option with its friendly name (e.g., "Bluetooth - iPhone", "Bluetooth - Samsung TV").
This integration uses the speaker's NSDK (Network SDK) HTTP API:
- Endpoint:
http://[SPEAKER_IP]/api/getDataand/api/setData - Protocol: HTTP GET with query parameters
- Authentication: None (local network only)
The integration probes for these service types:
googlecast- Google Cast / Chromecastbluetooth- Bluetooth devices (with device-specific paths)airplay- Apple AirPlayspotify- Spotify Connectroon- Roon ReadytidalConnect- Tidal ConnectupnpRenderer- UPnP/DLNA
Only inputs that are available on your specific speaker model will appear in the dropdown.
- Verify the IP address is correct
- Ensure the speaker is powered on and connected to the network
- Check that your Home Assistant instance can reach the speaker (same network/VLAN)
- Try accessing
http://[SPEAKER_IP]/api/getData?path=settings:/deviceName&roles=valuein a browser
- Ensure the device is paired with the speaker (use the speaker's Bluetooth button)
- Play audio from the Bluetooth device first
- Use the "Rediscover Inputs" option in the integration settings
- Check the Home Assistant logs for discovery errors
- Check the integration logs (set log level to "debug" in options)
- For Bluetooth, ensure the device is powered on and in range
- Some inputs may require the source device to be actively available
To enable detailed logging, add to your configuration.yaml:
logger:
default: info
logs:
custom_components.jbl_4305p: debugcustom_components/jbl_4305p/
βββ __init__.py # Integration setup
βββ api.py # NSDK API client
βββ config_flow.py # Configuration UI
βββ const.py # Constants
βββ coordinator.py # Data update coordinator
βββ manifest.json # Integration metadata
βββ select.py # Input select entity
βββ strings.json # UI strings
βββ translations/
βββ en.json # English translations
Key methods in api.py:
discover_available_inputs()- Scans for all available inputsdiscover_bluetooth_devices()- Finds paired Bluetooth devicesswitch_input(service_id, device_path)- Changes inputget_current_input()- Gets active inputget_player_state()- Gets current playback state
MIT License - see LICENSE file for details
For issues or feature requests, please open an issue on GitHub.
Reverse-engineered from JBL 4305P speaker logs and web interface.