aioharmony icon indicating copy to clipboard operation
aioharmony copied to clipboard

Support for home automation devices

Open eloo opened this issue 4 years ago • 17 comments

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

eloo avatar May 30 '20 12:05 eloo

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?

ehendrix23 avatar Jun 12 '20 15:06 ehendrix23

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

eloo avatar Jun 13 '20 10:06 eloo

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?

ehendrix23 avatar Jun 15 '20 13:06 ehendrix23

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 ;)

eloo avatar Jun 16 '20 06:06 eloo

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.

ehendrix23 avatar Feb 17 '21 15:02 ehendrix23

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

eloo avatar Feb 17 '21 15:02 eloo

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.

ehendrix23 avatar Feb 19 '21 19:02 ehendrix23

Hi,

looks like i'm getting an different error.

 Incorrect status code 3001.0 received trying to get automation configuration for

eloo avatar Feb 25 '21 20:02 eloo

@eloo ,

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

And provide the debug information.

ehendrix23 avatar Feb 25 '21 21:02 ehendrix23

Here we go. aioharmony.log

eloo avatar Feb 25 '21 21:02 eloo

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 avatar Feb 26 '21 00:02 ehendrix23

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.

ehendrix23 avatar Feb 26 '21 18:02 ehendrix23

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

eloo avatar Feb 26 '21 22:02 eloo

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 avatar Feb 27 '21 02:02 ehendrix23

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

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

ehendrix23 avatar Feb 27 '21 02:02 ehendrix23

awesome. that looks very good.

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

eloo avatar Feb 27 '21 09:02 eloo

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.

ehendrix23 avatar Feb 27 '21 17:02 ehendrix23