After trying several approaches over the last few days, I am asking for help:
I have a simple Set-To-Box (UKO-Box), which can only be controlled via Infrared. So I am using using Tuya and a Wifi Smart IR controller to connect the STP to the HA.
Tuya is providing me with a couple of scenes (which are workiing):
power toggle, volume_up and volume_down, and channel_up and channel_down.
How can I make these controls available in my HA frontend as a ‘media_player’?
I tried mostly with ‘Universal Media Player’ but also with Media Player Template but run into a lot of problems.
how can I put the state of the STB as permanentely ‘ON’? (‘on’ is not working)
if I linke the state with another device (TV) as shown in the config, the state of the STB changes, but no ‘power_on’ or ‘power_off’ command is sent to the STB. how can I link the ‘state’ to a command ?
the controls ‘media_next_track’, ‘media_previous_track’ as well as Play, Pause, Stop never show
Any help to guide me in the right direction is highly appreciated!
Thanks!
If you set the entity to permanently report state as on, then I would expect even more problems with the turn on/off actions. Rather than using attribute: state: to mirror a different device’s state, I believe a better course of action would be to use a state_template and store the expected device state in an input_boolean.
Documentation is kind of limited (or more likely I am not looking in whatever is the correct place), but your chosen device_class: receiver may or may not expect to support those actions. Try using device_class: tv instead?
Changing the ‘device_class’ to ‘tv’, seems to change the icon, but the controls stay invisible.
I am going the test the ‘state_template’ tomorrow …
Currently I am facing the next issue:
when pressing the ‘on’-button, I get the message:
“Action scene.uko_on uses action media_player.turn_on which was not found.”, or If I press ‘volume_up’, I receive
“Action scene.uko_vol_up uses action media_player.volume_up which was not found.”
Kind of impossible to say anything about this without knowing what YAML is contained within those scenes… Why are they scenes in the first place? Seems a super weird way to trigger sending of IR commands.
Shouldn’t ALL of your actions be scene.turn_on? It’s possibly one of those unfortunate naming coincidences, but it feels like all of the media_player handlers you’re trying to implement rely on setting a scene.
The scenes are non-editable and coming from the Tuya-Integration. They are generated by the Tuya-App on my phone.
Each scene is equivalent to a press on the Infrared-Remote of my STB.
E.g. ‘scene.uko_channel_nxt’ switches the STB to the next channel.
The scenes are working, so if on HA I ‘Apply scene.uko_channel_nxt’ the STB switches to the next channel.
Even if i wrap the scenes into an Automation the behaviour is the same.
scene.turn_on is the generic action for setting a scene. Your on and off works because both use scene.turn_on. It’s the entity_id field where you identify the action with a specific scene.
The Control field which is missing with the ‘media_player_control card’ appear if i use the ‘Mini Media Player Card’. No idea why …
I can live with this!