StevenLooman / home-assistant-dlna-dmr

DLNA/DMR component for home-assistant
Other
13 stars 1 forks source link

QueWifi Speakers #3

Closed TheFuzz4 closed 6 years ago

TheFuzz4 commented 6 years ago

Hey Steve great work I'm happy to report that my speakers are now showing up in HASS.io however it doesn't appear that I can really do anything with them.

Here is my description.xml for them

`This XML file does not appear to have any style information associated with it. The document tree is shown below.

1 0 DMR-1.50 urn:schemas-upnp-org:device:MediaRenderer:1 Family room WiiMu http://www.wiimu.com/ WiiMu Media player WiiMu Media player http://www.wiimu.com/ uuid:72cf7dea-1dd2-11b2-9c94-df9e5b210b3b V01-Sep 16 2015 00001 QueWiFi Speaker_2ACC FF960872D18F2E3753BA514C QPlay:2 image/png 48 48 24 /upnp/grender-48x48.png image/png 120 120 24 /upnp/grender-120x120.png image/jpeg 48 48 24 /upnp/grender-48x48.jpg image/jpeg 120 120 24 /upnp/grender-120x120.jpg urn:schemas-upnp-org:service:AVTransport:1 urn:upnp-org:serviceId:AVTransport /upnp/rendertransportSCPD.xml /upnp/control/rendertransport1 /upnp/event/rendertransport1 urn:schemas-upnp-org:service:ConnectionManager:1 urn:upnp-org:serviceId:ConnectionManager /upnp/renderconnmgrSCPD.xml /upnp/control/renderconnmgr1 /upnp/event/renderconnmgr1 urn:schemas-upnp-org:service:RenderingControl:1 urn:upnp-org:serviceId:RenderingControl /upnp/rendercontrolSCPD.xml /upnp/control/rendercontrol1 /upnp/event/rendercontrol1 urn:schemas-wiimu-com:service:PlayQueue:1 urn:wiimu-com:serviceId:PlayQueue /upnp/PlayQueueSCPD.xml /upnp/control/PlayQueue1 /upnp/event/PlayQueue1 urn:schemas-tencent-com:service:QPlay:1 urn:tencent-com:serviceId:QPlay /upnp/QPlaySCPD.xml /upnp/control/QPlay1 /upnp/event/QPlay1 ` Should I be able to TTS with them? I'm able to with SmartThings but in the HASS UI when I click on it, it just wants to display the history for me. Under attributes for them I see this ` friendly_name: Family room supported_features: 12 -- ` Thank you very much for your help this this and I look forward to seeing where this goes in the future. Excellent effort.
StevenLooman commented 6 years ago

Hi Fuzz, sorry for the late reply. Github didn't send me notification mails on activity for this repository. Can you attach the files instead of inserting them here?

TheFuzz4 commented 6 years ago

Looked for a way to attach via github directly but didn't see a way to do so. Going to attach via email in hopes it works better. Yeah I see that didn't work either. Ok trying something else.

description.zip

Ok gotcha github doesn't like raw xml

TheFuzz4 commented 6 years ago

Ok I pulled down your latest code tonight and I'm now getting this in the logs

2018-04-01 01:31:13 ERROR (MainThread) [homeassistant.setup] Error during setup of component media_player Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/homeassistant/setup.py", line 145, in _async_setup_component component.setup, hass, processed_config) AttributeError: module 'custom_components.media_player' has no attribute 'setup'

Any thoughts?

StevenLooman commented 6 years ago

Recently, Home Assistant changed their API minorly. I have changed home-assistant-dlna-dmr to follow this, but also separated the UPnP client to its own package.

Which version of HomeAssistant are you running? With version 0.65.6 I am positive it works. Also be sure to re-install the component. The symlink to async_upnp_client.py should be removed, the symlink to dlna_dmr.py should be recreated as the file itself has moved.

Also, don't expect any changes in behavior. It was purely a refactoring/move-things-to-their-places change.

TheFuzz4 commented 6 years ago

where is the proper place to put the main folder that I pull down from git? I have it residing inside of /config since I'm running this as hassio. Thanks.

TheFuzz4 commented 6 years ago

Oh and I"m the 0.66.1 version of HA

StevenLooman commented 6 years ago

You should probably delete /config/custom_components/media_player/dlna_dmr.py and /config/custom_components/media_player/async_upnp_client.py.

Then, follow the instructions in the README. I.e., re-create dlna_dmr.py at the mentioned location.

TheFuzz4 commented 6 years ago

Ok cool sorry for the confusion sometimes I over think things. So this is the error that I get now with everything in the latest and greatest.

2018-04-05 21:28:40 ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.family_room fails Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 204, in async_update_ha_state yield from self.async_device_update() File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 325, in async_device_update yield from self.async_update() File "/config/custom_components/media_player/dlna_dmr.py", line 342, in async_update state = yield from self._async_poll_transport_info(get_transport_info_action) File "/config/custom_components/media_player/dlna_dmr.py", line 363, in _async_poll_transport_info result = yield from action.async_call(InstanceID=0) File "/config/deps/lib/python3.6/site-packages/async_upnp_client/async_upnp_client.py", line 400, in async_call yield from self.service._requester.async_http_request('POST', url, headers, body) File "/config/custom_components/media_player/dlna_dmr.py", line 238, in async_http_request response = yield from websession.request(method, url, headers=headers, data=body) File "/usr/lib/python3.6/site-packages/aiohttp/client.py", line 330, in _request resp = req.send(conn) File "/usr/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 508, in send writer.write_headers(status_line, self.headers) File "/usr/lib/python3.6/site-packages/aiohttp/http_writer.py", line 100, in write_headers self._write(headers) File "/usr/lib/python3.6/site-packages/aiohttp/http_writer.py", line 56, in _write raise asyncio.CancelledError('Cannot write to closing transport') concurrent.futures._base.CancelledError: Cannot write to closing transport 2018-04-05 21:28:40 ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall media_player.play_media: entity_id=['media_player.family_room'], media_content_id=http://192.168.7.2:8123/local/sounds/gf_clock/09-hour.mp3, media_content_type=music> Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/homeassistant/core.py", line 1002, in _event_to_service_call await service_handler.func(service_call) File "/usr/lib/python3.6/site-packages/homeassistant/components/media_player/__init__.py", line 402, in async_service_handler yield from getattr(player, method['method'])(**params) File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run result = self.fn(*self.args, **self.kwargs) File "/usr/lib/python3.6/site-packages/homeassistant/components/media_player/__init__.py", line 693, in play_media raise NotImplementedError() NotImplementedError

