This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.
Closed Official

[APP] Bluesound

PhuturistPhuturist Member
edited June 2018 in Apps

Bluesound for Homey

App Store Page: https://apps.athom.com/app/com.bluesound

Latest version - 2018-06-09 -- v1.2.3

  • FIX: fix the is (not) playing condition card

Description

Use Homey to control your Bluesound devices.

Supported Cards
- [TRIGGER] Started playing (tags for artist, track and album if available)
- [TRIGGER] Playing artist changed (tags for artist, track and album if available)
- [TRIGGER] Playing track changed (tags for artist, track and album if available)
- [TRIGGER] Stopped playing
- [CONDITION] is/is not playing
- [CONDITION] is shuffled
- [ACTION] All default action cards for speaker capability like play, stop, pause and change volume
- [ACTION] Change input
- [ACTION] Play preset
- [ACTION] Shuffle on/off
- [ACTION] Repeat on/track/off

Instructions

Add the device as you would add any device to Homey. Enter the IP address of the device (can be found in your router or the settings of the device itself), the port it listens to (default is 11000) and the polling frequency. The polling frequency is used to update the status of the device in Homey (like what is currently playing) based on the actual status of the device. To avoid excessive network traffic the minimum and default is set to 4 seconds.
Tagged:
«1

Comments

  • iTSMeiTSMe Member
    edited January 2018
    Unfortunately the app will not find my Bluesound Node 2:


    Can't find any traces of the Bluesound App in the loggfile, except when I will restart the app. Mention also the IP Webcam in the orange text  :)

    Edit:

    Ok, sorry, to quick with my comment. I installed yesterday the app from the store, which was version 1.0. This one wasn't working. now I checked Github and there was an update available (version 1.0.1).
  • iTSMe said:
    Unfortunately the app will not find my Bluesound Node 2:


    Can't find any traces of the Bluesound App in the loggfile, except when I will restart the app. Mention also the IP Webcam in the orange text  :)

    Edit:

    Ok, sorry, to quick with my comment. I installed yesterday the app from the store, which was version 1.0. This one wasn't working. now I checked Github and there was an update available (version 1.0.1).
    Could you tell me more about how version 1.0.1 is working? I do not own a Bluesound device myself but have made the app on request. So all code has not been tested and I'm interested if all is working ok.
  • Sure, wil test next week. Is it possible to create a tag with the what's playing now info? Would be nice to show as text on my LaMetric.
  • PhuturistPhuturist Member
    edited January 2018
    iTSMe said:
    Sure, wil test next week. Is it possible to create a tag with the what's playing now info? Would be nice to show as text on my LaMetric.
    There are trigger cards for change track and changed artist that has artist, track and album tags. Does that fit your needs?
  • great work @Phuturist. I hope i'll be able to test everything once new version is up!

  • iTSMeiTSMe Member
    edited January 2018
    Phuturist said:
    iTSMe said:
    Sure, wil test next week. Is it possible to create a tag with the what's playing now info? Would be nice to show as text on my LaMetric.
    There are trigger cards for change track and changed artist that has artist, track and album tags. Does that fit your needs?
    The trigger cards looks like I was looking for. Unfortunately it seems that nothing will work, I tried the trigger cards without result, and also the action and condition cards don't work. The interface on the device also will not work. I didn't have time to setup a Wireshark device to monitor what is going to the Bluesound yet. The Homey logfile don't show anything related to the Bluesound.

    If there is another way to debug please let me know, I will try to have a look at it.

    The logfile from the Bluesound don't show anything from the Homey IP (x.x.x.154). Only other devices with the BluOs player. 
    Jan 29 13:03:45 (none) user.info ./ms.pl: main::HttpRequest ./ms.pl (908) [1] x.x.x.226: /Artwork?service=LocalMusic&album=703%20Greatest%201980%27s%20Music%20Hit%20Singles&artist=New%20Order
  • iTSMe said:
    Phuturist said:
    iTSMe said:
    Sure, wil test next week. Is it possible to create a tag with the what's playing now info? Would be nice to show as text on my LaMetric.
    There are trigger cards for change track and changed artist that has artist, track and album tags. Does that fit your needs?
    The trigger cards looks like I was looking for. Unfortunately it seems that nothing will work, I tried the trigger cards without result, and also the action and condition cards don't work. The interface on the device also will not work. I didn't have time to setup a Wireshark device to monitor what is going to the Bluesound yet. The Homey logfile don't show anything related to the Bluesound.

    If there is another way to debug please let me know, I will try to have a look at it.

    The logfile from the Bluesound don't show anything from the Homey IP (x.x.x.154). Only other devices with the BluOs player. 
    Jan 29 13:03:45 (none) user.info ./ms.pl: main::HttpRequest ./ms.pl (908) [1] x.x.x.226: /Artwork?service=LocalMusic&album=703%20Greatest%201980%27s%20Music%20Hit%20Singles&artist=New%20Order
    If you know how to do a CLI install I can create a custom version on GitHub that will show debug logging which will help me identify what's wrong.

    Did you see your Bluesound mac address while pairing the device?
  • iTSMeiTSMe Member
    edited January 2018
    Thats ok for me if it will help you with developping the app. The Mac was shown (however I didn't check if it was the right one  :/) .
    I just add the Bluesound again and checked the MAC address, I think this is the problem. None of the MAC's in the Bluesound looks like the one in the Bluesound App in Homey (there are two HW adresses: Eth0 Ethernet  HWaddr XX:XX:XX:XX:ED:A5 and wlan0     Link encap:Ethernet  HWaddr xx:xx:xx:xx:96:8D  and a network_serial
    XX:XX:XX:XX:0C:F8). The Homey Bluesound MAC is ending on :17:45, in my switch the ED:A5 is connected (hard wired). So I don't know where the MAC in Homey is coming from.

    btw, there is no such device with MAC ending with 17:45 in my entire network.
  • iTSMeiTSMe Member
    edited January 2018
    probably there is a need of cleanup in the util.js:
       // TODO: remove mock data
            console.log(command);
            var data = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
            <SyncStatus icon="/images/players/C368_nt.png" volume="0" modelName="C368" name="C368 - 1745" model="C368" brand="NAD" etag="2" schemaVersion="21" syncStat="2" id="xxx.xxx.1.93:11000" mac="XX:XX:XX:XX:17:45">
                <externalSource name="TV" id="1">
  • Argh, i have pushed my development version to the app store. This contains mock data so no actual connections with the device are created. I'll fix it this evening and will post a CLI version here.

    Sorry about this.
  • Thanks, no problem

  • It's looking good now, I tested almost all the cards, and they are working like supposed (I think). However the Mute and Unmute card isn't tested yet because I'm working remote and I cant figure out what has to change in the BluOs application to indicate the sound is muted or not.

    One thing I noticed is that the Trigger Card Artist and Track aren't working in a radio stream. The artist will stay the same (name of the stream) but the description of the song will change, just like the album name but the flow isn't triggerd. When playing from the library it is working as it should. Attached are two screenshots of the Status output when playing a stream, maybe it is a bug in the app, or it is working like you designed it. The time between the <secs> tags is the total time the stream is playing.
  • PhuturistPhuturist Member
    edited January 2018
    @iTSMe I designed it based on a couple of xml dumps. The current version of the app is using the artist, name and album tags. Are you saying with this that it's better to use the title1 to title3 tags as these work better for streams?

    It seems the name tag is not available when streaming.
  • Maybe for card Artist only Title2 and for Song Title1, because it is exactly what the card says, or will that be not enough? However, if you use the ArtistName it will change in a stream so why is the card not triggered?
  • iTSMe said:
    Maybe for card Artist only Title2 and for Song Title1, because it is exactly what the card says, or will that be not enough? However, if you use the ArtistName it will change in a stream so why is the card not triggered?
    Yeah, I'll implement a fallback for this so it uses the title tags when the others are not available.

    The flow not triggering seems like a bug, I'll look into this.
  • PhuturistPhuturist Member
    edited January 2018
    @iTSMe

    Unfortunately the title tags dont seem to be consistent. Below is an XML dump I have received which indicates that title2 is the same as Artist and title3 is the same as Album. In your posted dump this is the other way around. If this is not consistent it's not reliable as fallback for the artist, name and album tag. In other dump I even notice these title fields get filled with other meta data.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <status etag="3fc00adc2f15b58bf0a10a1313312959">
    <album>A Change of Heart</album>
    <artist>Ellen Andrea Wang</artist>
    <canMovePlayback>true</canMovePlayback>
    <canSeek>1</canSeek>
    <cursor>133</cursor>
    <fn>Tidal:74588359</fn>
    <image>/Artwork?service=Tidal&amp;songid=Tidal%3A74588359</image>
    <indexing>0</indexing>
    <mid>0</mid>
    <mode>1</mode>
    <name>A Change of Heart</name>
    <pid>91</pid>
    <prid>0</prid>
    <quality>cd</quality>
    <repeat>0</repeat>
    <service>Tidal</service>
    <shuffle>1</shuffle>
    <sid>4</sid>
    <sleep></sleep>
    <song>0</song>
    <state>play</state>
    <streamFormat>FLAC 44100/16/2</streamFormat>
    <syncStat>6</syncStat>
    <title1>A Change of Heart</title1>
    <title2>Ellen Andrea Wang</title2>
    <title3>A Change of Heart</title3>
    <totlen>262</totlen>
    <volume>10</volume>
    <secs>32</secs>
    </status>
    I was unable to find anything wrong with the artist changed trigger card. This may require some further testing on your end. Could it be you did not wait long enough for Homey to recognize a change in artist (due to Homey having to poll the Bluesound and there is always a little bit behind). I did notice an issue with the track changed card which I will push to GitHub and app store in a second.
  • Latest version - 2018-01-31 -- v1.0.1-beta

    • FIX: added missing node modules
    • FIX: translation issues
    • FIX: remove mock data
    • FIX: tag for track on start playing trigger card 
    • FIX: changed track trigger card
    • POSSIBLE FIX: for track being unavailable when streaming (there is no name tag and it needs deduction from title tags)
  • I've been testing already with the 1.0.1 version and I can confirm the trigger Track changed is now working, also the artist and track from a stream are usable now. 

    Thanks for developing  :)
  • @iTSMe @quakerix How is it working, can release 1.0.1 be promoted to stable?
  • @Phuturist

    i did not had the time yet to fully test it. What I did notice is:

    Change input shows the following values:
    - radio paradise
    - spotify
    - bluetooth

    while my inputs are different.

    http://192.168.1.93:11000/SyncStatus

    <SyncStatus icon="/images/players/C368_nt.png" volume="90" modelName="C368" name="C368 - 1745" model="C368" brand="NAD" etag="24" schemaVersion="21" syncStat="24" id="192.168.1.93:11000"mac="90:56:82:0E:17:45">
    <externalSource name="TV" id="1">
    <item id="1" name="TV"/>
    <item id="6" name="Platenspeler"/>
    <item id="8" name="Bluetooth"/>
    <item id="9" isBluos="true" name="BluOS"/>
    </externalSource>
    </SyncStatus>

    the inputs are:
    - TV
    - Platenspeler
    - Bluetooth
    - BluOS

    The mute/un-mute card seems to be broken. That's all i could test in 5min. Sorry
  • quakerix said:
    @Phuturist

    i did not had the time yet to fully test it. What I did notice is:

    Change input shows the following values:
    - radio paradise
    - spotify
    - bluetooth

    while my inputs are different.

    http://192.168.1.93:11000/SyncStatus

    <SyncStatus icon="/images/players/C368_nt.png" volume="90" modelName="C368" name="C368 - 1745" model="C368" brand="NAD" etag="24" schemaVersion="21" syncStat="24" id="192.168.1.93:11000"mac="90:56:82:0E:17:45">
    <externalSource name="TV" id="1">
    <item id="1" name="TV"/>
    <item id="6" name="Platenspeler"/>
    <item id="8" name="Bluetooth"/>
    <item id="9" isBluos="true" name="BluOS"/>
    </externalSource>
    </SyncStatus>

    the inputs are:
    - TV
    - Platenspeler
    - Bluetooth
    - BluOS

    The mute/un-mute card seems to be broken. That's all i could test in 5min. Sorry
    I had already send you a message about the inputs:

    According to the reversed API documentation the command for getting the inputs is:/RadioBrowse?service=Capture

    The respons on this request as send to you in xml give me the inputs:
    • "Radio Paradise"
    • "Spotify"
    • "Bluetooth"
    With this info I can build the URL's for switching to this input, for instance /Play?url=Capture%3Abluez%3Abluetooth&preset_id&image=/images/BluetoothIcon.png

    These differ from the inputs you are now describing ("TV", "Platenspeler", another "BlueTooth" and "BluOS"). I can find these inputs in the xml from StatusSync but there is nothing in the API described on how to switch to these inputs. So I cant really do anything with these inputs as far as I can tell.

    Do you know the api command to switch to these inputs?

    I'll look into the mute / unmute card.
  • Phuturist said:
    quakerix said:
    @Phuturist

    i did not had the time yet to fully test it. What I did notice is:

    Change input shows the following values:
    - radio paradise
    - spotify
    - bluetooth

    while my inputs are different.

    http://192.168.1.93:11000/SyncStatus

    <SyncStatus icon="/images/players/C368_nt.png" volume="90" modelName="C368" name="C368 - 1745" model="C368" brand="NAD" etag="24" schemaVersion="21" syncStat="24" id="192.168.1.93:11000"mac="90:56:82:0E:17:45">
    <externalSource name="TV" id="1">
    <item id="1" name="TV"/>
    <item id="6" name="Platenspeler"/>
    <item id="8" name="Bluetooth"/>
    <item id="9" isBluos="true" name="BluOS"/>
    </externalSource>
    </SyncStatus>

    the inputs are:
    - TV
    - Platenspeler
    - Bluetooth
    - BluOS

    The mute/un-mute card seems to be broken. That's all i could test in 5min. Sorry
    I had already send you a message about the inputs:

    According to the reversed API documentation the command for getting the inputs is:/RadioBrowse?service=Capture

    The respons on this request as send to you in xml give me the inputs:
    • "Radio Paradise"
    • "Spotify"
    • "Bluetooth"
    With this info I can build the URL's for switching to this input, for instance /Play?url=Capture%3Abluez%3Abluetooth&preset_id&image=/images/BluetoothIcon.png

    These differ from the inputs you are now describing ("TV", "Platenspeler", another "BlueTooth" and "BluOS"). I can find these inputs in the xml from StatusSync but there is nothing in the API described on how to switch to these inputs. So I cant really do anything with these inputs as far as I can tell.

    Do you know the api command to switch to these inputs?

    I'll look into the mute / unmute card.
    I need to do some investigation. I’m missing Tidal in the list as well. I’m not using Spotify.

    i think it’s different than others because I have the build in version. It’s part of my receiver.

    let me do some research.
  • With the Node-2 the inputs are as supposed. Don't know yet about the Mute card, the only thing I can find online about Mute is that the volume is set to 0 (zero), but then you have to save the current volume level to a variable because when you want to unmute you want the same level as before
  • iTSMe said:
    With the Node-2 the inputs are as supposed. Don't know yet about the Mute card, the only thing I can find online about Mute is that the volume is set to 0 (zero), but then you have to save the current volume level to a variable because when you want to unmute you want the same level as before
    Thanx for the input on the inputs. @quakerix , let me know if you find something.

    About the volume, I could save the previous volume level as a parameter and use that to set the volume level once the unmute action card is used. Will look into that when I investigate the issue of the (un)mute not working all together.
  • Latest version - 2018-02-06 -- v1.0.2

    • FIX: mute / unmute action cards fixed
  • Hi @Phuturist,
    Thank you for this app.  For the moment I just use basic functionalities (play, pause, volume).  I noticed that when I try to set the volume with a variable, it sets the volume rounded to one decimal after the comma.  Eg, when I want to set the volume to 0.12, it actually sets it to 0.1.  Am I overlooking something?

  • Charley said:
    Hi @Phuturist,
    Thank you for this app.  For the moment I just use basic functionalities (play, pause, volume).  I noticed that when I try to set the volume with a variable, it sets the volume rounded to one decimal after the comma.  Eg, when I want to set the volume to 0.12, it actually sets it to 0.1.  Am I overlooking something?

    No, you are not. It's a small bug which I will fix in an upcoming release (once there are more small bugs to fix).
  • quakerixquakerix Member
    edited February 2018
    ok i did some testing, things that i have noticed:

    1. When I pause or resume the music via the device list; it triggers a 'track changed' flow. I was listening to TuneIn Radio and didn't change the track; When I paused the values of the tags were (Album/Artist/Track): 'Not available - Not available - De muziekfabriek'. When I resume: 'Not available - Not available - NPO Radio 4 - De Muziekfabriek - AVROTROS'
    2. When I resume the music via the device list, it doesn't trigger start playing playing but it fires the 'Stop Playing' card. Pause is properly firing the stop playing card.
    3. What does 'is shuffled' card exactly mean? is this something when using a playlist?
    4. Previous will restart the current song and will not actually go to the previous song (playing a Tidal playlist) unless you fire Previous quickly after the song started.
    5. Skip(next) card is missing. Workaround is using the command card.
    6. When I switch input (using my remote control) from bluOS to TV, the track changed is fired and the stop playing is fired (while i wasn't playing anything). 
    7. I'm missing Tidal in the lists of Inputs. Being able to play something from Tidal is for me very important since i'm not using other services. For example, being able to play a song or playlist would be sufficient. 
    8. Unmute card isn't working. It jumps to a certain volume, plays 1 millisecond of music and then mutes again.

    I'm not saying everything is a bug. But these are the things I noticed.

    Nr #2, #7 and #8 are important to me. I'm already very happy with what you accomplished. I will do my promised donation once these are done. 

    i have bluesound module built into a NAD sound system. I don't think the bluesound module can change the sound systems input to something else. At least i'm not sure.

    The http://192.168.1.93:11000/SyncStatus displays my other inputs, but i don't think it can switch. 

    btw. I don't know why Tidal is not listed as a Service in: 
    http://192.168.1.93:11000/RadioBrowse?service=Capture

    And for example TuneIn is missing there as well. I think because they are handled differently. Because they are listed in: 
    http://192.168.1.93:11000/Services

    As if RadioBrowse displays 'external' services and Services displays nativly built in services.
  • quakerix said:
    ok i did some testing, things that i have noticed:

    1. When I pause or resume the music via the device list; it triggers a 'track changed' flow. I was listening to TuneIn Radio and didn't change the track; When I paused the values of the tags were (Album/Artist/Track): 'Not available - Not available - De muziekfabriek'. When I resume: 'Not available - Not available - NPO Radio 4 - De Muziekfabriek - AVROTROS'
    2. When I resume the music via the device list, it doesn't trigger start playing playing but it fires the 'Stop Playing' card. Pause is properly firing the stop playing card.
    3. What does 'is shuffled' card exactly mean? is this something when using a playlist?
    4. Previous will restart the current song and will not actually go to the previous song (playing a Tidal playlist) unless you fire Previous quickly after the song started.
    5. Skip(next) card is missing. Workaround is using the command card.
    6. When I switch input (using my remote control) from bluOS to TV, the track changed is fired and the stop playing is fired (while i wasn't playing anything). 
    7. I'm missing Tidal in the lists of Inputs. Being able to play something from Tidal is for me very important since i'm not using other services. For example, being able to play a song or playlist would be sufficient. 
    8. Unmute card isn't working. It jumps to a certain volume, plays 1 millisecond of music and then mutes again.

    I'm not saying everything is a bug. But these are the things I noticed.

    Nr #2, #7 and #8 are important to me. I'm already very happy with what you accomplished. I will do my promised donation once these are done. 

    i have bluesound module built into a NAD sound system. I don't think the bluesound module can change the sound systems input to something else. At least i'm not sure.

    The http://192.168.1.93:11000/SyncStatus displays my other inputs, but i don't think it can switch. 

    btw. I don't know why Tidal is not listed as a Service in: 
    http://192.168.1.93:11000/RadioBrowse?service=Capture

    And for example TuneIn is missing there as well. I think because they are handled differently. Because they are listed in: 
    http://192.168.1.93:11000/Services

    As if RadioBrowse displays 'external' services and Services displays nativly built in services.
    Here are some answers.

    1. The way the artist, track and album tags are updated by Bluesound devices is tricky. They are not consistent and appearently even change when the music is paused. I cant really do much about that since I dont have any control over it. I have added some extra checks that might avoid this behaviour (not updated the tags when state is 'stop' or 'pause').
    2. I will most likely have this fixed in the next release.
    3. is shuffled means the playback is currently set to shuffle / random. A not very useful condition card.
    4. Hmm, that is common behaviour when using a remote where you need to hit the previous button twice to actually skip to the previous song. I'll see if I can implement it so it will send to "back" api calls shortly after each other which should fix this.
    5. I'm pretty sure you have overlooked this action card. Code looks good and I just tested it myself, the card is there.
    6. The stop playing will probably be fixed in this scenarion, the track playing I have no control over. It's the same scenario as described under point 1, these actions update the artists, track and/or album tag and thus triggering this action card.
    7. I have added a new action card that lists all services of the type 'CloudService', 'LocalMedia' and 'RadioService' and use this to execute the command http://<<ip>>:11000/Genres?service=<<name of the selected service>>. Hopefully this works for you.
    8. I will most likely have this fixed in the next release.

    I have just pushed it to the app store. So 2, 7 and 8  should be fixed with this release, let me know how it goes.
  • Latest version - 2018-02-12 -- v1.1.0

    • FIX: small decimal fix when setting volume
    • FIX: unmute action cards fixed
    • FIX: start playing trigger card fixed
    • FIX: hopefully fix the previous action card (send command twice to actually go back a track instead of jump to start of current track)
    • UPDATE: added extra checks to prevent artist, track and album tags being updated in unwanted scenarios
    • UPDATE: added a change service action card
This discussion has been closed.