WIIM Pro Plus integration

OK, I’ll try all line-… I can find.

I use a WiiM Pro Plus

Btw, the integratin crashed again. It happened, when I switch from the running WiiM activity to watch TV activity.

Log see below: (I think, attaching a text file is not possible)

2025-08-31 14:08:51.001916 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:08:51,001 - ucapi.api - DEBUG - [(‘127.0.0.1’, 41346)] <-: {“kind”:“event”,“msg”:“exit_standby”,“cat”:“REMOTE”,“ts”:“2025-08-31T14:08:50.993418708Z”,“msg_data”:null}
2025-08-31 14:02:28.590950 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:02:28,589 - ucapi.api - DEBUG - [(‘127.0.0.1’, 41346)] <-: {“kind”:“event”,“msg”:“enter_standby”,“cat”:“REMOTE”,“ts”:“2025-08-31T14:02:28.576116115Z”,“msg_data”:null}
2025-08-31 14:00:51.726686 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:51,726 - ucapi.api - DEBUG - [(‘127.0.0.1’, 41346)] =>: {‘kind’: ‘event’, ‘msg’: <WsMsgEvents.DEVICE_STATE: ‘device_state’>, ‘msg_data’: {‘state’: <DeviceStates.ERROR: ‘ERROR’>}, ‘cat’: <EventCategory.DEVICE: ‘DEVICE’>}
2025-08-31 14:00:51.726686 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:51,725 - main - ERROR - Failed to connect to WiiM device at 192.168.178.69
2025-08-31 14:00:51.725413 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:51,724 - uc_intg_wiim.client - ERROR - API request error: Cannot connect to host 192.168.178.69:443 ssl:default [Connect call failed (‘192.168.178.69’, 443)]
2025-08-31 14:00:49.089155 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:49,088 - main - INFO - Remote Two connected
2025-08-31 14:00:49.085111 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:49,084 - main - INFO - Entities subscribed: [‘FF98FCDE71A1360BDF0CD0FD_media_player’, ‘FF98FCDE71A1360BDF0CD0FD_remote’]
2025-08-31 14:00:49.083552 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:49,081 - ucapi.api - DEBUG - [(‘127.0.0.1’, 41346)] <-: {“id”:3,“kind”:“event”,“msg”:“connect”}
2025-08-31 14:00:49.075264 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:49,070 - ucapi.api - DEBUG - [(‘127.0.0.1’, 41346)] ->: {‘kind’: ‘resp’, ‘req_id’: 2, ‘code’: 200, ‘msg’: <WsMsgEvents.DRIVER_VERSION: ‘driver_version’>, ‘msg_data’: {‘name’: ‘WiiM Integration’, ‘version’: {‘api’: ‘0.3.1’, ‘driver’: ‘1.0.1’}}}
2025-08-31 14:00:49.070145 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:49,067 - ucapi.api - DEBUG - [(‘127.0.0.1’, 41346)] <-: {“id”:2,“kind”:“req”,“msg”:“get_driver_version”}
2025-08-31 14:00:49.064447 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:49,062 - ucapi.api - DEBUG - [(‘127.0.0.1’, 41346)] ->: {‘kind’: ‘resp’, ‘req_id’: 1, ‘code’: 200, ‘msg’: ‘result’, ‘msg_data’: {}}
2025-08-31 14:00:49.060921 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:49,060 - ucapi.api - WARNING - WARN: cannot subscribe entity FF98FCDE71A1360BDF0CD0FD_remote: entity is not available
2025-08-31 14:00:49.060295 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:49,059 - ucapi.entities - DEBUG - [available]: entity not found: ‘FF98FCDE71A1360BDF0CD0FD_remote’
2025-08-31 14:00:49.059670 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:49,055 - ucapi.api - WARNING - WARN: cannot subscribe entity FF98FCDE71A1360BDF0CD0FD_media_player: entity is not available
2025-08-31 14:00:49.055699 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:49,055 - ucapi.entities - DEBUG - [available]: entity not found: ‘FF98FCDE71A1360BDF0CD0FD_media_player’
2025-08-31 14:00:49.049614 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:49,049 - ucapi.api - DEBUG - [(‘127.0.0.1’, 41346)] <-: {“kind”:“req”,“id”:1,“msg”:“subscribe_events”,“msg_data”:{“entity_ids”:[“FF98FCDE71A1360BDF0CD0FD_media_player”,“FF98FCDE71A1360BDF0CD0FD_remote”]}}
2025-08-31 14:00:49.040440 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:49,037 - ucapi.api - DEBUG - [(‘127.0.0.1’, 41346)] ->: {‘kind’: ‘resp’, ‘req_id’: 0, ‘code’: 200, ‘msg’: <WsMessages.AUTHENTICATION: ‘authentication’>, ‘msg_data’: {}}
2025-08-31 14:00:49.031765 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:49,031 - ucapi.api - INFO - WS: Client added: (‘127.0.0.1’, 41346)
2025-08-31 14:00:49.025593 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:49,021 - websockets.server - INFO - connection open
2025-08-31 14:00:48.627070 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:48,623 - websockets.server - INFO - server listening on 127.0.0.1:9002
2025-08-31 14:00:48.611366 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:48,609 - main - INFO - Connecting to WiiM device…
2025-08-31 14:00:48.605711 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:48,602 - main - INFO - Device already configured, starting connection…
2025-08-31 14:00:48.605711 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:48,601 - ucapi.api - INFO - Driver is up: uc-intg-wiim, version: 1.0.1, api: 0.3.1, listening on: 127.0.0.1:9002
2025-08-31 14:00:48.595847 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:48,595 - uc_intg_wiim.config - INFO - Configuration loaded successfully
2025-08-31 14:00:48.582414 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:48,581 - uc_intg_wiim.config - INFO - Configuration directory: /etc/custom-intg/uc-intg-wiim
2025-08-31 14:00:48.580040 +00:00 custom-intg-uc-intg-wiim INFO 2025-08-31 16:00:48,578 - main - INFO - Starting WiiM Integration Driver

seems like it lost connection during this stage.

can you tell me the exact steps you took so i can try to replicate?

Looks weird to me. All Input options are double. Line-in, Wifi, BT, … But ethernet is missing. And the outputs are completely missing.

Not sure, if I understand what you mean with steps. I listen music via WiiM push stop to stop the music, switch to the activities page and tap on watch TV. Then I can see, that the TV activity is not starting properly on the remote. On the R3 it looks like, there is no activity started, even though all devices are switched on properly.

ah, and I have tried both “Line-In” options and they really switch the incoming signal, but not the outgoing.

It’s not weird, it’s me. I am trying and it’s a lot of trial and error as I develop this integration. I will look into figuring out the outputs. An activity code is new to me so I am trying to learn it so I can code it. I’ll get there….

Yes, thanks for all your effort. Please do not misunderstand me. All WiiM users can be happy that people like you spend time on the development. Thanks for this.

If maybe my sentences sound weird, it’s because I’m not a native English speaker. I’m from Germany.

I’m looking forward to your next improvements and whenever I can, I will support you.

No Problems at all, i will get this fixed for sure. just need to learn a bit and understand it better. i will get it done :slight_smile:

1 Like

new version is up which add Line-Out as an option in “Input Select” for the media player entity. try that.

remember, i made a mistake which i still need to fix. the WiiM doesnt have a “Power off” button, it just put it in standby. so dont use “Power off” in the sequesnce, it will cause a timeout error. i still need to fix that. but for now i added the line out, i tested and it succesfully put the device output in line out. tested only against wiim ultra.

new version up for try: Release v1.0.4 · mase1981/uc-intg-wiim · GitHub

Thanks a lot! I will try, but it can take some days, until I have time for it. I’ll let you know.

I quickly installed it, because I was too curious. But it doesn’t work.

I cannot find any Line-Out. Not in the top level pull down menu nor elsewhere. There is no “Input Select” and with this no sub-menu to select a line-out. There is an “Input Source” but also there no line-out. And it confuses me, that the output selection is part of the input selection, but maybe it is easier for you to place it there test-wise.

But however, I cannot find it.

Thanks, i see my mistake. i was looking at the wrong location here, https://www.wiimhome.com/pdf/HTTP%20API%20for%20WiiM%20Products.pdf trying to fix it now.

Not sure, if this helps you but this, I think, is the option to set. It is not called “Line” but “Aux” here.

I

i figured out a better way. i am using HTTP Toolkit to sniff my network to see what the WiiM actually have,

and found this:
{“hardware”:“2”,“source”:“0”,“audiocast”:“0”}

going to try a few things. planning on adding also dynamic dyscovery, wiim have an api to query what the device have , that will keep it more generic and it wont matter which device model the user have. this is a btter route. working on it now.

implemented the getNewAudioOutputHardwareMode

going to build now and test it…

i think maybe now i got it?

try latest version, let me know.

it discover output_aux_line_out, i just tested adding it to an activity (its in the remote entity)

It works now! Thanks a lot!

1 Like

New update is up:

  1. Add docker image
  2. Add physical button mapping
  3. Add ok/select button
  4. Add buttons avaialble during activity page creation
  5. Add input_source to media player with app pre-configured music sources
  6. Update README.md instructions
  7. Misc bug fixes
    GitHub - mase1981/uc-intg-wiim: Full Support for WiiM products with Unfolded Circle 2/3 Remotes

Hi MaSe,

Thank you for your remarkable work on integrations for this community; it’s truly amazing!

I have a quick question regarding presets and sending commands. We listen to a couple of TuneIn stations, and I’m trying to figure out how to assign these to user buttons. I’ve successfully set up the first TuneIn preset, but I’m having trouble selecting preset 2 (which is another TuneIn station).

I’ve experimented with the ‘send command’ feature and tried using “setPlayerCmd:play_preset:1” and “play_preset:1,” but I suspect I’m using the wrong command format.

Cheers,
Marty

Thank you for the kind words.

Try to put just “preset_2” without the quotes.

The logic I tried to put in place is:

execute_command()
elif command.startswith('preset
’):
preset_num = command.split(‘_’)[1]
await self._client.send_command(f"MCUKeyShortClick:{preset_num}")
This sends MCUKeyShortClick:2 to the WiiM device, which activates preset #2.

So if you put preeset_X it should switch to it upon button press (replace x with the currect value)

Lmk if it doesn’t work.