StevenLooman commented 6 years ago

Strange... I'm currently fairly busy with other things, but as soon as I have the time I'll look into it.

StevenLooman commented 6 years ago

Finally, I was able to find some time to work on this.

It seems that you are trying to play media from some other source. At this moment, this isn't supported but I'll look into it. It seems that you are trying to use Home Assistant as an alarm clock and/or announce the hour.

It is strange though, the component doesn't announce that it can play media (through supported_features), only that it can play/stop/pause. I would expect Home Assistant to filter this, and not raise an error.

StevenLooman commented 6 years ago

Ok, I have been working on this. It is fairly easy to make a DLNA DMR device (like your QueWifi speakers) play something. I'll commit this later.

The downside, however, is that - at least my Samsung TV - is fairly picky about where it is served from. A normal web server will not do, as there are some additional headers which need to be included for DLNA, and Range-capability, among things. Serving media from MiniDLNA should work. Serving it from Home Assistant itself will not.

When I enable the play_media feature, TTS shows up. Using this service gives a (local) URL to a MP3 which can be played. Given the above, serving it from Home Assistant will not work (missing headers, no Range capability.)

I was trying to create a pass-through service, such that one can use TTS. However, this might become a project in itself, which I'd rather not take on. I.e., for TTS only MP3 is used, but one might want to add video support as well? What about transcoding? etc etc etc

What do you think? And for what do you wish to use this?

TheFuzz4 commented 6 years ago

Hey There,

So I was hoping to have them function like they do with SmartThings like it does with this app https://github.com/SmartThingsUle/DLNA-PLAYER. Mainly I guess make them function like a cheap sonos with the ability to do TTS and also make a call to them to play a URL. I greatly appreciate your contribution to HA. As for the video I myself have no need to be able to play video just audio. I'm working on moving away from SmartThings and I use my speakers mainly for announcements in the house such as if one of my smoke alarms detects smoke/carbon dioxide. Or in the event its time for something to happen. Once again thank you very very much for this wonderful plug in and if there is anything I can do to assist with it please let me know. You rock .

StevenLooman commented 6 years ago

There are a few options:

  1. not doing anything, if the provided URL is not for a DLNA DMS (media server), you are on your own;
  2. build our own (partial) DLNA DMS;
  3. use an existing DLNA DMS, such as MiniDLNA.

Option 1 is very easy, but not very user friendly. TTS will not work, for example. But any given URL which points to a DLNA DMS will work.

Option 2 is very user friendly, but far from easy. Before I have something usable and tested, this will take a while. Even then, bugs will come and have to be resolved. Also, Home Assistant will become bloated when it is not really needed, to be honest. Given all the bug reports and feature requests in the repositories for the few DLNA DMS that are available, this is not a route I wish to take.

Option 3 is less user friendly, but far easier than option 2. We will depend on MiniDLNA to serve media to the device, if needed. If the given URL seems like it is served from a DLNA DMS, then we will pass it through (fairly easy to check.) If not, we (somehow) instruct MiniDLNA to serve the media we want and pass on the new URL (to the DLNA DMS) to the device. The downside is that we depend on the user to correctly set up MiniDLNA.

To make option 3 happen we need a way to let MiniDLNA know to pick up a file. Fortunately, MiniDLNA can monitor a directories. If we put a file in a user-configured directory, MiniDLNA should pick it up and we can pass on the URL to the device.

Is option 3 something you can work with?

TheFuzz4 commented 6 years ago

You bet I could work with that

On Mon, Apr 30, 2018, 2:29 PM Steven Looman notifications@github.com wrote:

There are a few options:

  1. not doing anything, if the provided URL is not for a DLNA DMS (media server), you are on your own;
  2. build our own (partial) DLNA DMS;
  3. use an existing DLNA DMS, such as MiniDLNA.

Option 1 is very easy, but not very user friendly. TTS will not work, for example. But any given URL which points to a DLNA DMS will work.

Option 2 is very user friendly, but far from easy. Before I have something usable and tested, this will take a while. Even then, bugs will come and have to be resolved. Also, Home Assistant will become bloated when it is not really needed, to be honest. Given all the bug reports and feature requests in the repositories for the few DLNA DMS that are available, this is not a route I wish to take.

Option 3 is less user friendly, but far easier than option 2. We will depend on MiniDLNA to serve media to the device, if needed. If the given URL seems like it is served from a DLNA DMS, then we will pass it through (fairly easy to check.) If not, we (somehow) instruct MiniDLNA to serve the media we want and pass on the new URL (to the DLNA DMS) to the device. The downside is that we depend on the user to correctly set up MiniDLNA.

To make option 3 happen we need a way to let MiniDLNA know to pick up a file. Fortunately, MiniDLNA can monitor a directories. If we put a file in a user-configured directory, MiniDLNA should pick it up and we can pass on the URL to the device.

Is option 3 something you can work with?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/StevenLooman/home-assistant-dlna-dmr/issues/3#issuecomment-385518950, or mute the thread https://github.com/notifications/unsubscribe-auth/AAT5Rd8POf6iUt3wgSB66v5Nk04MHaV_ks5tt3QXgaJpZM4RlVxn .

StevenLooman commented 6 years ago

I have added option 1 for now. You can try to set up MiniDLNA for now and try to stream something from it. TTS won't work.

StevenLooman commented 6 years ago

Well... option 3 won't work as MiniDLNA doesn't preserve filenames when you add files. I'll try to come up with something else.

In the mean time, your case might already work. Some players are less picky about the source where to stream the files from.

TheFuzz4 commented 6 years ago

Cool I'll give it a whirl here hopefully tonight. Thank you so much for doing this.

On Tue, May 1, 2018 at 1:11 PM, Steven Looman notifications@github.com wrote:

Well... option 3 won't work as MiniDLNA doesn't preserve filenames when you add files. I'll try to come up with something else.

In the mean time, your case might already work. Some players are less picky about the source where to stream the files from.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/StevenLooman/home-assistant-dlna-dmr/issues/3#issuecomment-385760859, or mute the thread https://github.com/notifications/unsubscribe-auth/AAT5RUEcv0MkKrDK_VJLw6L3JQpB5RY-ks5tuLNXgaJpZM4RlVxn .

-- Jason Hamilton

Webmaster of www.thefuzz4.net

We're going to be huge

StevenLooman commented 6 years ago

Any luck?

TheFuzz4 commented 6 years ago

