ehendrix23 / aioharmony

Asyncio Python library for connecting to and controlling the Logitech Harmony
Apache License 2.0
24 stars 14 forks source link

Support for home automation devices #16

Open eloo opened 4 years ago

eloo commented 4 years ago

Hi,

i would like to ask if its possible to also see the configured home automation devices in the show_config output? I've configured a hue hub but it looks like home automation is not included in the show_config command.

Is it maybe possible to add this devices also?

Thanks

ehendrix23 commented 4 years ago

I do not have home automation so not sure how to get it. Any chance you can run aioharmony with option show_detailed_config and provide that?

eloo commented 4 years ago

Sadly the home automation devices are currently not included in show_detailed_config.

But i've found an JS script which is capable of the automation devices. Maybe this is starting point to support them in aioharmony as well? https://github.com/lopelex/harmony-websocket

If you need support to test some implementation i can run it against my setup of course.

Thanks

ehendrix23 commented 4 years ago

Thx!.. Looks like I should be able to use that to get it implemented. Yes, will need your help then for testing and might also have some questions etc.. :-)

Currently finishing up 1 version and then I'll look into this.

Quick question, do you also use Home Assistant?

eloo commented 4 years ago

Okay that sounds pretty good 👍 Feel free to ask for my help as soon as you need it. And yes i'm using Home Assistant ;)

ehendrix23 commented 3 years ago

FYI, I am working on this now. Actually found out I have 2 items that could be added as automations so I can do initial testing on my own. Already ran into an issue that I am unable to get the state, getting permission denied. I think that depending on what is added in automations one has to actually authenticate. Found info on how to do that so will be testing it out.

eloo commented 3 years ago

Sounds good. If you have something to test feel free to mention me here 👍

ehendrix23 commented 3 years ago

Any chance you could download aioharmony from git+https://github.com/ehendrix23/aioharmony.git@automationsI#aioharmony==1.0.0b1

And then run it: python3 -m aioharmony --harmony_ip <Hub IP> show_detailed_config

Mainly wanna see if you get an error 401.2 back trying to get automation commands.

Thx.

eloo commented 3 years ago

Hi,

looks like i'm getting an different error.


 Incorrect status code 3001.0 received trying to get automation configuration for
ehendrix23 commented 3 years ago

@eloo ,

Can you run it with: python3 -m aioharmony --harmony_ip <Hub IP> --loglevel DEBUG --show_detailed_config

And provide the debug information.

eloo commented 3 years ago

Here we go. aioharmony.log

ehendrix23 commented 3 years ago

K, looks to be an issue when using XMPP as protocol. Been able to get same error here.

Can you do: python3 -m aioharmony --harmony_ip <Hub IP> --loglevel DEBUG --protocol WEBSOCKETS --show_detailed_config

ehendrix23 commented 3 years ago

Just pushed 2 commits. One to fix error 3001.0 when retrieving the configuration using XMPP. Another one to correctly parse the result when it is retrieved when using XMPP.

So if you can try again. You can leave --protocol WEBSOCKETS out of it and just use XMPP now as well.

eloo commented 3 years ago

Okay, just tested it.. Hopefully i have updated the version correctly (remove aioharmony using pip, clean cache, and reinstall it?)

The 3001.0 is gone.. But still an exception is thrown and no data is shown.

aioharmony.log

ehendrix23 commented 3 years ago

Well, that is because you got further then I do. :-)

For me it returns the 401.2 for the getting off the automation devices whereas clearly for you it does not. Hence I can't even get to the point of that exception. :-)

I'll go through the logs you send and at least already try to fix that exception next before I tackle authentication.

ehendrix23 commented 3 years ago

OK ... this was easier to fix then I thought.

Install the latest version (uninstalling aioharmony and then reinstall as you did would do it).

eloo commented 3 years ago

awesome. that looks very good.

i got a successful response with my automation devices. :+1:

ehendrix23 commented 3 years ago

Cool!

Next I'll be looking at what we get and then how to be represent it, including how to operate them. Then at least we can get that tested while I still figure out authentication.

Will let you know when next revision is ready.