No. Never use it. But I will read the documentation
Simply use a condition.
If the state == on
just end the automation. If state == off
send a command, set the wait_template
and wait for a trigger state
to on
, then leave the automation. If the state doesn’t switch to on
in let’s say for 30 seconds, than send the command again.
EDIT: if you post what you have now, I’ll try to help change it.
I have a home BDV N9200w and a Samsung UN55HU7200 TV with which I only get one entity.
[quote=“paddy0174, post:13, topic:431065”]
If the state == on
just end the automation. If state == off
send a command, set the wait_template
and wait for a trigger state
to on
, then leave the automation. If the state doesn’t switch to on
in let’s say for 30 seconds, than send the command again.
EDIT: if you post what you have now, I’ll try to help change it.
[/quote] Forgiveness. I haven’t done yet. Nothing, but I’m going to start doing it and then I can post it so you can help me if I have any questions
I’ll set the thread on my watchlist, so I get notified.
I believe both of those devices are CEC-HDMI capable. That means you can control one and it should turn on/off the other. If you’re doing this from voice, why not turn the TV on from the automation rather than going through the IR?
The IR then would only be used by the human to interact after its all on? These things are always more simple on paper but you really want to take the IR our of the picture if you can. That TV is wifi capable and i’d be surprised if you can’t control it via HA directly.
EDIT: What are you using for voice control?
Now I’m officially confused. That model should be supported by the official SamsungTV integration, meaning you should be able to control that TV over Wifi or ethernet. And I’m quite sure, if that wouldn’t work (what I doubt), there would be some other way to talk to that TV. At least over SammyRemote that should work.
And what @calisro says is right as well. With HDMI-CEC you should be able to control all peripherals of the TV via the TV (and down the road over Wifi with HA).
With media_player I can only turn off the tv but not turn it on.
For example, thanks to the fact that the integration recognized the DLNA Digital Media Renderer home theater, I can tell if it is turned on.
This I did not know. I will read to know how I can do it
Now I don’t have a raspberry, I changed it for an intel nuc
The script, could it be like this?
script:
samsung_tv_on_off:
- wait_template: "{{ is_state('media_player.samsung_tv', 'on') }}"
timeout: 10
continue_on_timeout: false
- sequence:
- service: remote.send_command
target:
entity_id: remote.broadlink_m3_comedor
data:
command: b64:JgDsAE4VJBYVEyYVERUnFRMUExQSFBI+ERYmFhEXJRUSAALFThsgFRIWJxMVFCUhCRESFxEXEBQTFxAZIxURFSQYEgACxk8UJhUTFCgTEhYnExIWEhQTFREWDxgTFCYVEhohFxAAAs9MGiMTFBYnFBEWJRcRFhEVEhUTFxAUEhUnFQ8XJxURAALPTxUmFBMUJhUSGSMVExQSFhMdCRURFxAYIhgSFCYWEgACzU8VJRwKGCIYEBglFRIXEBUTFBMWEBYSFyMVExUmGA8AAs9PFCYVEhQlGw8TJRcTFhEUFBMTFRIVExYkFxEUJhURAA0FAAAAAAAAAAAAAAAA
- wait_for_trigger:
- platform: state
entity_id: media_player.samsung_tv
to: "on"
for: 2
timeout: "{{ wait.remaining }}"
continue_on_timeout: false
Ok, let’s break this here and start fresh, I think we should work our way up here, not back and forth.
- You have that TV you mentioned from Samsung and have the integration for SamsungTVs running in HA?
- If yes, why can’t you turn on the TV? That should at least be possible. I have some weired issues with my AndroidTV, but on and off are the most basic functions, they should nearly always work.
- How did you configure the integration from HA? If
YAML
, post the config - Are there any log informations or errors regarding that integration? If not, and it is not working, turn on the logger component and enable the debug log for the integration.
- How did you configure the integration from HA? If
- If no, what are you using to get the off state back?
- If yes, why can’t you turn on the TV? That should at least be possible. I have some weired issues with my AndroidTV, but on and off are the most basic functions, they should nearly always work.
I’d suggest we try first to solve the initial problem, why your TV is not working with the HA integration. If we can’t find a solution there, we can always come back to the automation.
But if you just want help with the automation, I’ll take a look at it. Just say so.
You’re right.
This integration was recognized automatically. It only gives me one entity which is the media_player entity. But I can only turn off the tv but not turn it on
The docs suggest using wake on lan. Have you tried that?
Have you enabled “wake-on-lan” in the TV settings? That seems to be necessary.
EDIT: too late to the party
Yeah that too.
There I was looking at the TV settings. I have HDMI-CEC but I can’t find wake on lan option. What I don’t know is if the NUC has this option.
No, no, the NUC has nothing to do with this. “Wake-on-lan” should be somewhere in the area “network” in the settings menu of your TV. Try looking for “WOL” as well, sometimes it gets shortened.
Wake-on-lan means, that your TV is not going to sleep totally, it still listens to a ping on the network addressed at it. If it gets that signal, it starts. This is a networking function, enabling is only necessary on the receiving side (your TV), not on the sending side (your NUC).
And let’s stay with the on thing, before we move on to HDMI-CEC. According to the docs, wake-on-lan is necessary, so we need to find this and enable it.
EDIT: Do you connect the TV through Wifi or ethernet?
first sorry the translation sometimes does not say what I want to express. When she said of the nuc it was because of the hdmi-cec. Unfortunately I search for all the configuration and I can’t find it. The tv is connected by lan.
I am not sure if someone has pointed to this Samsung Smart TV - Home Assistant
Also see WOL Samsung TV if it is any help.
I managed to turn on the TV from media player and not from ir. I uninstalled the integration of the TV and reconfigured it, I also put a fixed IP and it worked.