I've been trying to figure out how to put minidlna into hassio. I'm wondering if I'm going to need to spinup a new instance of it somewhere on the vlan of where hassio is installed at. I'm also learning about how minidlna works as well. Sorry for the delay on this.

Jason

On Fri, May 11, 2018 at 1:36 PM, Steven Looman notifications@github.com wrote:

Any luck?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/StevenLooman/home-assistant-dlna-dmr/issues/3#issuecomment-388465090, or mute the thread https://github.com/notifications/unsubscribe-auth/AAT5RWbCXebOEnCIekGiboj2yqG_qAGUks5txehEgaJpZM4RlVxn .

-- Jason Hamilton

Webmaster of www.thefuzz4.net

We're going to be huge

StevenLooman commented 6 years ago

No problem. Your QueWifi might actually be able to play from non-DLNA devices. You can try your original setup/plan.

StevenLooman commented 6 years ago

Hi, just pushed a new version. This version does not need a proxy such as MiniDLNA. Can you try it?

If it does not work for you (I think you're trying to play files from within HomeAssistant?), then add this to your configuration:

picky_device: true

This option is for compatibility with certain devices. I.e., my Samsung TV is very picky about its sources.

TheFuzz4 commented 6 years ago

Yeah I am trying to play some files from HA. I'm pulling the code now will report back.

TheFuzz4 commented 6 years ago

Ok yeah I deleted my last comment because I thought I was doing something wrong. But I'm getting the following error:

2018-05-31 10:06:42 ERROR (MainThread) [homeassistant.setup] Error during setup of component media_player Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/homeassistant/setup.py", line 146, in _async_setup_component component.setup, hass, processed_config) # type: ignore AttributeError: module 'custom_components.media_player' has no attribute 'setup'

TheFuzz4 commented 6 years ago

Ok so I took the setup.py from the main dir and symlinked that into the media_player custom_component folder and guess what?.......Its working woohoo thank you so much. May I request a feature? Volume control if possible? Thank you thank you thank you

StevenLooman commented 6 years ago

Strange that you needed to symlink the setup.py. Not having that issue here... Which version of home-assistant are you running? Also, you only need dlna_dmr.py in your custom_components/media_player directory, not setup.py. Looking back, I see you have the same issue on April 1st.

Volume control should work, if your device supports it (and if it adheres to the DLNA 1.5 standard, it should.) The component reports features/functions to Home Assistant, if these are supported by your device. You've already sent the description.xml file, can you also send:

This might help me debug the issue further.

TheFuzz4 commented 6 years ago

Yeah I don't know why I needed to put that setup.py into that folder but it did fix it. I'm currently on HA 0.70 and I am running HASSIO since I'm using the Pi image that runs with docker and all that jazz.

endertransportSCPD.xml `This XML file does not appear to have any style information associated with it. The document tree is shown below.

1 0 GetCurrentTransportActions InstanceID in A_ARG_TYPE_InstanceID Actions out CurrentTransportActions GetDeviceCapabilities InstanceID in A_ARG_TYPE_InstanceID PlayMedia out PossiblePlaybackStorageMedia RecMedia out PossibleRecordStorageMedia RecQualityModes out PossibleRecordQualityModes GetMediaInfo InstanceID in A_ARG_TYPE_InstanceID NrTracks out NumberOfTracks MediaDuration out CurrentMediaDuration CurrentURI out AVTransportURI CurrentURIMetaData out AVTransportURIMetaData NextURI out NextAVTransportURI NextURIMetaData out NextAVTransportURIMetaData TrackSource out TrackSource PlayMedium out PlaybackStorageMedium RecordMedium out RecordStorageMedium WriteStatus out RecordMediumWriteStatus GetPositionInfo InstanceID in A_ARG_TYPE_InstanceID Track out CurrentTrack TrackDuration out CurrentTrackDuration TrackMetaData out CurrentTrackMetaData TrackURI out CurrentTrackURI RelTime out RelativeTimePosition AbsTime out AbsoluteTimePosition RelCount out RelativeCounterPosition AbsCount out AbsoluteCounterPosition GetTransportInfo InstanceID in A_ARG_TYPE_InstanceID CurrentTransportState out TransportState CurrentTransportStatus out TransportStatus CurrentSpeed out TransportPlaySpeed GetTransportSettings InstanceID in A_ARG_TYPE_InstanceID PlayMode out CurrentPlayMode RecQualityMode out CurrentRecordQualityMode Next InstanceID in A_ARG_TYPE_InstanceID Pause InstanceID in A_ARG_TYPE_InstanceID Play InstanceID in A_ARG_TYPE_InstanceID Speed in TransportPlaySpeed Previous InstanceID in A_ARG_TYPE_InstanceID Seek InstanceID in A_ARG_TYPE_InstanceID Unit in A_ARG_TYPE_SeekMode Target in A_ARG_TYPE_SeekTarget SetAVTransportURI InstanceID in A_ARG_TYPE_InstanceID CurrentURI in AVTransportURI CurrentURIMetaData in AVTransportURIMetaData Stop InstanceID in A_ARG_TYPE_InstanceID GetPlayType InstanceID in A_ARG_TYPE_InstanceID PlayType out PlayType GetInfoEx InstanceID in A_ARG_TYPE_InstanceID CurrentTransportState out TransportState CurrentTransportStatus out TransportStatus CurrentSpeed out TransportPlaySpeed Track out CurrentTrack TrackDuration out CurrentTrackDuration TrackMetaData out CurrentTrackMetaData TrackURI out CurrentTrackURI RelTime out RelativeTimePosition AbsTime out AbsoluteTimePosition RelCount out RelativeCounterPosition AbsCount out AbsoluteCounterPosition LoopMode out LoopMode CurrentVolume out CurrentVolume CurrentChannel out CurrentVolume SlaveList out SlaveList PlayMedium out PlaybackStorageMedium TrackSource out TrackSource InternetAccess out InternetAccess VerUpdateFlag out VerUpdateFlag VerUpdateStatus out VerUpdateStatus BatteryFlag out BatteryFlag BatteryPercent out BatteryPercent AlarmFlag out AlarmFlag SetPlayMode InstanceID in A_ARG_TYPE_InstanceID NewPlayMode in CurrentPlayMode TransportStatus string OK ERROR_OCCURRED CurrentTrackMetaData string RelativeCounterPosition i4 A_ARG_TYPE_InstanceID ui4 A_ARG_TYPE_SeekTarget string PlaybackStorageMedium string UNKNOWN CD-DA DVD-VIDEO HDD NETWORK NONE RelativeTimePosition string PossibleRecordStorageMedia string NOT_IMPLEMENTED CurrentPlayMode string NORMAL REPEAT_TRACK REPEAT_ALL NORMAL TransportPlaySpeed string 1 PossiblePlaybackStorageMedia string UNKNOWN CD-DA DVD-VIDEO HDD NETWORK NONE AbsoluteTimePosition string CurrentTrack ui4 0 65535 1 CurrentTrackURI string CurrentTransportActions string NumberOfTracks ui4 0 65535 AVTransportURI string AbsoluteCounterPosition i4 CurrentRecordQualityMode string NOT_IMPLEMENTED CurrentMediaDuration string A_ARG_TYPE_SeekMode string REL_TIME TRACK_NR AVTransportURIMetaData string RecordStorageMedium string NOT_IMPLEMENTED RecordMediumWriteStatus string NOT_IMPLEMENTED LastChange string CurrentTrackDuration string TransportState string STOPPED PAUSED_PLAYBACK PLAYING TRANSITIONING NO_MEDIA_PRESENT PossibleRecordQualityModes string NOT_IMPLEMENTED TransportRemote string PlayType string NextAVTransportURI string NextAVTransportURIMetaData string TrackSource string SlaveList string CurrentVolume ui4 LoopMode ui4 InternetAccess ui4 VerUpdateFlag ui4 VerUpdateStatus ui4 BatteryFlag ui4 BatteryPercent ui4 AlarmFlag ui4 ` renderconnmgrSCPD.xml `This XML file does not appear to have any style information associated with it. The document tree is shown below. 1 0 GetCurrentConnectionIDs ConnectionIDs out CurrentConnectionIDs GetCurrentConnectionInfo ConnectionID in A_ARG_TYPE_ConnectionID RcsID out A_ARG_TYPE_RcsID AVTransportID out A_ARG_TYPE_AVTransportID ProtocolInfo out A_ARG_TYPE_ProtocolInfo PeerConnectionManager out A_ARG_TYPE_ConnectionManager PeerConnectionID out A_ARG_TYPE_ConnectionID Direction out A_ARG_TYPE_Direction Status out A_ARG_TYPE_ConnectionStatus GetProtocolInfo Source out SourceProtocolInfo Sink out SinkProtocolInfo A_ARG_TYPE_ConnectionManager string SinkProtocolInfo string A_ARG_TYPE_ConnectionStatus string OK ContentFormatMismatch InsufficientBandwidth UnreliableChannel Unknown A_ARG_TYPE_AVTransportID i4 A_ARG_TYPE_Direction string Input Output A_ARG_TYPE_RcsID i4 A_ARG_TYPE_ProtocolInfo string A_ARG_TYPE_ConnectionID i4 SourceProtocolInfo string CurrentConnectionIDs string ` rendercontrolSCPD.xml `This XML file does not appear to have any style information associated with it. The document tree is shown below. 1 0 GetMute InstanceID in A_ARG_TYPE_InstanceID Channel in A_ARG_TYPE_Channel CurrentMute out Mute GetVolume InstanceID in A_ARG_TYPE_InstanceID Channel in A_ARG_TYPE_Channel CurrentVolume out Volume GetChannel InstanceID in A_ARG_TYPE_InstanceID Channel in A_ARG_TYPE_Channel CurrentChannel out Channel GetEqualizer InstanceID in A_ARG_TYPE_InstanceID Channel in A_ARG_TYPE_Channel CurrentEqualizer out Equalizer ListPresets InstanceID in A_ARG_TYPE_InstanceID CurrentPresetNameList out PresetNameList SelectPreset InstanceID in A_ARG_TYPE_InstanceID PresetName in A_ARG_TYPE_PresetName SetMute InstanceID in A_ARG_TYPE_InstanceID Channel in A_ARG_TYPE_Channel DesiredMute in Mute SetVolume InstanceID in A_ARG_TYPE_InstanceID Channel in A_ARG_TYPE_Channel DesiredVolume in Volume SetChannel InstanceID in A_ARG_TYPE_InstanceID Channel in A_ARG_TYPE_Channel DesiredChannel in Channel SetEqualizer InstanceID in A_ARG_TYPE_InstanceID Channel in A_ARG_TYPE_Channel DesiredEqualizer in Equalizer GetControlDeviceInfo InstanceID in A_ARG_TYPE_InstanceID MultiType out MultiRoomType Router out Router Ssid out Ssid SlaveMask out SlaveMask CurrentVolume out Volume CurrentMute out Mute CurrentChannel out Channel SlaveList out SlaveList Status out Status MultiPlaySlaveMask InstanceID in A_ARG_TYPE_InstanceID SlaveMask in SlaveMask SetAlarmQueue AlarmContext in AlarmContext GetAlarmQueue AlarmName in AlarmName AlarmContext out AlarmContext DeleteAlarmQueue AlarmName in AlarmName SetDeviceName Name in AlarmName Volume ui2 0 100 1 A_ARG_TYPE_InstanceID ui4 A_ARG_TYPE_PresetName string FactoryDefaults InstallationDefaults Mute boolean LastChange string A_ARG_TYPE_Channel string Master Single PresetNameList string Channel ui2 Equalizer ui2 SlaveList string Status string Router string SlaveMask ui4 MultiRoomType ui4 Ssid string AlarmName string AlarmContext string `
TheFuzz4 commented 6 years ago

Yikes that did not paste nicely

StevenLooman commented 6 years ago

Thats ok, I can probably re-format it on my side. Thank you for posting this, I'll check it out later.

StevenLooman commented 6 years ago

I've added debug statements in methods regarding volume (and mute.) Can you checkout the branch thefuzz4_debug (or download and use this file), and add the following to your Home Assistant-configuration:

logger:
  default: warning
  logs:
    custom_components.media_player.dlna_dmr: debug
    async_upnp_client.async_upnp_client: debug
    async_upnp_client.async_upnp_client.traffic: info

This will disable most messages from Home Assistant, but enable messages from the this component and the UPnP client itself. You can probably find the messages in a log file.

If you've updated the component and added this to your configuration, please run Home Assistant and test/play a bit (try get/set volume), play a file, etc and post the output here.

If the output is too long, please upload a file.

StevenLooman commented 6 years ago

I have created a pull request to integrate this component in Home Assistant directly. Hopefully, this will be accepted and you no longer need to install this component manually soon.

TheFuzz4 commented 6 years ago

Dude you are so totally awesome thank you so much for your code on this. I apologize I haven't had a moment yet to pull the dev branch you created for me. Kids out of school so priorities shifted a little bit. I do intend to go pull it though. Just the fact that I now basically have a poor man's Sonos is now awesome. I've got my Grandfather chimes and my morning and evening colors playing daily on all of my speakers (I have 3 at the moment, but now intend to buy more) is just awesome. Family thinks I'm a nerd but hey thats what we do. Once again thank you for doing this.

On Sun, Jun 10, 2018 at 6:01 AM, Steven Looman notifications@github.com wrote:

I have created a pull request to integrate this component in Home Assistant directly. Hopefully, this will be accepted and you no longer need to install this component manually soon.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/StevenLooman/home-assistant-dlna-dmr/issues/3#issuecomment-396043568, or mute the thread https://github.com/notifications/unsubscribe-auth/AAT5RRhYISqk490zz-aSrxc7Dqxku9Q0ks5t7QqRgaJpZM4RlVxn .

-- Jason Hamilton

Webmaster of www.thefuzz4.net

We're going to be huge

TheFuzz4 commented 6 years ago

Hey Steve, Awesome work on the pull request. So I pulled that one down and when HA starts the speakers are there with a new name (HA added _2 to them) but they're not responding to any commands.

So I reverted back to the old code that has been working but now I'm getting this in the logs

2018-08-19 22:28:32 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/media_player/dlna_dmr.py", line 175, in start_proxy_view hass.http.register_view(view) File "/usr/src/app/homeassistant/components/http/__init__.py", line 259, in register_view view.register(self.app, self.app.router) TypeError: register() takes 2 positional arguments but 3 were given 2018-08-19 22:28:32 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/media_player/dlna_dmr.py", line 162, in start_notify_view hass.http.register_view(view) File "/usr/src/app/homeassistant/components/http/__init__.py", line 259, in register_view view.register(self.app, self.app.router) TypeError: register() takes 2 positional arguments but 3 were given

Thank you for all the awesome work you've done to get this as a main part of HA. I know everyone will love it.

StevenLooman commented 6 years ago

Hi TheFuzz. From Home Assistant 0.76, this component has been integrated. Please do:

If the problem persists, add some logging to your home assistant configuration and report what it is showing. The following can be added to your configuration.yaml:

logger:
  default: warning
  logs:
    homeassistant.components.discovery: debug
    homeassistant.components.media_player.dlna_dmr: debug
    async_upnp_client: debug
    async_upnp_client.dlna: debug
    async_upnp_client.traffic: info
TheFuzz4 commented 6 years ago

Awesome sauce I didn't catch that in the release notes. I will change my configs once I get a moment this morning. Congrats on the pull

On Mon, Aug 20, 2018, 1:26 AM Steven Looman notifications@github.com wrote:

Hi TheFuzz. From Home Assistant 0.76, this component has been integrated. Please do:

  • Upgrade to the latest version of Home Assistant (0.76.1 at the time of writing);
  • Do remove the custom component;
  • Restart.

If the problem persists, add some logging to your home assistant configuration and report what it is showing. The following can be added to your configuration.yaml: logger: default: warning logs: homeassistant.components.discovery: debug homeassistant.components.media_player.dlna_dmr: debug async_upnp_client: debug async_upnp_client.dlna: debug async_upnp_client.traffic: info

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/StevenLooman/home-assistant-dlna-dmr/issues/3#issuecomment-414222053, or mute the thread https://github.com/notifications/unsubscribe-auth/AAT5RVxSnprdFwW_rMZedOL0_4K3h88Jks5uSmSngaJpZM4RlVxn .

TheFuzz4 commented 6 years ago

Ok removed the custom module from HA and upon restart it now throws this:

2018-08-20 09:22:09 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform dlna_dmr Traceback (most recent call last): File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform SLOW_SETUP_MAX_WAIT, loop=hass.loop) File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for return fut.result() File "/usr/src/app/homeassistant/components/media_player/dlna_dmr.py", line 138, in async_setup_platform from async_upnp_client.aiohttp import AiohttpSessionRequester ModuleNotFoundError: No module named 'async_upnp_client.aiohttp' 2018-08-20 09:22:09 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform dlna_dmr Traceback (most recent call last): File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform SLOW_SETUP_MAX_WAIT, loop=hass.loop) File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for return fut.result() File "/usr/src/app/homeassistant/components/media_player/dlna_dmr.py", line 138, in async_setup_platform from async_upnp_client.aiohttp import AiohttpSessionRequester ModuleNotFoundError: No module named 'async_upnp_client.aiohttp'

I"m on 0.76.1 version of HA running inside of Docker. Thanks for the help Steve.

Jason

StevenLooman commented 6 years ago

Congrats on the pull

Thanks!

It seems your setup is using an old package of async_upnp_client. Did you also delete delete everything of the custom components?

Otherwise, maybe you can manually remove async_upnp_client from the Docker container. Not sure, not using Docker in my own setup.

TheFuzz4 commented 6 years ago

Let me do a find and see what it returns. But yeah I removed every trace of the old dlna component thinking that it was some library referenced somewhere.

EDIT: Here are the results of the find find . | grep async_upnp_client ./deps/lib/python3.6/site-packages/async_upnp_client-0.10.0.dist-info ./deps/lib/python3.6/site-packages/async_upnp_client-0.10.0.dist-info/metadata.json ./deps/lib/python3.6/site-packages/async_upnp_client-0.10.0.dist-info/DESCRIPTION.rst ./deps/lib/python3.6/site-packages/async_upnp_client-0.10.0.dist-info/top_level.txt ./deps/lib/python3.6/site-packages/async_upnp_client-0.10.0.dist-info/METADATA ./deps/lib/python3.6/site-packages/async_upnp_client-0.10.0.dist-info/RECORD ./deps/lib/python3.6/site-packages/async_upnp_client-0.10.0.dist-info/WHEEL ./deps/lib/python3.6/site-packages/async_upnp_client-0.10.0.dist-info/INSTALLER ./deps/lib/python3.6/site-packages/async_upnp_client ./deps/lib/python3.6/site-packages/async_upnp_client/__pycache__ ./deps/lib/python3.6/site-packages/async_upnp_client/__pycache__/aiohttp_requester.cpython-36.pyc ./deps/lib/python3.6/site-packages/async_upnp_client/__pycache__/__init__.cpython-36.pyc ./deps/lib/python3.6/site-packages/async_upnp_client/__pycache__/async_upnp_client.cpython-36.pyc ./deps/lib/python3.6/site-packages/async_upnp_client/__init__.py ./deps/lib/python3.6/site-packages/async_upnp_client/aiohttp_requester.py ./deps/lib/python3.6/site-packages/async_upnp_client/async_upnp_client.py

Not sure if these belong or if they're bogus. They're all located within my config dir. Guess best thing I can do is make a copy of that dir somewhere and see what happens when I blow it away.

TheFuzz4 commented 6 years ago

Ok so I moved those async libraries out and it looks like we're back in business with no volume control.

2018-08-20 16:24:07 DEBUG (MainThread) [async_upnp_client.dlna] Got no value for volume_level 2018-08-20 16:24:07 DEBUG (MainThread) [async_upnp_client.dlna] Got no value for volume_mute 2018-08-20 16:24:07 DEBUG (MainThread) [async_upnp_client.dlna] Got no value for volume_level 2018-08-20 16:24:07 DEBUG (MainThread) [async_upnp_client.dlna] Got no value for volume_mute 2018-08-20 16:24:16 DEBUG (MainThread) [async_upnp_client.dlna] Got no value for volume_level 2018-08-20 16:24:16 DEBUG (MainThread) [async_upnp_client.dlna] Got no value for volume_mute 2018-08-20 16:24:16 DEBUG (MainThread) [async_upnp_client.dlna] Got no value for volume_level 2018-08-20 16:24:16 DEBUG (MainThread) [async_upnp_client.dlna] Got no value for volume_mute 2018-08-20 16:24:16 DEBUG (MainThread) [async_upnp_client.dlna] Got no value for volume_level 2018-08-20 16:24:16 DEBUG (MainThread) [async_upnp_client.dlna] Got no value for volume_mute 2018-08-20 16:24:16 DEBUG (MainThread) [async_upnp_client.dlna] Got no value for volume_level 2018-08-20 16:24:16 DEBUG (MainThread) [async_upnp_client.dlna] Got no value for volume_mute

