-
Notifications
You must be signed in to change notification settings - Fork 39
Bump version to 1.0.6 and fix requirements #62
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
Conversation
|
|
|
Sounds good! Should I change the version now or wait until my pull request to |
|
Any updates on this? This will be very useful to me 😄 |
|
I can change the version in my pull request at any time, but I'm just waiting on this pull request for python-adb to go through... |
…N'; avoid unnecessary ADB commands
|
Modifications for python-adb were upstreamed, new release for it is pending tho. |
|
We'll merge this once the upstream release is completed. |
|
I published a slightly modified version of NOTE
|
|
@JeffLIrion I think it would be better to explicitly set This will also expedite getting the Home Assistant PR merged. |
|
No problem, I changed the requirement. |
|
|
|
Awesome, thank you! |
|
How do I install the required packages for this? I followed all instructions in the readme to install and received Couldn't connect to host. I played around with adb versions and downgraded to a previous version. now it's just giving me python errors. y ultimate goal is to run some command line scripts from home assistant to control my FireTV stick 4k. I am attemting the install of adb-homeassistant now. any help to get this running will be buch appreciated. |
|
This is already integrated into Home Assistant. It will install the dependencies for you. If it fails to setup the device, it's almost certainly due to a configuration error or an issue with your https://www.home-assistant.io/components/media_player.firetv |
|
Thanks @JeffLIrion, I managed to get it running through command line which is good for me. I don't need the physical implementation in home assistant. I only in command line so on that front It is all good now. I do have another question. Yesterday, everything was working flawlessly. Upon starting to write my scripts this morning, I noticed the apps wont launch anymore. when accessing the endpoint http://192.168.88.169:5556/devices/lounge/apps/com.cbsnews.ott/start, I get a json response with the following message: As stated, this worked yesterday where I left off yet this morning, it does not. Any idea what might be causing this. When attempting to access the same url as above again after this message, I just get an Internal Server Error with the following python output: INFO:werkzeug:192.168.88.169 - - [13/Jan/2019 06:54:15] "GET /devices/lounge/apps/com.cbsnews.ott/start HTTP/1.1" 200 - Another thing that I also don't understand is where does the IP werkzeug:192.168.88.169 in the above error come from? my IP of my firestick is 192.168.88.159, and the box which I am running the firetv-server on is at 192.168.88.237. I know the 159 IP is correct as I can execute other commands such as http://192.168.88.237:5556/devices/action/lounge/turn_on which works flawlessly. It's only lawnching the apps this morning which seems to be a problem. Any ideas for the "retcode": "** SYS_KEYS has no physical keys but with factor 2.0%.\n251" error and the resulting python errors. Thanks a bunch for your help. This is the first time that I finally feel that there is some light and hope of me achieving what I set out to do with this home automation stuff. :-) UPDATE: I know now where the 169 IP comes from. It is the local machine from which I issued the get request. Restarted the FireStick 4k, still experiencing the same error as above. Thanks |
|
You're making this soooo much harder than it needs to be... You don't need to run the firetv server anymore. import firetv
ftv = firetv.FireTV('192.168.88.159:5555', 'path to the adbkey file')
ftv.turn_on()
ftv.launch_app('com.cbsnews.ott') |
|
I apologize for that. I'm also just learning about this now so I need to jump through the hoops. All the info I have is what I got online. I am also pretty much following the read me. I did not know about this python code above. What I gather is that I do not have to do run sudo firetv-server -d X.X.X.X:5555 as per the read me anymore correct? So with python fire TV installed (as per the readme), then I can just run the above code and it should work without creating linux services etc? correct? Is there any documentation outlining all the functions available in python anywhere? Does this constitute anything else that I require to do? anything special? The app is still not launching. I run the python code and nothing happens. No errors are being output either. I put the code in a py file and then execute it with sudo python turn_on.py Thanks for the help. and sorry for making things difficult. |
|
There's no real need for documentation of the There are issues with the ADB connection breaking. These are due to the If you're doing any sort of home automation / smart home stuff, I would highly, HIGHLY recommend using an existing open source solution. I use Home Assistant; I know there are others but I don't have experience with them. Everything you've mentioned (and a whole lot more) can easily be done using the Fire TV component for Home Assistant. You can turn the device on/off, pause/play, launch apps, etc. with the click of a button from a simple UI in your browser. When possible, it's always better to leverage existing solutions than to build your own from scratch. |
|
I think the best approach here would be to uninstall everything (fire-tv[firetv-server], adb, and firetv-python) and reinstall according to the readme of your project but leaving out the firetv server bit, I will then try the python code again. I messed around with the adb versions as well so need to reinstall with the git version as per your suggestion. I do have home assistant so I will do that as well. The thing is, I have been trying to avoid an upgrade at all cost. Never had fun with those and a lot of work has gone into my current implementation. Alas, I suppose it is then time for an upgrade from version 0.72.1 to whatever the latest is. I will let you know how it goes. Thanks! |
|
Hi @JeffLIrion, Ok, I'm at breaking point. I uninstalled everything. I upgraded my home assistant to 0.85.1 which according to https://github.com/home-assistant/home-assistant/releases is the latest version. I reinstalled according to the readme the following: (Note I did not do After installing all of this, I could not use I proceeded to install
Now I added the fireTV component to my HA as: When I restart HA, I get the following error: The python code above also does not work with an error that it cannot connect to the host 192.168.88.159 yet I can connect with adb. Is there anything that I am missing in this installation? I restarted the FireTV stick, I use the built in FireTV component as suggested, but for some reason I cannot get it working. It cannot be this difficult. I am at my whits end. Any suggestions will be greatly appreciated. Apart from attempting to install Thanks |
|
https://www.home-assistant.io/components/media_player.firetv/ I don't know what README you're referencing, but it's not necessary. There's no need to install any Python packages. It looks like maybe your |
|
I followed that component link to a t... The README I am referring too is the one of this project (https://github.com/happyleavesaoc/python-firetv). I will attempt a CHMOD on the file to give it permission to everyone and everything to see if that solves the problem. I did try both files in /home/pi/adbkey as well as /home/homeassistant/.homeassistant/adbkey (which according to my knowledge, the home assistant user should have access to. I will give it a bash anyway and provide feedback. Thanks |
|
Hi @JeffLIrion, Ok, there seems to be some light at the end of the tunnel. I changed the permissions on the adbkey file and the above errors went away with a restart. I was able to turn on the fire tv stick 4k using home assistant. Immediately after, it went into an unavailable state. an no changes on that since. I tried:
It remains in an unavailable state in Home Assistant. I then removed the component from home assistant, restarted again and attempted the python code suggested above with the new permission set adbkey file. I still get the could not connect to host error as previously mentioned. Any other tips / suggestions? My home assistant is hassbian I believe and not hassio. If this helps at all. Thanks |
|
Try this custom component: Installation instructions (from the README:
Use This should be a bit more stable than the current component. Let me know how it works out. |
|
Thanks @JeffLIrion. This seems to be a bit more stable... considering only a couple of minutes worth of testing. the confusing thing is that with this as my config:
it still shows the source of the current app? is this suppose to happen? Other question is, how do I tell it now to launch an app? Should I set the source in home assistant to the package name somehow in an automation? The documentation does not mention this feature. Thanks for all your help so far. I really appreciate it. |
|
@JeffLIrion, at second glance, it does not really seem stable in the sense of displaying the states. it keeps jumping between Unavailable, idle, and now and then, paused... which is strange. So it is connecting but it seems like its dropping? I don't really need to display the states on the dashboard or depend on them. I only have to turn it on and launch two apps... So this might still just work. I have managed to launch the app from home assistant by calling the select source service so I will add this to an automation and watch it for a couple of days. I will provide feedback around how it goes. Holding thumbs. |
Now that ADB authentication is implemented,
pycryptodomeandrsaare required. I've submitted a pull request foradbthat will bump the version up to 1.3.0.1, but for now I'll put the requirement as 1.3.0 (although this version may lead to some errors when using an ADB key).Along with the previous pull request (#61), this should close #49, #57, and #60.