Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

Use v3 payload implementation in home-assistant #109

Closed
wants to merge 1 commit into from

Conversation

bitglue
Copy link

@bitglue bitglue commented Jan 22, 2018

Haaska was using the v2 payload, which is now deprecated. Fortunately,
home-assistant implemented the v3 payload.
home-assistant/core#11859 exposes this
via an HTTP POST, which allows Haaska's Lambda function to be simplified
to some trivial glue.

Haaska was using the v2 payload, which is now deprecated. Fortunately,
home-assistant implemented the v3 payload.
home-assistant/core#11859 exposes this
via an HTTP POST, which allows Haaska's Lambda function to be simplified
to some trivial glue.
@bitglue
Copy link
Author

bitglue commented Jan 22, 2018

Heh -- tests fail because everything they tested is gone now.

@bitglue
Copy link
Author

bitglue commented Jan 23, 2018

@auchter thoughts? With most of the code in Home Assistant there's not much code left here, but I think there's still value in the documentation and a little automation around the setup. If you're on board I might take some time to update the docs.

@dhzl84
Copy link

dhzl84 commented Jan 28, 2018

Your pull request home-assistant/home-assistant#11859 got merged into 0.62. Can't wait for the release to pop up on Hass.io to change my haaska skill integration.
Seems like @auchter abandonned this project.

@jeroenterheerdt
Copy link

@bitglue @auchter I would love to help out here. I am stuck on the v3 version as well and need some help to get it to work. After running make test I get some results back that look good, but when I try to add my skill in the Alexa app I run into issues (cannot add skill, try again later). I figured, if I help update the docs I might just learn what is wrong in my setup.

@TheJulianJES
Copy link

@jeroenterheerdt If you cannot add the alexa skin in your app then you should see if the Client ID and Client Secret from "Login With Amazon" are put in your alexa skill. I also had to go through some trouble but the v3 version work's great but most config options are useless now.

@jeroenterheerdt
Copy link

jeroenterheerdt commented Jan 31, 2018

@TheJulianJES Never mind, got it working now. I went ahead and made a quick PR (#110) for my proposed changes to the docs. It now lists the steps I took. Biggest changes:

@jeroenterheerdt
Copy link

@TheJulianJES could you help me understand why Alexa does not discover anything though when I run make test I see a correct result?

@TheJulianJES
Copy link

TheJulianJES commented Jan 31, 2018

Make sure that the trigger is defined in the lambda function: https://i.imgur.com/nm852jz.png
Make sure that the v3 payload is selected: https://i.imgur.com/9RxnZVU.png
Make sure that the lambda server is set as the ARN: https://i.imgur.com/rUvCFkj.png (Default)

Also pay attention to: https://developer.amazon.com/de/docs/smarthome/steps-to-build-a-smart-home-skill.html#configure-arns
For example, as I live in Germany I need to use the "EU (Ireland)" server location in aws.

I actually had a similar problem that Alexa couldn't find any devices but the test was working, in my case the problem ended up being that I was not logged in correctly on Amazon(.com), so alexa.amazon.com assumed that I lived in the US, so only the location US East (N. Virginia) in AWS was working for me. I just had to relogin. I have not seen anybody else encounter the same issue as me though, so it's probably unlikely.

@jeroenterheerdt
Copy link

My function was created in EU (Ireland). I'll check the other stuff tomorrow. Thanks for helping.

@anthonylavado
Copy link

I will say, @mike-grant seems to have the furthest along implementation that I've seen: https://github.com/mike-grant/haaska/tree/v3

@jeroenterheerdt
Copy link

jeroenterheerdt commented Feb 1, 2018

@anthonylavado the @mike-grant version does not work for me. I reverted to the #109 version of this repo and with the help of @TheJulianJES (thank you!!) I got it working. I have an updated instructions on my fork if you want to have a look.

@mike-grant
Copy link

@jeroenterheerdt What failed for you? I'm running that v3 branch currently at home.

@jeroenterheerdt
Copy link

jeroenterheerdt commented Feb 2, 2018

@mike-grant the tests failed. Could you not just keep the tests that allow you to test against the published lambda instead of local? The test against public lambda is more interesting. It did work fine when I copy-pasted your code to lambda and also updated the config, though. BTW, I took a stab at updating the docs, see my PR in mike-grants version.

@tringler
Copy link

tringler commented Feb 8, 2018

I get get_environ_proxies() missing 1 required positional argument: 'no_proxy' if I use make test or aws lambda add-permission --function-name haaska --statement-id 1 --action lambda:InvokeFunction --principal alexa-appkit.amazon.com --event-source-token [skill-id]

@bitglue
Copy link
Author

bitglue commented Feb 8, 2018

@tringler If you're seeing that output on stdout, it's probably an issue with your local awscli installation rather than the lambda function.

@tringler
Copy link

tringler commented Feb 8, 2018

@bitglue I configured the awscli with access key id, access key, region name and output format as text. What should I do else with the awscli?

@bryanyork
Copy link

bryanyork commented Feb 8, 2018

@tringler What system are you running on? Looks like a known issue in debian:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=873179

Apparently the pip version works:
sudo pip3 install --upgrade boto3

@tringler
Copy link

tringler commented Feb 8, 2018

@bryanyork Thanks for helping me out! That solved the problem.

@tringler
Copy link

tringler commented Feb 9, 2018

I can confirm that the branch is basically working, but climate devices seems not to be discovered :(

@bitglue
Copy link
Author

bitglue commented Feb 9, 2018

Climate devices aren't implemented yet (temperature sensors are), though it wouldn't be hard to add them. Mostly I haven't done it because I haven't quite figured out why my z-wave thermostat makes four devices in Home Assistant and how I'm supposed to use them.

@Mickelin01
Copy link

I installed the haaska v3 and it worked perfectly on the first try, great work guys! I did everything per the instructions, except the awscli permissions bit, which seems unnecessary. Now I just need the Smart Home component to support Input Select and Input Number. @bitglue @mike-grant

@bitglue
Copy link
Author

bitglue commented Feb 17, 2018 via email

@bitglue
Copy link
Author

bitglue commented Feb 17, 2018

It does not appear the owner of this repository is active, so I'm closing this PR. The changes have been incorporated at https://github.com/mike-grant/haaska so I'd refer people there.

@bitglue bitglue closed this Feb 17, 2018
TheJulianJES added a commit to TheJulianJES/home-assistant.github.io that referenced this pull request Feb 17, 2018
Since auchter/haaska#109 was closed and the original repository was not updated in a long time and still uses the Alexa Smart Home Skill v2, this should be updated to the branch of @mike-grant which actually uses the "Home Assistant HTTP API for Alexa Smart Home" // v3.
@befaint
Copy link

befaint commented Mar 18, 2018

@bitglue
Can you please support me how to "Make a Lambda function to bridge the gap" in your post?
(Link: https://gist.github.com/bitglue/66ca023b3c3c1a5b267bdd1d9b3ee48f)
Can you post some screenshots when you make the Lambda function?

Thank you.

@anthonylavado
Copy link

@befaint The best thing to do is to use the code and wiki we've got available at https://github.com/mike-grant/haaska.

It has the completed version of the Lambda function.

@befaint
Copy link

befaint commented Mar 19, 2018

@anthonylavado
I set up it and worked for me. Thank you very much.
I tried to add the domain "input_number" but Alexa couldn't find any entities (of the "input_number").
Can you please help me?

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

Successfully merging this pull request may close these issues.

10 participants