Broadlink IR Media Player (For old, dump TVs)

Unfortunately, this is the case with IR controlling. If you don’t provide a ‘hack’ for state determination then your component stays in on mode when you turn off your tv from the remote control.
If your TV is a real dump (without at least a usb port), then the only solution is a plug with power consumption meter.

Ooohhh, what a mistake. Thanks a lot :slight_smile:

Cheers for the explanation.

Is there no way to add some of the following commands:
-initial_state: off
-assumed_state: true
-optimistic: true

With this type of logic, the state would be guessed as ‘off’ when HA starts. An IF power command would turn its state to ‘on’. Another would turn it back to ‘off’.

If the Broadlink RM can detect and pass on to HA actual remote control presses, it could even post any change to HA initiated by the remote. This is what can be done with the Milight ESPMH Gateway for instance. May not be possible with non-flash, off the shelf electronics…

These are the type of commands that can be used with MQTT Lights. I use these with RF controlled lights (same principle as IR) and it works a treat.

If you were asking me, yes, the TV has a USB port! How does that help?

1 Like

I second to that question. My Sharp legacy TV has an USB port for media playing.
Also besides Sonoff Pow, @masterkenobi mentioned, does anyone recommends other alternatives (cheap/reliable)?

You can connect a cheap NodeMCU or something with any firmware to the USB Port.
If the TV powers on, the NodeMCU get’s an IP adress and the component can detect the state with the ‘ping_host’ variable.

4 Likes

Great custom component, no issue at all setting it up. However, I was hoping the extra functionality would be picked up by my voice assistants (Alexa, Google, Siri) which all tie into HA. Seems like I can only control this component, and any media component from HA, by turning it on or off.

Does anyone know if it is possible to have a media player component provide all the functionality (volume, source, mute, channel, etc.) into these voice assistants without having to create a custom skill in Alexa, custom Google Actions app, and homebridge plugin for Siri? This was the whole point of using HA for me, as a central configuration for these voice assistants.

Can we customize the displayed items in HA from the general section. I’m trying to make a media component for my sounder and obviously do not need some items (Channel + or -) to show up…

I’d also like to know. So far it’s only on or off for me as well.

can someone please answer this? I would like to implement it but not sure on the correct syntax. In particular, for me an easy way to determine if my amplifier is on is to use the state of one of my chromecast audio’s since I have automations set to turn the amp on and off based on the chromcast.

also, can someone please help me get the volume up/down for this media player component to work with a Xiaomi Cube? I have been trying a bunch of different options such as this below but nothing seems to work for me.

alias: Cube - Rotate
initial_state: 'on'
trigger:
  - platform: event
    event_type: cube_action
    event_data:
      entity_id: binary_sensor.cube_158d00010fd152
      action_type: rotate
action:
  - service: media_player.volume_set
    data_template:
      entity_id: media_player.lounge_amp
      volume_level: >
        {%if trigger.event.data.action_value | float > 0 %} 
            service: switch.turn_on
              entity_id: switch.amp_volume
        {% else %} 
            service: switch.turn_off
              entity_id: switch.amp_volume
        {% endif %}

The media player doesn’t work in 0.64.0

ERROR:homeassistant.config:Invalid config for [media_player.broadlink]: string value is None for dictionary value @ data['power_consumption_entity']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/media_player.broadlink/

Did version 0.64 release?

Yes, https://pypi.python.org/pypi/homeassistant

EDIT: But i’m back on 0.63.3 :thinking:

Works in 0.64.0 when i use a dummy power_consumption_entity and enter its own entity_id.

power_consumption_entity: media_player.lg_tv

EDIT: Ahh! Sorry, didn’t see your fix on github.
Thanks for the quick fix!

I upgraded to 0.64 then tried to apply the latest build on GitHub but still had problems with the broadlink not loading, either switch, climate or media player. I’ve had to revert to 0.63.3 again to regain functionality.

Is there something I’ve missed?

Received this with 0.64

2018-02-26 15:29:12 ERROR (MainThread) [homeassistant.config] Invalid config for [media_player.broadlink]: string value is None for dictionary value @ data[‘ping_host’]. Got None
string value is None for dictionary value @ data[‘power_consumption_entity’]. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/media_player.broadlink/
2018-02-2

Hey @VDRainer, did you simply overwrite the 3 broadlink.py files to get it to work with 0.64?

Cheers

Linton

Yes, using only the media_player, so replaced https://github.com/vpnmaster/homeassistant-custom-components/blob/master/custom_components/media_player/broadlink.py

1 Like

@Vassilis, I believe your components require updating on your git to include broadlink==0.5.1 as per the latest hassio (0.64.1).