Kef ls50 Wireless

I assumed the state was just on. Ah yeah just had a look. That’s not great. The state must be on or off.

Having the source and vol in the UI is fine, but the state must be on/off.
Ismuted seems to work. Although I can’t get it to toggle with the remote. Is that the same for anyone else?

Also the source says “InputSource.WIFI”. It should just say the name of the source selected from the dropdown. No “InputSource.” prefix. And the source selected should be shown in the source field as @gronis said.

I just updated the codebase. Changes:

- State is on or off (not input + volume)
- semaphore is used so that only one method can send at the same time (better user experience)
- Timeouts added when setting attributes (better user experience)
- When setting attributes also assign them on the speaker state (better user experience)
- Use lower case on InputSource (e.g "Wifi", "Bluetooth" etc...)

Just copy the files to custom_component/media_player folder again to install.

Also, I think we should try to get this merged with the real home assistant repo.
The programmable “turn_on” command also sounds really nice to implement.

I am sad that you guys did not like my extended state field. I thought it was a need idea.

@Gronis: I looked at the code changes. Looks fine to me.

Regarding the HA repo. It might be not so easy to get in their. I guess they have rather high code standards.

@Gronis: Are you willing to push this? You seem to be very experiences in the open source world.

I will look into the how to make a service call from within the custom component (to solve the turn on issue).
But not all of us have an IR sender :frowning:

I am sad that you guys did not like my extended state field. I thought it was a need idea.

It was a good idea, but it violates the semantics of what the state should be, and I think consistency is important.

Regarding the HA repo. It might be not so easy to get in their. I guess they have rather high code standards.

I looked at this yesterday, and the coding standard wasn’t that constraining (though it is higher than the average hobby project). It will probably be quite easy to get it merged.

I have a working version of the turn_on via service_call feature. I made a new branach HA-02 for this.

https://github.com/Gronis/pykef/tree/HA-02/kefwireless

I added two new configuration parameters. See README for details. Its not very pretty, but it should work.

@chimpy: What kind of device is sending your IR commands. Is it worth the purchase?

1 Like

@ironhorse I have been using an IR diod + transistor connected to a raspberry pi, running on lirc software. If you have a raspberry pi or similar already, it is a 2.3$ investment.

Thanks for the hint. Sadly the PI Hat solutiion will not work due to different locations of my PI and my KEF.
Nevertheless, I might buy a Logitec Harmony. This seems to be a greate device.

Hey guys, great stuff :slight_smile: thanks for all the hard work!

I bought a Xiaomi IR blaster but it’s got a weird timeout bug atm.

I’ve heard good things about the Broadlink RM Mini 3. You can get it from China for peanuts. It’s tiny too.

I have added a PR to home assistant here. I’ll also push a PR for the documentation later with the contents in README.md that you added @ironhorse.

2 Likes

@Gronis: Extremely cool. I curious how it goes.

I am very happy with the KEF-LS50 integration. Enjoying it every day.

2 Likes

Thanks!

Just wanted to let you and @ironhorse know that the component is working out very well for me, including the turn_on option.

I have been to modify settings in the app (on the Profile specifically). Sometimes it times out because of the connections we make to poll it, but at least it’s still possible.

1 Like

I am so happy that I stumbled across this thread. My LS50W speakers are from an earlier hardware revision that doesn’t support selecting specific inputs using IR codes. This component allows me to do it over the network which is amazing.

I do have a question though: I am using the HomeKit component to expose HA devices to homekit so that I can control them via siri, but it appears that the native features which the homekit component supports for media player components (toggling mute, turning on and off) aren’t exposed to the homekit component even though the card on the main overview screen of HA shows these features.

I’m a relatively new HA user (in fact this KEF integration is what got me to start using it), so any pointers would be welcome!

1 Like

Nice that this component is useful for you :slight_smile:

I’m not sure how media_player devices works with siri. I didn’t even know that you could expose media players to homekit with home assistant :o

Have you tried to specify what features you want to expose to homekit?

homekit:
  filter:
    include_domains:
      - media_player
  entity_config:
    media_player.<your-speaker-id-here>:
      feature_list:
        - feature: on_off
        - feature: toogle_mute

Note that it will not appear in homekit like the apple homepod. It will appear like switches.

Yup I have included that during my troubleshooting and nothing has appeared unfortunately, even after many restarts. It’s strange because the logs that Home assistant provides tells me that the speakers don’t support play and pause (which is true because I don’t think that has been implemented in the component) when I try to include those features, but it doesn’t provide any error for toggle_mute or on_off, it just doesn’t show up as a switch.

I also have a Sony Bravia TV that I’ve exposed to HomeKit as a media player, and all the features there are working so I’m pretty sure that my config is set up correctly.

Maybe it has something to do with how supported features are reported by components? I’ll try to find more info in my logs.

Thanks again!

Have you applied turn on service in your configuration.yaml file? You must turn on the speaker through IR. If you didn’t provide that in your config, the speakers will not report “turn on” as a supported functionality.

Hey guys,

Will this change affect this component? https://github.com/home-assistant/home-assistant/pull/21070
Hope you’re doing well!

Hi chimpy!

I don’t think so. As I understand it it looks like it only applies to custom components which overrides default components. But there is no default kef component.

Hope you are doing well :slight_smile:

Hey guys, I got this today after updating to version 88.1. I’m using the latest code available in the HA-02 branch.

2019-02-25 20:34:36 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.media_player.kefwireless. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/loader.py", line 147, in _load_file
module = importlib.import_module(path)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/homeassistant/.homeassistant/custom_components/media_player/kefwireless.py", line 15, in <module>
from homeassistant.components.media_player import (
ImportError: cannot import name 'SUPPORT_TURN_ON'
2019-02-25 20:34:36 ERROR (MainThread) [homeassistant.loader] Unable to find platform kefwireless

Any ideas? :slight_smile:

SUPPORT_TURN_ON is probably not part of homeassistant.components.media_player anymore (breaking change). I don’t have time to look into it right now. Is there any chance you can downgrade you hass version until this is resolved?