Thats all I see in the logs. Also need to update the docs that if you're using docker you must expose port 8301. You can expose it with -p 8301:8301 (Or whatever port you want)

StevenLooman commented 6 years ago

Good point about exposing the port. I'll create a pull request for the documentation.

The message Got no value for volume_mute is raised when no events are have been received. UPnP allows for devices to send events to the subscriber (home assistant in this case.) This is also the reason that the exposed port is necessary.

Is this message still appearing when you have exposed the port? Also, in the logs there should be a message which states on what (http-) URL it is listening for events. Is this URL reachable from the devices? Can you show me the URL?

I have been thinking about making async_upnp_client poll when no events have been received. So far it always turned out that either there was a problem on our side (bug in software, firewall, etc.) Maybe I should change it...

TheFuzz4 commented 6 years ago

So I thought I had seen in the past where it did bind successfully after opening that port to the container.
2018-08-21 09:02:29 ERROR (MainThread) [async_upnp_client.aiohttp] Failed to create HTTP server at 192.168.7.43:8301: [Errno 99] error while attempting to bind on address ('192.168.7.43', 8301): cannot assign requested address 2018-08-21 09:02:29 INFO (MainThread) [homeassistant.components.media_player.dlna_dmr] UPNP/DLNA event handler listening on: http://192.168.7.43:8301/notify 2018-08-21 09:02:29 DEBUG (MainThread) [homeassistant.components.media_player.dlna_dmr] Adding device: <Entity Outside Speaker: off> 2018-08-21 09:02:29 DEBUG (MainThread) [async_upnp_client.dlna] Subscribing to service: <UpnpService(urn:upnp-org:serviceId:AVTransport, uuid:72dc092a-1dd2-11b2-a719-b170cc18732a)> 2018-08-21 09:02:30 DEBUG (MainThread) [async_upnp_client] Subscribing to: <UpnpService(urn:upnp-org:serviceId:AVTransport, uuid:72dc092a-1dd2-11b2-a719-b170cc18732a)>, callback URL: http://192.168.7.43:8301/notify 2018-08-21 09:02:30 DEBUG (MainThread) [async_upnp_client] Got SID: uuid:086169fe-1dd2-11b2-bba2-d0c70226ec85, renewal_time: 2018-08-21 09:32:30.129634 2018-08-21 09:02:30 DEBUG (MainThread) [async_upnp_client.dlna] Subscribing to service: <UpnpService(urn:upnp-org:serviceId:RenderingControl, uuid:72dc092a-1dd2-11b2-a719-b170cc18732a)> 2018-08-21 09:02:30 DEBUG (MainThread) [async_upnp_client] Subscribing to: <UpnpService(urn:upnp-org:serviceId:RenderingControl, uuid:72dc092a-1dd2-11b2-a719-b170cc18732a)>, callback URL: http://192.168.7.43:8301/notify 2018-08-21 09:02:30 DEBUG (MainThread) [homeassistant.components.media_player.dlna_dmr] Adding device: <Entity Family Room Speaker: off> 2018-08-21 09:02:30 DEBUG (MainThread) [async_upnp_client.dlna] Subscribing to service: <UpnpService(urn:upnp-org:serviceId:AVTransport, uuid:72cf7dea-1dd2-11b2-9c94-df9e5b210b3b)> 2018-08-21 09:02:30 DEBUG (MainThread) [async_upnp_client] Subscribing to: <UpnpService(urn:upnp-org:serviceId:AVTransport, uuid:72cf7dea-1dd2-11b2-9c94-df9e5b210b3b)>, callback URL: http://192.168.7.43:8301/notify 2018-08-21 09:02:30 DEBUG (MainThread) [async_upnp_client] Got SID: uuid:3969e8be-1dd2-11b2-a9a7-ac98bac32cfd, renewal_time: 2018-08-21 09:32:30.998979 2018-08-21 09:02:30 DEBUG (MainThread) [async_upnp_client.dlna] Subscribing to service: <UpnpService(urn:upnp-org:serviceId:RenderingControl, uuid:72cf7dea-1dd2-11b2-9c94-df9e5b210b3b)> 2018-08-21 09:02:31 DEBUG (MainThread) [async_upnp_client] Subscribing to: <UpnpService(urn:upnp-org:serviceId:RenderingControl, uuid:72cf7dea-1dd2-11b2-9c94-df9e5b210b3b)>, callback URL: http://192.168.7.43:8301/notify 2018-08-21 09:02:35 DEBUG (MainThread) [homeassistant.components.media_player.dlna_dmr] Could not (re)subscribe 2018-08-21 09:02:36 DEBUG (MainThread) [homeassistant.components.media_player.dlna_dmr] Could not (re)subscribe So that is the correct IP address of the HOST that docker is running on so it does pull it. But I wonder if it should be pulling the IP of the container and thats why its failing because of the fact that the subnet of docker is 172 and not the 192.

