Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lg_soundbar without discovery #23752

Closed
darootler opened this issue May 8, 2019 · 38 comments
Closed

lg_soundbar without discovery #23752

darootler opened this issue May 8, 2019 · 38 comments

Comments

@darootler
Copy link

darootler commented May 8, 2019

Home Assistant release with the issue:
hassos: "2.11"
homeassistant: 0.92.2
machine: raspberrypi3
supervisor: "162"

Operating environment (Hass.io/Docker/Windows/etc.):
Hass.io

Component/platform:
lg_soundbar

Description of problem:
I am using a LG SK6F soundbar. Hassio and the soundbar are both on different subnets. This is for security reasons.

It would be nice if there would be an option to configure the soundbar manually with ip/port without having discovery enabled.

@cgtobi
Copy link
Contributor

cgtobi commented May 8, 2019

Please use the issue template.

@darootler
Copy link
Author

Done.

Regards
Richard

@SNoof85
Copy link
Contributor

SNoof85 commented May 10, 2019

I will give a try to support static config but as i have no LG Soundbar i'll need you to test the new version as custom component for example.
And btw how much soundbars do you have ? Only 1 ?

@darootler
Copy link
Author

Yes, i will test a new custom version. I have one LG SK6F soundbar.

Regards

@SNoof85
Copy link
Contributor

SNoof85 commented May 10, 2019

Can you please try this as custom component : https://github.com/SNoof85/home-assistant/tree/dev/homeassistant/components/lg_soundbar

Add config into your configuration.yaml

media_player:
  - platform: lg_soundbar
    host: <ip of the soundbar>
    port: <port to use>

Hope i did it correct (i'm not an expert !). Would be nice also if you could try it with discovery first (with soundbar on same net that your HA instance), then with fixed config (soundbar different network if you want to) and report.
Thx

PS : you need to place all 3 files into <config_dir_of_ha>/custom_components/lg_soundbar/

@darootler
Copy link
Author

I already tried a similar solution like yours. It seems like "add_entities" needs some information from discovery, but i am not an expert too :-)

I does not work and i think you need an "else" after "if discovery_info:". No error logs and no entity added.

Regards
Richard

@SNoof85
Copy link
Contributor

SNoof85 commented May 10, 2019

There was missing import 🗡
Try again ? :)

@darootler
Copy link
Author

darootler commented May 10, 2019

2019-05-10 23:54:24 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform lg_soundbar
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/lg_soundbar/media_player.py", line 38, in setup_platform
    add_entities([LGDevice(hass, host, port)], True)
TypeError: __init__() takes 3 positional arguments but 4 were given

@SNoof85
Copy link
Contributor

SNoof85 commented May 10, 2019

Sorry again a stupid mistake. Fixed.

@darootler
Copy link
Author

darootler commented May 11, 2019

It's adding a media player, but you cannot change the source:

image

Also changing the sound mode is very buggy. And changing the volume is also not possible.

Regards

@SNoof85
Copy link
Contributor

SNoof85 commented May 12, 2019

ok, so it's either a bug with the test component or the original was also buggy.
Did you managed to make the original component working with discovery ? and if yes was it also buggy ?

On my side if i just configure a lg soundbar within my config with the IP of my TV i have the same than yours but...it's a TV not an LG soundbar. It's a bit hard for me to test.

Could you try to set your soundbar in the same subnet that home assistant and test the custom component ? If it works, we would then exclude any network communication bug.

@darootler
Copy link
Author

Yes, the original component is working with the exception that "Optical/HDMI ARC" is not shown in the gui if selected:

image
image

Volume, source and sound mode is changeable.

The soundbar is on the same subnet as HA because the original component is not working if the soundbar is on different subnet.

As i said i think "add_entities" is expecting a discovery object, mine looks like this:

