Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wait for app to open before sending command (SWITCH) #715

Open
Ghitafjorback opened this issue Feb 22, 2025 · 4 comments
Open

wait for app to open before sending command (SWITCH) #715

Ghitafjorback opened this issue Feb 22, 2025 · 4 comments

Comments

@Ghitafjorback
Copy link

Maybe I am missing the obvious, but I have made below switch, which is working fine if the app is already opened. If it is not already opened, it will take a little while for the app to open, but the "KEY_ENTER" command will be fired nevertheless. Is there a way to say what for application before sending command, or is there another hack-around? I cannot use multiple presses as it works as a toggle.

"switches": [
{
"name": "Sync On/Off",
"power": false,
"app": "3202205027312",
"command": [
"KEY_ENTER"
]
}
]

thank you for your time

@tavicu
Copy link
Owner

tavicu commented Feb 22, 2025

Hi. Unfortunately there is now way to know when an app finishes opening.

What you could do is add a delay before KEY_ENTER.

You could do that by setting the command to: ["DELAY*2s", "KEY_ENTER"]

This will run a delay for 2 seconds and then it sends KEY_ENTER command.

@JasonGoldenDDT
Copy link

I don't know for sure, but I've used Wireshark to monitor the tv's network messages when using it. I think it could be telling its API it's doing something. Even if that message is encoded, it could trigger the plugin to ask, update, or send a command.

@Ghitafjorback
Copy link
Author

Thanks for your comments. I made a hack-around and used a command to start with "KEY_DOWN*5s" to mimik a fixed delay of 5 seconds which seems to be sufficient. Pressing down makes no mess for my automation in this case. ☺️
Love the plugin, although my 4 Frame TVs have some issues regarding the art mode and I hope those issues could be resolved some day. 🤞🙏🏻

@Ghitafjorback
Copy link
Author

Wow! I did not know there was a real DELAY command!! Thanks! I will change my hackaround to this solution! 💪🏻❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants