Good evening,
I am using the latest version of Home Assistant in combination with an LG Web OS TV (2020) and a Sony Soundbar.
I would like to achieve two things:
1.
I want a button with which I can switch the TV on and off (like a normal switch).
The colour of the icon should also change, like when I switch a Shelly Switch, for example.
The Sony soundbar should also be switched on at the same time as the TV.
2.
I want to create buttons for the services Netflix & Co. After clicking on them, the TV starts (if required) and then switches directly to Netflix. If the TV is already on, it only switches to Netflix.
I thought these two things shouldn’t be so difficult, but I’m failing on many levels.
The following problems have occurred:
1.
the TV is switched off via a command, but switched on via WOL.
I can do this individually, but I can’t put it on a button.
I have created the following automation:
- id: '1649289532235'
alias: TV einschalten
description: ''
trigger:
- platform: homeassistant
event: start
condition: []
action:
- choose:
- conditions:
- condition: device
device_id: a132aca714d8ccd256452643fbc3125f
domain: media_player
entity_id: media_player.lg_webos_tv_un74007lb
type: is_off
sequence:
- service: wake_on_lan.send_magic_packet
data:
mac: 58:FD:B1:BC:FB:03
- conditions:
- condition: device
device_id: a132aca714d8ccd256452643fbc3125f
domain: media_player
entity_id: media_player.lg_webos_tv_un74007lb
type: is_on
sequence:
- service: webostv.command
data:
entity_id: media_player.lg_webos_tv_un74007lb
command: system/turnOff
default: []
mode: single
When I test this directly, it also works.
But as I said, it doesn’t work when I put it on a button and want to trigger it.
And I don’t understand how it works with the icon colour.
2.
the Sony soundbar switches off automatically when the TV goes off, but unfortunately it doesn’t switch on automatically with the TV (I’ve tried everything).
Therefore I need an automation that recognises when the TV switches on and then also switches on the soundbar via WOL.
I have the following automation:
- id: '1649293010914'
alias: automatisch Soundbar starten
description: ''
trigger:
- platform: device
type: changed_states
device_id: a132aca714d8ccd256452643fbc3125f
entity_id: media_player.lg_webos_tv_un74007lb
domain: media_player
condition:
- condition: device
device_id: a132aca714d8ccd256452643fbc3125f
domain: media_player
entity_id: media_player.lg_webos_tv_un74007lb
type: is_on
action:
- service: wake_on_lan.send_magic_packet
data:
mac: 10:4F:A8:AA:AC:72
mode: single
The problem is that the automation sometimes takes 30 seconds to recognise that the TV has been switched on.
3.
When I switch on the Soundbar via HA & WOL, it is on the TV channel, but there is no sound.
If I switch the Soundbar on normally using the remote control, the channel is also set to TV, but sound comes out of the speakers.
I wonder what the difference is?
In any case, after switching on the Soundbar, I would have to change the channel once to HDMI and then back to TV, then it works.