{'host': '192.168.6.3', 'port': 9741, 'hostname': 'Chromecast.local.', 'properties': {'PROTO_VER': '1.0', 'UUID': 'de85605e-68f4-4e83-9b28-474ee7315596'}

Regards
Richard

@SNoof85
Copy link
Contributor

SNoof85 commented May 12, 2019

Yes we have to find these missing properties as i just pass host and port in the new version component. Thx for the detailed report of the discovery info object. Will try to get a look at this.

The temescal lib is only waiting for host and port. Wich are passed to the class LGDevice in the component (stable and tested one).

Don't want to doubt on your knowledge but what did you wrote in your config ? It should be this :

media_player:
  - platform: lg_soundbar
    host: 192.168.6.3
    port: 9741

@stale
Copy link

stale bot commented Aug 10, 2019

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 10, 2019
@darootler
Copy link
Author

@SNoof85

Any progress?

Regards
Richard

@stale stale bot removed the stale label Aug 10, 2019
@SNoof85
Copy link
Contributor

SNoof85 commented Aug 11, 2019

Hey, sorry no, have no time yet to try it again. Also, i don't have this hardware at home and it's hard to find out without. On top of this I'm afraid that I've reached my maximum level at home assistant/python dev.
I'm sorry but i won't be able to help more on this. If someone here is using an LG soundbar and with better knowledge than me can help it would be nice.

@amonhk
Copy link

amonhk commented Sep 17, 2019

same problem that got worse after updating my SK10Y soundbar
2019-09-17_15-01-49

  • the device is not saved permanently, it is always detected without a name by discovery
  • does not display the list of sources but by calling the service with the right name (HDMI, Optical, ...) I can change the source (not always)

I think the problem is in the code that the component uses https://github.com/google/python-temescal broken by the latest updates LG(?)

@stale
Copy link

stale bot commented Dec 16, 2019

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 16, 2019
@darootler
Copy link
Author

Not working yet.

Regards
Richard

@stale stale bot removed the stale label Dec 16, 2019
@Pete1979
Copy link

Pete1979 commented Jan 3, 2020

Also not working with LG SL9YG

@RIKWEBB
Copy link

RIKWEBB commented Jan 28, 2020

Also not working with LG SL8YG soundbar

@amonhk
Copy link

amonhk commented Jan 28, 2020

Also not working with LG SK10Y

@mattchrist mattchrist mentioned this issue Feb 8, 2020
20 tasks
@amonhk
Copy link

amonhk commented Apr 22, 2020

I have tested this PR #31617 as custom_components
and it seems to work properly on my soundbar LG SK10Y
Thanks @mattchrist @MartinHjelmare

@darootler
Copy link
Author

darootler commented Apr 23, 2020

I have tested the PR #31617 with a LG SK6F soundbar too. I am getting a working media_player entity:

image

What i am missing is the option to turn it on or off. As an addition it would be nice to store this entity permanent. And if the source is changed to "Optical/HDMI ARC" the source changes to "Optical" and the GUI does not show the source anymore.

Thanks @mattchrist @MartinHjelmare for the work so far.

Regards
Richard

@Pete1979
Copy link

How do i test it as a custom component?
Right now i have added LG_smart_device to my ignore list.

@darootler
Copy link
Author

How do i test it as a custom component?
Right now i have added LG_smart_device to my ignore list.

Download this git clone, extract the contents. Navigate to \homeassistant\components and copy the folder "lg_soundbar" to your HA "custom_components" folder, configure the lg_soundbar like mentioned here and restart HA.

Regards
Richard

@darootler
Copy link
Author

There is also a problem with this integration and the standby option with the soundbar. Since this integration polls the soundbar permanently, it turns on instantly after the soundbar enters standby mode. Maybe this can be fixed in a combination with an on/off feature.

For me this is not useable at the moment.

Regards
Richard

@darootler
Copy link
Author

Any chance to get the integration working without discovery?

Regards
Richard

@amonhk
Copy link

amonhk commented Jun 15, 2020

I think it works without discovery

discovery:
  ignore:
    - lg_smart_device
media_player:
  - platform: lg_soundbar
    host: 192.168.7.118
    port: 9741

these are the problems found:

  • soundbar turns on instantly after the soundbar enters standby mode
  • if the soundbar is completely turned off, the connection is lost until the reboot of home-assistant

@darootler
Copy link
Author

I think it works without discovery

discovery:
  ignore:
    - lg_smart_device
media_player:
  - platform: lg_soundbar
    host: 192.168.7.118
    port: 9741

these are the problems found:

  • soundbar turns on instantly after the soundbar enters standby mode
  • if the soundbar is completely turned off, the connection is lost until the reboot of home-assistant

I also encountered the problem with the soundbar turning on with this configuration... So that's not an option i guess.

Regards
Richard

@a5mith
Copy link

a5mith commented Jun 16, 2020

Can confirm, even with just discovery enabled, the soundbar will turn off, then immediately turn back on again. SL10YG here.

@visstro
Copy link

visstro commented Jul 29, 2020

I had to disable lg_soundbar due to heating problems. It was keeping the device always on.

@CeccoCQ
Copy link

CeccoCQ commented Sep 17, 2020

Hi guys, any news about this issue?

@Pete1979
Copy link

No news from me.
I have kinda accepted that it does not work. I have created a remote in HA that controls a Broadlink Mini that in turn controls the soundbar. Still annoying that the soundbar turns on immediately after you turn it off tho.

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jan 26, 2021
@darootler
Copy link
Author

Issue still persists.

Regards

@github-actions github-actions bot removed the stale label Jan 26, 2021
@d4icon
Copy link

d4icon commented Mar 29, 2021

I think it works without discovery

discovery:
  ignore:
    - lg_smart_device
media_player:
  - platform: lg_soundbar
    host: 192.168.7.118
    port: 9741

these are the problems found:

  • soundbar turns on instantly after the soundbar enters standby mode
  • if the soundbar is completely turned off, the connection is lost until the reboot of home-assistant

I also encountered the problem with the soundbar turning on with this configuration... So that's not an option i guess.

Regards
Richard

SAme problem here with sn9yg soundbar
I have doubts as to whether this will ever work.

Is there a possibility to turn off the soundbar via wifi/network?
I'm beginning to think not....

In fact, the official soundbar app doesn't have the option, and besides, it has the same problem as us, as soon as you open the app the soundbar turns on :-(

On the other hand, for my soundbar model, I had to edit the lg_soundbar component, with the temescal library, because it doesn't support all the modes of my soundbar:
google/python-temescal#9

Translated with www.DeepL.com/Translator (free version)

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants