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

Process to upgrade to a new version #62

Open
ctripodi opened this issue Jun 17, 2017 · 20 comments
Open

Process to upgrade to a new version #62

ctripodi opened this issue Jun 17, 2017 · 20 comments

Comments

@ctripodi
Copy link

Hi,
Looks like there are a lot of new features bearing in mind the last comments. I tryed to upgrade the version according to the item "Upgrading" but it does not work for me.
I am really happy with this project and I am new on this.
Can you please improve the procedure to upgrade to a new version?
Can you please provide more details?
For example, It is neccesary to upgrade in the HA server? or in the Amazon cloud? or both?
Thanks a lot

@auchter
Copy link
Owner

auchter commented Jun 17, 2017

Improving this documentation (and actually having a better concept of a "release") is on my TODO list.

In the mean time, generally updating is as simple as grabbing the latest code and running make deploy, or running make and manually uploading the resulting haaska.zip file to AWS Lambda. No changes to your HA server should be necessary.

@azeroth12
Copy link

I tried to upgrade with these steps and can't get the new version to pass the test on the lambda side. My old zip file works fine, any ideas? Log:

START RequestId: 495e005c-5b83-11e7-85ce-51da321514a5 Version: $LATEST
type object 'allowed' has no attribute 'Control': AttributeError
Traceback (most recent call last):
  File "/var/task/haaska.py", line 660, in event_handler
    ha, payload)
  File "/var/task/haaska.py", line 289, in invoke
    obj = make_class(allowed)(namespace, name, ha, context)
AttributeError: type object 'allowed' has no attribute 'Control'

END RequestId: 495e005c-5b83-11e7-85ce-51da321514a5
REPORT RequestId: 495e005c-5b83-11e7-85ce-51da321514a5	Duration: 1.22 ms

@trisk
Copy link
Contributor

trisk commented Jun 27, 2017

@azeroth12 What does your config.json look like?

@azeroth12
Copy link

Did a straight copy of the sample and just updated my info.

{
  "url": "https://[url]:8123/api",
  "password": "[pass]",
  "ssl_verify": false,
  "expose_by_default": false,
  "exposed_domains": [
    "alert",
    "automation",
    "climate",
    "cover",
    "fan",
    "group",
    "input_boolean",
    "input_slider",
    "light",
    "lock",
    "media_player",
    "scene",
    "script",
    "switch"
  ],
  "entity_suffixes": {
    "alert": "",
    "automation": "",
    "climate": "",
    "cover": "",
    "fan": "",
    "group": "Group",
    "input_boolean": "",
    "input_slider": "",
    "light": "",
    "lock": "",
    "media_player": "",
    "scene": "Scene",
    "script": "",
    "switch": ""
  },
  "debug": false
}

@trisk
Copy link
Contributor

trisk commented Jun 27, 2017

Hm, could be something weird on the Amazon end. Are you 1) using the latest change from the master branch and 2) have Smart Home as the only trigger for your Lambda function?
A log with "debug": true might help explain what is going on.

@auchter It looks like the event namespace is appearing as "Control" instead of "Alexa.Control" here, have you ever seen this?

@azeroth12
Copy link

  1. Yes, just double checked. Original was the zip from the master branch. Re-downloaded 0.3.1 just to make sure. 2. Yes only the one trigger.

Only weird thing I've seen is that the old zip file once uploaded has python 3 at the top of the code snipit. The new file has python 2.7. Not sure if that is anything... Lamda is still set up for 2.7 even though 3.6 is now an option (don't remember it from before).

@azeroth12
Copy link

Not much different with debug...


START RequestId: 64ca298f-5b93-11e7-92e5-993ce9fb27f1 Version: $LATEST
[DEBUG]	2017-06-27T23:50:26.945Z	64ca298f-5b93-11e7-92e5-993ce9fb27f1	calling event handler for DiscoverAppliancesRequest, payload: {}
type object 'allowed' has no attribute 'Control': AttributeError
Traceback (most recent call last):
  File "/var/task/haaska.py", line 660, in event_handler
    ha, payload)
  File "/var/task/haaska.py", line 289, in invoke
    obj = make_class(allowed)(namespace, name, ha, context)
AttributeError: type object 'allowed' has no attribute 'Control'

END RequestId: 64ca298f-5b93-11e7-92e5-993ce9fb27f1
REPORT RequestId: 64ca298f-5b93-11e7-92e5-993ce9fb27f1	Duration: 1.15 ms

@TheJulianJES
Copy link

Same problem like @azeroth12 (fresh install)

@azeroth12
Copy link

I've reverted back to the old version for now... haven't given this guy another go yet. Not really sure what the issue is...

@azeroth12
Copy link

azeroth12 commented Jul 18, 2017

Nice to know I'm not alone with the problem.

@TheJulianJES
Copy link

TheJulianJES commented Jul 18, 2017

Which version is working for you atm?
The nest command is not working regardless of the server it seems.

@azeroth12
Copy link

Doesn't have a version from what I can see, but based on the change log, seems like I'm running the original. 0.1.

@TheJulianJES
Copy link

The test seems to work fine with 0.2. (Failed with 0.3.1)
I'm gonna test the skill now.

@TheJulianJES
Copy link

TheJulianJES commented Jul 19, 2017

The error seems to be caused by 2b274b8
It works fine without the 'new event handler' for me.

@azeroth12
Copy link

Removing that return stops the error on test, but doesn't seem to return any of my devices. Are you actually able to add ha entities to Alexa?

@TheJulianJES
Copy link

I actually took the source from 2.0 and added each commit except 2b274b8 manually.

@azeroth12
Copy link

Gotcha using the revision right before that commit does work for me. Thanks! I guess any changes after 2b274b8 we'll be out of luck for now...

@azeroth12
Copy link

Guh, we're stupid, I'm guessing you're doing the same thing I was. using that test script from the youtube video. Well in that commit (2b274b8) the class structure was reworked so the new test should be...

{
  "header": {
    "payloadVersion": "1",
    "namespace": "Alexa.ConnectedHome.Discovery",
    "name": "DiscoverAppliancesRequest"
  },
  "payload": {
    "accessToken": "whatever"
  }
}

Haaska works fine, all expected entites are coming into Alexa...

@trisk
Copy link
Contributor

trisk commented Jul 19, 2017

@azeroth12 Thanks, that clears things up. There's a stock smart home discovery request in the list of tests on the Lambda console itself, can you see if that still works for you?

@azeroth12
Copy link

azeroth12 commented Jul 19, 2017

Yep sure does. It's basically the same thing.

{
  "header": {
    "payloadVersion": "2",
    "namespace": "Alexa.ConnectedHome.Discovery",
    "name": "DiscoverAppliancesRequest",
    "messageId": "F8752B11-69BB-4246-B923-3BFB27C06C7D"
  },
  "payload": {
    "accessToken": "1"
  }
}

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

No branches or pull requests

5 participants