Ok going to try and set the IP and see what happens when I set it to the docker IP of the container.

Alright scratch that I actually was telling it which IP to bind to in the config. So removed that from the config. So now we get 2018-08-21 09:12:27 INFO (MainThread) [homeassistant.components.media_player.dlna_dmr] UPNP/DLNA event handler listening on: http://172.17.0.2:8301/notify 2018-08-21 09:12:27 DEBUG (MainThread) [homeassistant.components.media_player.dlna_dmr] Adding device: <Entity Family Room Speaker: off> 2018-08-21 09:12:27 DEBUG (MainThread) [async_upnp_client.dlna] Subscribing to service: <UpnpService(urn:upnp-org:serviceId:AVTransport, uuid:72cf7dea-1dd2-11b2-9c94-df9e5b210b3b)> 2018-08-21 09:12:27 DEBUG (MainThread) [async_upnp_client] Subscribing to: <UpnpService(urn:upnp-org:serviceId:AVTransport, uuid:72cf7dea-1dd2-11b2-9c94-df9e5b210b3b)>, callback URL: http://172.17.0.2:8301/notify 2018-08-21 09:12:27 DEBUG (MainThread) [async_upnp_client] Got SID: uuid:9d09e85a-1dd1-11b2-a9a9-ac98bac32cfd, renewal_time: 2018-08-21 09:42:27.647649 2018-08-21 09:12:27 DEBUG (MainThread) [async_upnp_client.dlna] Subscribing to service: <UpnpService(urn:upnp-org:serviceId:RenderingControl, uuid:72cf7dea-1dd2-11b2-9c94-df9e5b210b3b)> 2018-08-21 09:12:27 DEBUG (MainThread) [async_upnp_client] Subscribing to: <UpnpService(urn:upnp-org:serviceId:RenderingControl, uuid:72cf7dea-1dd2-11b2-9c94-df9e5b210b3b)>, callback URL: http://172.17.0.2:8301/notify 2018-08-21 09:12:28 DEBUG (MainThread) [homeassistant.components.media_player.dlna_dmr] Adding device: <Entity Outside Speaker: off> 2018-08-21 09:12:28 DEBUG (MainThread) [async_upnp_client.dlna] Subscribing to service: <UpnpService(urn:upnp-org:serviceId:AVTransport, uuid:72dc092a-1dd2-11b2-a719-b170cc18732a)> 2018-08-21 09:12:28 DEBUG (MainThread) [async_upnp_client] Subscribing to: <UpnpService(urn:upnp-org:serviceId:AVTransport, uuid:72dc092a-1dd2-11b2-a719-b170cc18732a)>, callback URL: http://172.17.0.2:8301/notify 2018-08-21 09:12:28 DEBUG (MainThread) [async_upnp_client] Got SID: uuid:6ccd7436-1dd2-11b2-bba2-d0c70226ec85, renewal_time: 2018-08-21 09:42:28.114416 2018-08-21 09:12:28 DEBUG (MainThread) [async_upnp_client.dlna] Subscribing to service: <UpnpService(urn:upnp-org:serviceId:RenderingControl, uuid:72dc092a-1dd2-11b2-a719-b170cc18732a)> 2018-08-21 09:12:28 DEBUG (MainThread) [async_upnp_client] Subscribing to: <UpnpService(urn:upnp-org:serviceId:RenderingControl, uuid:72dc092a-1dd2-11b2-a719-b170cc18732a)>, callback URL: http://172.17.0.2:8301/notify 2018-08-21 09:12:32 DEBUG (MainThread) [homeassistant.components.media_player.dlna_dmr] Could not (re)subscribe Then further down we have 2018-08-21 09:12:53 DEBUG (MainThread) [async_upnp_client.dlna] Resubscribing to service: <UpnpService(urn:upnp-org:serviceId:AVTransport, uuid:72cf7dea-1dd2-11b2-9c94-df9e5b210b3b)> 2018-08-21 09:12:53 DEBUG (MainThread) [async_upnp_client] Resubscribing to: <UpnpService(urn:upnp-org:serviceId:AVTransport, uuid:72cf7dea-1dd2-11b2-9c94-df9e5b210b3b)> 2018-08-21 09:12:53 DEBUG (MainThread) [async_upnp_client.dlna] Resubscribing to service: <UpnpService(urn:upnp-org:serviceId:AVTransport, uuid:72dc092a-1dd2-11b2-a719-b170cc18732a)> 2018-08-21 09:12:53 DEBUG (MainThread) [async_upnp_client] Resubscribing to: <UpnpService(urn:upnp-org:serviceId:AVTransport, uuid:72dc092a-1dd2-11b2-a719-b170cc18732a)> 2018-08-21 09:12:53 DEBUG (MainThread) [async_upnp_client.dlna] Got no value for volume_level 2018-08-21 09:12:53 DEBUG (MainThread) [async_upnp_client.dlna] Got no value for volume_mute 2018-08-21 09:12:53 DEBUG (MainThread) [async_upnp_client.dlna] Got no value for volume_level 2018-08-21 09:12:53 DEBUG (MainThread) [async_upnp_client.dlna] Got no value for volume_mute 2018-08-21 09:12:53 DEBUG (MainThread) [async_upnp_client] Got SID: uuid:9d09e85a-1dd1-11b2-a9a9-ac98bac32cfd, renewal_time: 2018-08-21 09:42:53.719704 2018-08-21 09:12:53 DEBUG (MainThread) [async_upnp_client.dlna] Subscribing to service: <UpnpService(urn:upnp-org:serviceId:RenderingControl, uuid:72cf7dea-1dd2-11b2-9c94-df9e5b210b3b)> 2018-08-21 09:12:53 DEBUG (MainThread) [async_upnp_client] Subscribing to: <UpnpService(urn:upnp-org:serviceId:RenderingControl, uuid:72cf7dea-1dd2-11b2-9c94-df9e5b210b3b)>, callback URL: http://172.17.0.2:8301/notify 2018-08-21 09:12:53 DEBUG (MainThread) [async_upnp_client] Got SID: uuid:6ccd7436-1dd2-11b2-bba2-d0c70226ec85, renewal_time: 2018-08-21 09:42:53.728234 2018-08-21 09:12:53 DEBUG (MainThread) [async_upnp_client.dlna] Subscribing to service: <UpnpService(urn:upnp-org:serviceId:RenderingControl, uuid:72dc092a-1dd2-11b2-a719-b170cc18732a)> 2018-08-21 09:12:53 DEBUG (MainThread) [async_upnp_client] Subscribing to: <UpnpService(urn:upnp-org:serviceId:RenderingControl, uuid:72dc092a-1dd2-11b2-a719-b170cc18732a)>, callback URL: http://172.17.0.2:8301/notify 2018-08-21 09:12:53 DEBUG (MainThread) [async_upnp_client] Got SID: uuid:ac99837a-1dd1-11b2-a9a9-ac98bac32cfd, renewal_time: 2018-08-21 09:42:53.764108 2018-08-21 09:12:53 DEBUG (MainThread) [async_upnp_client.dlna] Got no value for volume_level 2018-08-21 09:12:53 DEBUG (MainThread) [async_upnp_client.dlna] Got no value for volume_mute 2018-08-21 09:12:53 DEBUG (MainThread) [async_upnp_client] Got SID: uuid:7c1a2e34-1dd2-11b2-bba2-d0c70226ec85, renewal_time: 2018-08-21 09:42:53.783137 2018-08-21 09:12:53 DEBUG (MainThread) [async_upnp_client.dlna] Got no value for volume_level 2018-08-21 09:12:53 DEBUG (MainThread) [async_upnp_client.dlna] Got no value for volume_mute Then it repeats a lot about not getting a value for the volume Then lastly when I attempt to call the service to play a file or TTS it throws 2018-08-21 09:14:21 DEBUG (MainThread) [async_upnp_client.dlna] Set transport uri: http://192.168.7.43:8123/api/tts_proxy/982e0a9f9a792d2bfc70da32bf8d23e3db5433a3_en_-_google.mp3 2018-08-21 09:14:31 DEBUG (MainThread) [async_upnp_client.dlna] break out of waiting game

