Getting stuck with haaska

Tags: #<Tag:0x00007f7c71562d00>

Hi everyone,
I am very new with the home - assistant (I am using hassio installed on a PI).
I am trying to integrate hassio into my Alexa using haaska however, I am unfamiliar with python. I am trying to follow instruction from BRUH video on youtube https://www.youtube.com/watch?v=zZuwQ9spPkQ
by using PuTTY but I realized that it’s almost different from the video and the fact.
I cannot use the command " > sudo apt-get install zip and
; make it show me the error reads “command not found”
How can I solve with it now?
Thank you for reading
Minh Chau13

@mcnguyen33r Hey there! I hate to be the bearer of bad news, but the video from Bruh is really, really old, and the instructions in it are out of date.

I help maintain an updated version of Haaska that doesn’t require make anymore, and will work for the latest updates. Unfortunately, I haven’t written up complete instructions yet.

You can follow along with instructions from this blog:

http://collingwood.me.uk/blog/index.php/hass-io-and-alexa/

1 Like

An important note - in step 3.2, download this instead:

https://github.com/mike-grant/haaska/releases/download/1.0.0/haaska.zip

Then in Step 3.5, take the folder from what you unzipped, and zip it back up again.

1 Like

Hi anthonylavado,
Many thanks for your help. I will try following your instruction.
I am now using emulated_hue component but it has some disadvantages and trying other method
Thank again
Minh Chau

Dear anthonylavado,
Following yours instructions, I already created haaska however, it does not work. I tested and it leads to false codes below:
Response

{
  "errorMessage": "401 Client Error: Unauthorized for url: https://minhchau.duckdns.org/api/alexa/smart_home",
  "errorType": "HTTPError",
  "stackTrace": [
    [
      "/var/task/haaska.py",
      109,
      "event_handler",
      "return ha.post('alexa/smart_home', event, wait=True).json()"
    ],
    [
      "/var/task/haaska.py",
      63,
      "post",
      "r.raise_for_status()"
    ],
    [
      "/var/task/requests/models.py",
      940,
      "raise_for_status",
      "raise HTTPError(http_error_msg, response=self)"
    ]
  ]
}

Request ID:
"480597b9-fc4c-11e8-8d0d-eda85ebd9bfa"

Function Logs:
START RequestId: 480597b9-fc4c-11e8-8d0d-eda85ebd9bfa Version: $LATEST
[DEBUG]	2018-12-10T07:21:59.119Z	480597b9-fc4c-11e8-8d0d-eda85ebd9bfa	calling alexa/smart_home with {'directive': {'header': {'namespace': 'Alexa.Discovery', 'name': 'Discover', 'payloadVersion': '3', 'messageId': '1bd5d003-31b9-476f-ad03-71d471922820'}, 'payload': {'scope': {'type': 'BearerToken', 'token': 'access-token-from-skill'}}}}
[DEBUG]	2018-12-10T07:21:59.139Z	480597b9-fc4c-11e8-8d0d-eda85ebd9bfa	Starting new HTTPS connection (1): minhchau.duckdns.org:443
[DEBUG]	2018-12-10T07:22:00.753Z	480597b9-fc4c-11e8-8d0d-eda85ebd9bfa	https://minhchau.duckdns.org:443 "POST /api/alexa/smart_home HTTP/1.1" 401 17
401 Client Error: Unauthorized for url: https://mydomain.duckdns.org/api/alexa/smart_home: HTTPError
Traceback (most recent call last):
  File "/var/task/haaska.py", line 109, in event_handler
    return ha.post('alexa/smart_home', event, wait=True).json()
  File "/var/task/haaska.py", line 63, in post
    r.raise_for_status()
  File "/var/task/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://mydomain.duckdns.org/api/alexa/smart_home

END RequestId: 480597b9-fc4c-11e8-8d0d-eda85ebd9bfa
REPORT RequestId: 480597b9-fc4c-11e8-8d0d-eda85ebd9bfa	Duration: 1676.82 ms	Billed Duration: 1700 ms 	Memory Size: 128 MB	Max Memory Used: 30 MB	

I do not know what went wrong.
For your information:
I download haaska from here https://github.com/mike-grant/haaska/releases/download/1.0.0/haaska.zip according to your instruction and kept it unchanged (for I do now know how to run “make” command to get haaska zip file. After uploading to amazon, I edited the config.json online (see picture). I do not know if it’s a cause leading to failure?
Can you check for me where it may occur problems?
Many thanks for your help so far
Best Regards
Minh Chau

Please take the screenshot out of your post and the URL out of the code - I don’t want anyone getting to your server :slight_smile:

Otherwise, it looks like the bearer token might be wrong. I can’t say for sure from here.

Dear anthonylavado,
Many thanks for your time and supports
I struggled with the LX Terminal on NOOB running on my PI to get the haaska.zip done.
The bearer token’s not wrong but I am not sure what’s wrong. Possibly the way I am using original haaska.zip from your link sent and edited the config.json directly on https://console.aws.amazon.com/lambda.
After having my own haaska.zip, I re-uploaded into lambda website and conducted the test: Wow, it works
Alexa discovered new devices from hass.
Once again: THANK YOU
Minh Chau!

