thank you!
I’ll take a look at this remote and try to implement a Controller blueprint for it, then add support for both the Light and Media Player Hook.
I’ll let you know as soon as the controller is supported.
If I add the E1524 blueprint and the media player blue print and I make an automatization with the E1524 (pure linking to ZHA) all my automatization’s crash
Thank you for reporting here, I’m sorry for what you are experiencing.
Does this setup (E1524 Controller + Media Player Hook) work if you don’t add the pure ZHA automation?
Are there any entries in the Home Assistant Logs related to automations or blueprints?
I’ve published an update for this blueprint, which adds support for the IKEA E1812 Shortcut button and fixes a naming issue for the IKEA E1743 Wireless Dimmer.
If you had previously used this blueprint with an IKEA E1743 and you’d like to update it, you’ll need to fix your current automations. Please make sure that the value for the Controller model input in automations generated by this Hook is exactly equal to “IKEA E1743 On/Off Switch & Dimmer”.
I’ve just published an update for this blueprint. You can now specify the number of steps to go from min to max volume when controlling the volume, both for short actions (button press etc.) and long actions (rotation, button hold).
This allows to configure a finer and more precise volume control, which you can easily customize for your media player. You can find more about this new feature in the docs.
alias: Kitchen music Hook Media Player (Tradfri remote E1524)
description: by EPMatt
use_blueprint:
path: EPMatt/media_player.yaml
input:
controller_device: 67bce5a0e24c261314b17ad7b367bc23
media_player: media_player.kitchen
controller_model: IKEA E1524/E1810 5-Button remote
Now I’m not sure how to go from there if I wanted to play Spotify or a TuneIn radio stream by clicking the main center button
Do you have any yaml examples I could copy/paste somewhere ? Thanks !
The Media Player Hook maps the center button short press event to the “play/pause media” action. However, you can configure a custom action in the controller automation to run for the center button double press event, which is not used by any of the currently available hook configurations.
Here’s the updated YAML for your controller automation:
alias: Kitchen music (Tradfri remote E1524)
description: ''
use_blueprint:
path: EPMatt/ikea_e1524_e1810.yaml
input:
integration: deCONZ
controller_device: 67bce5a0e24c261314b17ad7b367bc23
# sequence to play a TuneIn radio stream
action_button_center_double:
- service: ...
# remember also to turn on the virtual double press feature
# on the center button
button_center_double_press: true
If you want to learn more about controllers, hooks and the different available configuration options, you can give a reading to the Controllers-Hooks Ecosystem documentation. I’m planning to add a TL;DR version of that doc page, as well as a detailed FAQ section. Both of them will act as a quickstart guide for helping users to setup controllers and hooks on their systems.
Moreover, I can see from your YAML config that you’re using an outdated version for the Media Player hook. I’d like to suggest you updating the blueprint to the latest version (currently 2021-10-29); thanks to the good work of a kind contributor, during the last couple of days I’ve published a major update, adding support for alternate Hook mappings (more of which will be added in the near future for currently supported devices), and fixing a few naming issues for supported controllers in hooks. Since this is a breaking change, I’d suggest you to read the blueprint’s changelog and update your hook configuration accordingly.
Please let me know if you’re able to achieve the desired setup with my suggestion.
Thank you!
Thank you for pointing out I had an obsolete version of the Media Player blueprint (although I don’t think it changes anything to my problem/misunderstanding) => I updated
After some more testing, I was able to launch a radio stream when clicking the center button.
I was also able to increase/lower the volume thanks to the up and down buttons but I had to explicitly code those 2 actions when I thought they would be automatically embedded in the Media Player hook => this is where I’m not sure I totally got it
Maybe it has something to do with the 2 required fields I left blank in the Media Player hook ?..
Another confusing thing (if it can help anyone else) is that you need to call the service media_player.play_media to play a TuneIn stream and NOTmedia_player.media_play that does exist as well ! (note the reversed words)
Exactly, those required inputs allow the Hook automation to “hook” to the controller automation. You should either provide a value for the “Controller Entity” or “Controller Device” input, depending the integration you’re using for setting up your device in Home Assistant (in your case, “Controller Entity” if using Zigbee2MQTT or “Controller Device” if using deCONZ or ZHA).
By the way, I can see from your YAML that you correctly provided a value for the “Controller Device” input in the media player hook. The issue might be with the controller_model input. Version 2021-10-26 introduced a breaking change for this input, as described in the blueprint’s changelog:
2021-10-26:
Standardize blueprints structure and inputs naming across the whole collection.
Improve blueprint documentation.
Add support for alternate mappings. Additional mappings for currently supported controllers will be added from now on. Refer to the documentation of your controller for more details.
Breaking Change: update controller names in the Controller Model input, to match the full name of controllers, prevent ambiguities and enable support for alternate mappings. After updating this blueprint, please reconfigure your automations by selecting again the value for the Controller Model input, matching the full name of the controller you’re using with this hook.
Fix typo for IKEA E1524/E1810 center button long press action in mapping definition.
Please select a valid value for the controller_model input while configuring the blueprint from the UI. The value should match the full name of your device. You should then be able to control the media player’s volume without having to configure custom actions.
I updated the Controller blueprint to 2021-10-26 and created a new automation based on it.
I also added the missing required “Controller model” in the Hook Media Player automation like you mentioned.
I now have those 2 yaml but the TuneIn station won’t launch anymore (it does launch in a basic automation without the blueprint)
Controller
alias: Kitchen music (with Tradfri remote E1524)
description: Based on 2021.10.26 blueprint
use_blueprint:
path: EPMatt/ikea_e1524_e1810.yaml
input:
integration: deCONZ
controller_device: 67bce5a0e24c261314b17ad7b367bc23
action_button_center_short:
- service: media_player.play_media
data:
media_content_id: France Info
media_content_type: TUNEIN
target:
entity_id: media_player.kitchen
Hook Media Player
alias: Kitchen music Hook Media Player (with Tradfri remote E1524)
description: Based on 2021.10.29 blueprint
use_blueprint:
path: EPMatt/media_player.yaml
input:
controller_device: 67bce5a0e24c261314b17ad7b367bc23
controller_model: IKEA E1524/E1810 TRĂ…DFRI Wireless 5-Button Remote
media_player: media_player.kitchen
If I click “Run actions” in the Controller, nothing happens either.
In its Trace Timeline, I have the following error :
Stopped because an error was encountered at November 5, 2021, 10:45:13 PM (runtime: 0.07 seconds)
UndefinedError: 'dict object' has no attribute 'event'
See anything I’ve done wrong ?..
[Update] I have another Ikea remote (E1810 that one) using your Controller/Light blueprints.
It was working fine until I decided to update the Hook Light to version 2021.10.29.
I re-recreated 2 automations from scratch for this remote/light to no avail…
The error in the Trace Timeline of the Hook Light is also : UndefinedError: 'dict object' has no attribute 'event'
So my problems might have the same root cause.
I understood my mistake : I was missing the required Helper - Last Controller Event field in the automation based on the Controller blueprint.
I created a dummy input text helper in the /config/helpers page called input_text.dining_room_lights_last_controller_event (as Entity ID) and used it as the Helper - Last Controller Event.
I can now toggle on/off my group of dining room lights
The up/down buttons do not change brighten/dim the lights though.
The left/right buttons (arrows) do not change the kelvin either.
What am I missing ?
(although I see the “trigger_action”: 2002, “trigger_action”: 5002, etc… in the Trace Timeline with no errors)
[Update] Hmm, I was a little too enthusiastic and I have a funky behavior with that Center button (toggle on/off) : once I start using that button, the group of lights remain “on” in the Lovelace interface, even when they’re off (they’re literally off and my LIFX app shows them as off) and I cannot turn them off through the virtua button in Lovelace
I went to the Developer tools and emptied the value of my new input_text.dining_room_lights_last_controller_event helper, reloaded Input Texts in the Server Controls but none of that unblock the status in Lovelace.
Only when I restart HA does it reset the status lights to its real off status
Dunno if this has anything to do with either the new input text helper or the fact that I am dealing with a group of lights and not not a single bulb (I would have to try that second option)
[Update 2] Ok, nevermind the funky on/off behavior. It’s working fine now. Must have been a temporary glitch.
It’s just the left/right and up/down buttons that do nothing :-/