[APP][Pro] Bluesound - Multi-room Music. The Hi-Res Way

It looks like somehow someway, these devices go offline while they are not:

The test connection shows green light. But even restarting the app isn’t helping.

Then it’s time to do a command line install and supply me with extra logging. You can use the debug branch for this.

https://github.com/jghaanstra/com.bluesound/tree/debug

It’s been running stable last month. I think te connection issues were resolved after router restart

Again devices are continuously offline.

I think there’s an issue if you have multiple bluesound devices. For the past month device A was working stable, 0 issues (after i did a router restart). But device B was offline all the time, always.

Today i had some time to play so i decided to remove device B and to add it again. And now that device is online, but guess what. Device A is now offline. Restarting the bluesound device has no effect.

@Phuturist no other way to debug then command line? Even VPN to my network wouldn’t help?

One other question. The Bluesound App is able to change INPUT.

Is there a way to capture what the mobile app is sending?

That would probably work as well but I’d also need develop access to your Homey. I would not be comfortable doing this. Debugging on command line is not that hard, why not give it a try?

Sure, you just need to set up a man in the middle attack. It’s doable but if CLI installs already seem to scare you I dont think this is something for you. But why do you need this, there is already a change input action card in the Homey Bluesound app.

Its not scaring me :slight_smile: I’m looking for most efficient approach since i don’t have much time :frowning:

I’ll get the CLI working. Keep you posted

Hey @Phuturist,

I was doing some research regarding switching input (TV, Platenspeler, BlueOS, Bluetooth) and I got a great tip from their support.

There’s a log file in the bluOS device that logs all the HTTP calls. And while I was searching for the command to switch input. I was curious if I could see any Homey activity and detect why the device is marked as offline while it being online. Since my receiver is powered off completely while i’m not at home. It boots/turn on when i’m home. And gladly Homey detected after 15min or more that the device is online. But I didn’t see any Homey calls in the log. So how are you detecting whether a device is online? Do you ping? call the API? And what the frequency?

Then the other more fun part. Switching the input. There’s good and bad news. The good news, its possible! And I found it:

http://192.168.178.249:11000/ExternalSource?id=%2B
http://192.168.178.249:11000/ExternalSource?id=-

The blueOS app has a left and right button to switch between the inputs. You can’t go directly to an input. You go left, or right. That’s the bad news. So I can’t say, switch to TV or switch to Platenspeler etc. Which is exactly what I want, since I detect when the TV is on. So I know when to switch to that input, same for platenspeler etc.

But I did a little bit more research and checked what the differences when calling the Status command being on different inputs. And I was almost happy. Because, the JSON that’s return with calling the Status command for the inputs Platenspeler, TV, Bluetooth have the same structure but the BluOS is different. Let me show you the results:

image
image
image
image

What do you think? Could you build a card that is a ‘switch input card’, with free text. And you do something like:

Switch input API-call
Status API-call
If (title2 matches ‘input-field’ e.g. Plantenspeler) { stop }
else { start-over }

The only issue is title2 works for Platenspeler, TV and Bluetooth. But not for BluOS. So that needs to be an exception.

What do you think? @Phuturist

So my NAD device is offline again.

If you are not checking whether a device is online using the API and you are doing a PING. Maybe the device has a built in firewall or my router has a firewall or some kind of protection somewhere and blocks your pings to check whether the device is online.

The polling frequency (setting of the device in Homey) is used to make a connection to the device and retrieve the status. If no valid connection can be made the device will go offline and Homey will try to reconnect every 63 seconds to see if the device is available again. If you woul do a CLI install it might tell you why Homey is not able to make a connection to retrieve the status.

I’l look at your findings for a potential switch input card but I’m currently quite busy with other stuff.

Running the 1.2.6 version without problems on three devices (Node2, Soundbar and Flex). All stay online all the time and no functionality missing. Itś even possible to create a linked group in a flow!
Thanks for the development and support in the past. Itś getting time for you to get some Bluesound stuff I guess :grinning:

I understand; I Will try to find the time for the CLI.

If You manage to make successful input switch I’ll make sure you can order some beers.

But no hurry! Already happy with your support. This is why homey (community) is awesome

Although I understand your need and understand there does not seem to be an alternative way what you are suggesting is quite hacky. What if someone enters a non existing input, if you would not catch that as well you could end up in an endless cycle of input switching … :scream:

I’ll start with adding cards for switching input up and input down and give it some more thought.

@Quakerix could you tell me what entries are in the current autocomplete actioncard for changing inputs? Does this not already contain the inputs you want to switch to?

No they don’t, they show:
Radio paradise(?)
Spotify
Bluetooth

And I’m not sure if the card does something.

I know it’s quite hacky. It was the only thing that I could think of. You can always limit it to 5 or 6 since there are physically no more inputs. If you have idea :slight_smile:

No other ideas. I have uploaded a new release to Github that has a new action card for changing inputs up and down and an experimental action card that switches the input till a maximum of 5 times or until the given input matches the actual input. Since I have no way of testing the app it needs to be tested by somebody else first before I will push it to the app store. Could you run the app using the command line and let me know if it works? If it does not work it would be nice if you could post the command line logging.

Thanks, as soon as I have time I’ll let you know.

Btw. In the (v2) app I can not change the volume. I can mute, But not un-mute.

Added some extra debug logging to the (un)mute action card as well. Please test this while running the app from the command line so I can see what is going on.

v1.2.7 - 2018-12-14

  • NEW: action card for changing input to next or previous input
  • EXPERIMENTAL: action card for changing input to a given input (will switch through inputs until given input matches the switched input)
1 Like

Hi @Phuturist,

Just tried the update. Switch input card seems not to be doing anything. If i do a flow with the card it just keeps loading. No errors, the card keeps loading. While if i do it manually in browser it works.

http://192.168.178.249:11000/ExternalSource?id=-
http://192.168.178.249:11000/ExternalSource?id=%2B

I’m still getting sometimes a Unreachable error. I just wait 10min and the device is back ‘online’. I know, one day i’ll install the CLI version. I checked all router settings but can’t find anything that would explain it. Router settings are OK according to bluesound support. And if the device would be completely unreachable the app would not work. I’m assuming that somehow connection lost between Homey and the Bluesound device. Maybe Bluesound bans ip’s sometimes for x minutes. I don’t know.

The experimental card does switch inputs. But it doesn’t stop at the correct one and it always stops on the BlueOS input. I guess because the BlueOS respons is different then the others.

BlueOS respons: https://pastebin.com/KjDhNXRg
Platenspeler respons: https://pastebin.com/BiYP0Jnk