I'm more than willing to tinker with whatever you need me to since I do use docker for this I'll gladly be your test bed. Thanks Steve.

Jason

EDIT: As I sit here I'm wondering if we do need like a docker flag or something. So with HA with the HTTP config for those of us using docker we have to set a flag in there for the bind_url where we then specify the actual URL of the device. This way HA advertises that to everything instead of the docker IP in the URL. Perhaps if we specify the bind_ip in the config it just accepts it as the source of truth and doesn't validate that it was actually able to bind it.
I wish I knew how to code more as I'd love to sling some around in my instance to help troubleshoot this. But sadly I'm just a DevOps engineer who scripts in bash all day 👍 Granted I've been dabbing with python as of late as I'm learning appdaemon but I'm no where near fluent enough yet.

TheFuzz4 commented 6 years ago

So more work done. I changed docker to use the host network stack. Huge changes by this all for the better as my discovery of devices is now working properly by doing this its now setting up the bindings and I don't need to specify exposing the port directly like in the past. Of course that will still apply for users who do need to manually specify ports. So things that are now working:

  1. Volume control
  2. No more logs about not able to do volume related things

Not working

  1. Still am not able to do TTS or other play media commands the logs have 2018-08-21 10:36:34 DEBUG (MainThread) [async_upnp_client.dlna] Set transport uri: http://192.168.7.43:8123/api/tts_proxy/982e0a9f9a792d2bfc70da32bf8d23e3db5433a3_en_-_google.mp3 2018-08-21 10:36:39 DEBUG (MainThread) [async_upnp_client.dlna] break out of waiting game 2018-08-21 10:36:39 DEBUG (MainThread) [homeassistant.components.media_player.dlna_dmr] Cannot do Play
StevenLooman commented 6 years ago

Great work! Thank you for documenting this, hopefully it is helpful for others.

I think most - if not all - discovery of devices will work better (or maybe only) when docker uses your host network. Discovery of DLNA DMR devices must be opted-in however (see https://github.com/home-assistant/home-assistant/pull/16006).

About the TTS. Your device might not be able to use the home assistant webserver as a valid DLNA source. My TV (Samsung) won't accept it, unless I add specific headers. I added a some kind of work-around before, but it got rejected from the pull request. My music player (PiMusicbox) accepts it without any problems.

Following the log messages, this is what is happening:

You can try to set up MiniDLNA (if running from docker, be sure to use your host-network) and play from there.

TheFuzz4 commented 6 years ago

Thanks Steve for the update. Oddly enough with your previous version of code I was able to do TTS and specify mp3 files for them to play. Up until this week they were chiming along with my grandfather clock appdaemon code just fine. Hmm I'll take a look a the minidlna and see what happens with that. Just weird that it was working :) and now no love. Thank you for the response.

Jason

EDIT: I guess my reading comprehension isn't working today. I just reread and saw that the work around was rejected from the pull. Will update with the MiniDLNA and see what it does.

TheFuzz4 commented 6 years ago

Ok so I can map the dir of the TTS folder and the other audio I use and then in my appdaemon tell it to pass the location of the audio through the dlna server so that will fix my clock chimes and other things.

How do you TTS with a dlna server? Since the logs show that it passes the location of the TTS to the speaker with the HA port.

Actually better yet how do I figure out what the path is for the files. I'm digging around as I think that I can just tell HA to play the path from the dlna server with the file location. Was hoping it was as easy as http://server:port/path but I'm getting the impression there is a little more involved than that.

StevenLooman commented 6 years ago

Sorry, TTS won't be possible with MiniDLNA. It was more a test to see if it would work at all.

You can use VLC to locate your DLNA server (DLNA DMS actually) and find an URL. On Ubuntu 16.04 I need to disable IPv6 however, see this answer on StackOverflow. In VLC you can then find your DLNA server (hopefully) in the "Universal Plug'n'Play" section in Local Network.

Another option is BubbleUPnP, if you have a phone running Android.

If you have a path (e.g., for me, http://192.168.1.13:8200/MediaItems/43.mp3), then, in Home Asistant, at the Developer Tools/services, you can call the media_player.play_media service with the URL (among things.)

TheFuzz4 commented 6 years ago

Hey Steve so we can close this one out. I ended up getting a chromecast audio today and plugged it into the unit via the aux port. Not being able to do tts and play straight from HA is kinda bummer. Not your fault at all as I understand the limits of the pull request. Which is freaking awesome. So with the chromecast audio I'm back to having the speaker working like I wanted it to. The good news is I got these on sale a couple years ago for dirt cheap so not a total loss. Thank you for all of your help over the months with this issue. At this time I'm going to mark this issue as closed because you're a rock star.

StevenLooman commented 6 years ago

Cheers! Thanks for your testing!