@anthonylavado

Hello I’m getting the same ERROR as mcnguyen33r, I upgrade my HA from 49.1 to 86.3 I have made a fresh copy but I’m using Hassbain insead of Hassio I have had my old HA running haaska for since 0.46 and all works good I know there must be something I’m missing but can’t see where.

Thank you

@Dee You definitely made a big jump! There was a lot that changed along the way. Most importantly - Home Assistant doesn’t like using auth passwords anymore (since 0.78) and Haaska has changed too.

You’ll want to basically follow the first post here:

And then use my follow up post here instead of doing the steps that ask for the make command:

Everyone in that thread is super helpful too, if you get stuck.

Dear Dee,
Follow anthonylavado will work, at least for mine
Best regards
Minh Chau

@anthonylavado

can you help me with this?

I just got done Upgrading from HA 0.49.1 to 0.86.3 I finally got everything working.

Haaska done and working except my Intents in HA.

I had a alexa.yaml file in my HA 0.49.1 but now it has to be done like this

alexa:

smarthome:

I’m not sure how to format it under the smarthome structure, I have been using my alexa.yaml file looked like this

intents:

  ActivateSceneIntent:
    action:
      service: scene.turn_on
      data_template:
        entity_id: scene.{{ Scene | replace(" ", "_") }}
    speech:
      type: plaintext
      text: OK
      
  WhereIsCarIntent:
    speech:
      type: plaintext
      text: >
        {%- if is_state('device_tracker.dee', 'home') -%}
          Dee is at home
        {%- else -%}
          The car is at {{ states("device_tracker.dee") }}
        {% endif %}

  RoomTemperature:
    speech:
      type: plaintext
      text: >
        {%- set temp = states('sensor.dark_sky_temperature') | round -%}
        {%- set bed = states('sensor.bedroom_temperature') | round -%}
        {%- set bed_h = states('sensor.bedroom_humidity') | round -%}
        {%- set t_hi = states('sensor.dark_sky_daily_high_temperature') | round -%}
        {%- set t_low = states('sensor.dark_sky_daily_low_temperature') | round -%}
        {%- set feel = states('sensor.dark_sky_apparent_temperature') | round -%}
        {%- set humid = states('sensor.dark_sky_humidity') | round -%}
        {%- set now = states('sensor.dark_sky_summary') -%}
        {%- set hourly = states('sensor.dark_sky_hourly_summary') -%}
        {%- set daily = states('sensor.dark_sky_daily_summary') -%}
        {%- set wind = states('sensor.dark_sky_wind_speed') -%}
        Right now, it is {{ temp }} degrees Out side
        {%- if temp != feel -%}
        but it feels like {{ feel }} degrees
        {%- endif -%}.
        The current humidity is {{ humid }}%.
        Right now, conditions are {{ now }}.
        For today, {{ hourly }}.
        Today's high is {{ t_hi }} and the low is {{ t_low }}.
        The wind speed is {{ wind }} miles per hour.
        The forecast calls for {{ daily }}.
		
  LivingTemp:
    speech:
      type: plaintext
      text: >
        {%- set lvrm = states('sensor.livingroom_temp') | round -%}
        {%- set lvrm_h = states('sensor.livingroom_humidity') | round -%}
        Right now, it is {{ lvrm }} degrees in the living room.
        And the humidity is {{ lvrm_h }}%

Everything works I can turn on and off lights, open/close my blinds, I also was using

alexa: !include alexa.yaml

and would like to keep using the, !include if I can

Thank you

I may be mistaken, but I don’t think Intents are used with Haaska.
My understanding is that Intents are used with ordinary skills, and the ordinary skill uses intents to try and determine what the user intended to say and take action.
Haaska is a “smarthome” skill that teaches Alexa about what home devices you have and already knows commands like turn on device X and turn off device Y, so no intents are needed.

1 Like

The intents I showed have to be in a config.yaml in Home Assistant, Something like ( intent.yaml ) or It can not read my sensors or tell me where someone is when I ask Alexa what is the temp, or where is Dee.

It works fine with the old Haaska but it was under alexa.yaml, The format has changed, and I’m not sure how to set it up.

I already have the skills set up on amazon Developer

I’ve looked around and can’t find anything that says intents work with alexa: smarthome:
so I wished I could help more directly.
I’m a bit curious, when this worked before in your 0.49, could your Alexa App (iPAD/iPhone) see your HA devices?

Yes see’s them all

I was wondering on the format if I could do

alexa: !include alexa.yaml
then smarthome:

or
alexa:
then smarthome: !include something.yaml.

I used this to get my Old one working

https://www.home-assistant.io/components/alexa/

just seems to me some one else has to be doing this it cant be just me.

the pepole that helped me before was @smkelly and @RobDYI