-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Turn on not always work on Q7/Q9 2018 model #5
Comments
I have a 2017 TV and a 2019 TV. The 2019 TV works to turn it on through WiFi only, the 2017 TV needed to be connected through LAN in order to be turned on, even considering it has WiFi capabilities. So, the model of the TV is very important here too. As one of my TVs stops the WiFi card when it is stopped, another does not. Also note that when you turn the tv off, it may look like it's turning off instantly, but takes some time for it to actually turn off in the background.. as far as i know, the tv stays on in the background for a "grace period" after you close it, but I may be wrong. With this said, there are some issues with getting the correct states, I do believe this and hope to improve it in time. |
I have tested with dedicate WOL app on PC, there is a grace period after, TV turn off, ti still running on the background so WOL on command will not work in this time, instead use KEY_POWER will make it on. So we can add the additional command KEY_POWER a long with WOL, if after WOL timeout and TV not ON? |
That sounds reasonable, if we can make some solid logic for it. Hacks like these tend to come back and bite you in the ass after some time. |
Other bug with your fork is on off state not update accurate you can use remote/app control to turn on, later turn off, it will not update in the hass. But i see when tv off, hass show it on but volume/up down disable, so when vol disable is is Off? |
i think if you set:
in your config, it might fix the on / off state issues you've been having |
About using "KEY_POWER" in case WOL fails, I'm starting to see numerous issues with this:
All this might be seem visually confusing if someone is just spamming the power button from the HA panel.. But the states and methods do seem to work correctly, at least in the few tests with my 2019 TV. And the case of someone wanting to turn a TV back on a short time after turning it off should be rare enough.. |
I have test this my my 2 TVs, WOL only turn on, so if ping TV off and then send KEY_POWER follow by WOL, it work but with some delay cause by "ping" |
But smarthings app work all the time, i connect it to smarthings HA component, appear as switch. |
@dzungpv doesn't the smartthings app use Bluetooth to connect to the TVs? |
@jaruba i test by turn off bluetooth, and bluetooth only use when TV on, when it off must use WOW for my TVs or IR remote |
I do love how smartthings shows the input :( And I am stubborn.. |
@jaruba on tizen tv it intergrate smarthing, api connected to server. So it connected to smarthings app through it. |
Yeah, SmartThings uses a the cloud API, not the local API.. |
There's a lot of useful data in the cloud api.. obviously..
It would take a lot of effort implementing cloud support though.. |
I feel like a SmartThings TV component would fit best in it's own custom component though, as it would fix all issues from this component which uses only the local APIs. So this might be completely out of the scope of this component. |
I have been playing around with the smarthings API. Looks promising. I can currently get: looks like there may be a way to run an app but havent tried it yet as only discovered the app name earlier today. Going to try making it run with a new custom component tonight. no clue how but i will give it a try. it looks like if you knew what you are doing you add it with the HA smarthings integration, i dont see why not, I am just learning python so its all new to me. |
@pegatron89 I'm not a python developer either, but I can code in anything if needed.. You really did do a lot of work on this, I'm curious about your component, might be able to help with it.
I've never tested HA's smartthings integration, so I'm not sure how that works. It may or may not be possible to add it there, as there's also a smartthings hub, so I'm unsure if that integration is supposed to be for the Cloud API, for emulating the hub, or for both.. |
I will put the code I have on my GitHub today. I didn't get a chance to try the media player component last night but will try this afternoon. |
https://github.com/pegatron89/smartthingstv You will need to get a smartthingsapi key from here If you un-comment the function get_devices() it will give you your device IDs, Then add them to the DEVICE_ID variable and then the rest will work also |
@pegatron89 thanks, i know about the api key, i've already researched the subject on my own as i was planning on making such a component too |
I have pretty much got the integration working with HA now. On / Off State is much quicker than any of the other components. Currently:
Todo: I have the commands ready for the Change source and set volume, I just have no clue how to change part of the command to user input. eg:
X being user input. 1 thing i found though, which is a pain in the ass.. I cant see anyway of launching an app. You can look at the capabilities here , When i check which are compatible with my tv there are;
*App name appears like; "KIciSQlYEM.Plex" on 1 of my samsungs and different on another. Anyway, I will upload all my stuff to my github today and leave it here if you want to have a look. |
@pegatron89 That's amazing work, I personally did not have time yet to test it, I hope I'll find some time for it soon though. As I think I'd use it / work on it for a more complete Samsung TV component. |
I'd even make a Frankenstein component using stuff from both cloud and local to get complete control if needed. The local API still works well in a lot of cases and will definitely be faster at some commands then using the Cloud API. |
I have changed the code and removed the commands for the moment. I am rewriting the commands to 1 single command (hopefully) once I get that everything else should be ok. Yeah no problem let me know if there are any issues you find or any way of changing it to work better. |
Look at these:
These codes all work with the Samsung TVs afaik. |
Newest release includes the SmartThings API, you'll need to set api_key and device_id to enable it. The SmartThings API adds many new things, and also fixes this issue. |
I have two TV Q7FN 55" and Q9FN 65", this is the only component work.
But i have problem with turn on.
LAN not work on my TV, it only work for wireless LAN, so in order for ON command work i do following on TV Settings:
Settings > General > Network settings > Expert settings > Power on with mobile (turn on) and enable IP remote .
It work fine with OFF command, but when it off press on, sometime work and sometime not.
I try the command and see that it use only KEY_POWER for both on/off, and some time the component not update correct state. So how to fix the problems?
Update: Smarthings App use same API and could show accurate state of the TVs and both of my TV could not use WOL to turn on.
The text was updated successfully, but these errors were encountered: