The Haaska Super Thread

Hi everyone.
I can’t understand why haaska doesn’t work anymore. when I run the test from aws -> Lambda I get the following error:

Response:
{
  "errorMessage": "500 Server Error: Internal Server Error for url: https://xxxxxx.duckdns.org:8123/api/alexa/smart_home",
  "errorType": "HTTPError",
  "stackTrace": [
    [
      "/var/task/haaska.py",
      111,
      "event_handler",
      "return ha.post('alexa/smart_home', event, wait=True)"
    ],
    [
      "/var/task/haaska.py",
      66,
      "post",
      "r.raise_for_status()"
    ],
    [
      "/var/task/requests/models.py",
      940,
      "raise_for_status",
      "raise HTTPError(http_error_msg, response=self)"
    ]
  ]
}

Request ID:
"535b8212-7d8f-496c-84c0-a40475d4c3b1"

Function Logs:
START RequestId: 535b8212-7d8f-496c-84c0-a40475d4c3b1 Version: $LATEST
500 Server Error: Internal Server Error for url: https://xxxxxxxx.duckdns.org:8123/api/alexa/smart_home: HTTPError
Traceback (most recent call last):
  File "/var/task/haaska.py", line 111, in event_handler
    return ha.post('alexa/smart_home', event, wait=True)
  File "/var/task/haaska.py", line 66, 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: 500 Server Error: Internal Server Error for url: https://xxxxxxx.duckdns.org:8123/api/alexa/smart_home

END RequestId: 535b8212-7d8f-496c-84c0-a40475d4c3b1
REPORT RequestId: 535b8212-7d8f-496c-84c0-a40475d4c3b1	Duration: 542.27 ms	Billed Duration: 600 ms 	Memory Size: 128 MB	Max Memory Used: 58 MB	

does anyone know why?

thank you

Will this skill allow me to interact with my Home Assistant input_select integration? I use input_select to change my presence “mode”, ie Asleep, Awake, etc., which I have completely automated based on presence sensors, but as a backup or the ability to turn it on and off like a switch, I would like to be able to integrate those in my Alexa “Good Morning”, “Good Night” routines that I currently use. Is this possible in HA? I was able to do it in webCore, by adding my “modes” as a scene in Alexa, and adding that scene to my routine, but can’t figure out how to do this in HA.

I haven’t tried exporting an input_select fro HA to Alexa via Haaska, so that part I’m not sure about.

I have exported input_boolean (as a LIGHT) and have exported scene(s) and Alexa sees them and can turn the input_boolean on (which HA sees) and Alexa can call a scene (which HA will run) and both work.

Hi, sorry for the question… Where is the direct link of the new version of “shrinked” hasska? I need only to replace it with old version?

Anyone know if it is possible with Haaska to tell Alexa to set the value of an input_number?

The problem I’m running into is that the Mike Grant version of Haaska (from here https://github.com/mike-grant/haaska/wiki, which I am using) does not expose input_numbers to Alexa.

According to its documentations (here https://github.com/auchter/haaska), the older Auchter version of Haaska exposed input sliders (which have been deprecated by HA and replaced by input numbers) to Alexa, so you theoretically could have just said “Alexa set [input number] to 5.” But with the more recent Mike Grant version, Alexa can’t see my input_numbers.

I have tried expressly including the input_number domain in the Alexa Smart Home section of my configuration.yaml, but that does not work. Even if expressly included, Alexa does not see them.

I found a couple of examples suggesting that a script using “{{ requested_level }}” would do the trick. I think the people who posted these comments are using emulated hue, not Haaska. These examples use an input number and script in the following format:

## In configuration.yaml
input_number:
  time_charging:
    name: Charging Hours
    min: 1
    max: 8
    step: 1

## In scripts.yaml
time_charging:
  sequence:
    - service: input_number.set_value
      data_template:
        entity_id: input_number.time_charging
        value: "{{ requested_level }}"

But when I incorporate this into my setup, and say " Alexa, set Charging Time to 5," Alexa replies “Charging Time doesn’t support that.”

For context, I am running Hassio on a Rasberry Pi.

Has anyone using the Mike Grant Haaska found a way to set input numbers via an Alexa command?

It’s in the first post here: https://github.com/mike-grant/haaska/issues/104

Sorry to read a major contributor will stop his activity, I ask before remaking integration from beginning to know if someone else encountered this problem, I have lambda test failed with the error like this

START RequestId: 077120e9-9039-11e8-83f3-a15fbdabfa96 Version: $LATEST
401 Client Error: Unauthorized for url: https://{PUBLIC_URL/api/alexa/smart_home: HTTPError
Traceback (most recent call last):
File “/var/task/haaska.py”, line 108, in event_handler
return ha.post(‘alexa/smart_home’, event, wait=True).json()
File “/var/task/haaska.py”, line 62, in post
r.raise_for_status()
File “/var/task/requests/models.py”, line 939, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url:

I’m in Italy and made lambda function selecting EU Ireland, is a few time I don’t use vocal commands for device exposed by hassio but I read that I must redo lambda function selecting Virginia, is this the way because this was a change?

I’m in Italy. You need to use ireland

Hi
because of point 4 on:
http://collingwood.me.uk/blog/index.php/hass-io-and-alexa/

I would like to allow only necessary IP addresses access to my homeassistent from outside.
Is it possible to see which IP addresses connect to my home assistent so I could whitelist them?

hi everyone

I made the mistake of posting in the main forum and realise that i might get more help here. From what I’ve searched in this thread it seems a couple of people have had the same issue that I am facing and I’m not sure if they ever resolved it and what to do?

{
  "event": {
    "header": {
      "messageId": "8d49fde9-20e2-4629-91ac-9471c1e2b20e",
      "name": "Discover.Response",
      "namespace": "Alexa.Discovery",
      "payloadVersion": "3"
    },
    "payload": {
      "endpoints": [
        {
          "capabilities": [
            {
              "interface": "Alexa.SceneController",
              "properties": {
                "proactivelyReported": false,
                "retrievable": false,
                "supported": []
              },
              "supportsDeactivation": false,
              "type": "AlexaInterface",
              "version": "3"
            }
          ],
          "cookie": {},
          "description": "script.switch_shield",
          "displayCategories": [
            "ACTIVITY_TRIGGER"
          ],
          "endpointId": "script#switch_shield",
          "friendlyName": "switch_shield",
          "manufacturerName": "Home Assistant"
        },
        {
          "capabilities": [
            {
              "interface": "Alexa.SceneController",
              "properties": {
                "proactivelyReported": false,
                "retrievable": false,
                "supported": []
              },
              "supportsDeactivation": false,
              "type": "AlexaInterface",
              "version": "3"
            }
          ],
          "cookie": {},
          "description": "script.denon_volume_up",
          "displayCategories": [
            "ACTIVITY_TRIGGER"
          ],
          "endpointId": "script#denon_volume_up",
          "friendlyName": "denon_volume_up",
          "manufacturerName": "Home Assistant"
        },
        {
          "capabilities": [
            {
              "interface": "Alexa.SceneController",
              "properties": {
                "proactivelyReported": false,
                "retrievable": false,
                "supported": []
              },
              "supportsDeactivation": false,
              "type": "AlexaInterface",
              "version": "3"
            }
          ],
          "cookie": {},
          "description": "script.shield_on",
          "displayCategories": [
            "ACTIVITY_TRIGGER"
          ],
          "endpointId": "script#shield_on",
          "friendlyName": "shield_on",
          "manufacturerName": "Home Assistant"
        },
        {
          "capabilities": [
            {
              "interface": "Alexa.SceneController",
              "properties": {
                "proactivelyReported": false,
                "retrievable": false,
                "supported": []
              },
              "supportsDeactivation": false,
              "type": "AlexaInterface",
              "version": "3"
            }
          ],
          "cookie": {},
          "description": "script.shield_power_off",
          "displayCategories": [
            "ACTIVITY_TRIGGER"
          ],
          "endpointId": "script#shield_power_off",
          "friendlyName": "shield_power_off",
          "manufacturerName": "Home Assistant"
        },
        {
          "capabilities": [
            {
              "interface": "Alexa.SceneController",
              "properties": {
                "proactivelyReported": false,
                "retrievable": false,
                "supported": []
              },
              "supportsDeactivation": false,
              "type": "AlexaInterface",
              "version": "3"
            }
          ],
          "cookie": {},
          "description": "script.shield_power_on",
          "displayCategories": [
            "ACTIVITY_TRIGGER"
          ],
          "endpointId": "script#shield_power_on",
          "friendlyName": "shield_power_on",
          "manufacturerName": "Home Assistant"
        },
        {
          "capabilities": [
            {
              "interface": "Alexa.SceneController",
              "properties": {
                "proactivelyReported": false,
                "retrievable": false,
                "supported": []
              },
              "supportsDeactivation": false,
              "type": "AlexaInterface",
              "version": "3"
            }
          ],
          "cookie": {},
          "description": "script.tv_power_off",
          "displayCategories": [
            "ACTIVITY_TRIGGER"
          ],
          "endpointId": "script#tv_power_off",
          "friendlyName": "tv_power_off",
          "manufacturerName": "Home Assistant"
        },
        {
          "capabilities": [
            {
              "interface": "Alexa.SceneController",
              "properties": {
                "proactivelyReported": false,
                "retrievable": false,
                "supported": []
              },
              "supportsDeactivation": false,
              "type": "AlexaInterface",
              "version": "3"
            }
          ],
          "cookie": {},
          "description": "script.switch_bt",
          "displayCategories": [
            "ACTIVITY_TRIGGER"
          ],
          "endpointId": "script#switch_bt",
          "friendlyName": "switch_bt",
          "manufacturerName": "Home Assistant"
        },
        {
          "capabilities": [
            {
              "interface": "Alexa.SceneController",
              "properties": {
                "proactivelyReported": false,
                "retrievable": false,
                "supported": []
              },
              "supportsDeactivation": false,
              "type": "AlexaInterface",
              "version": "3"
            }
          ],
          "cookie": {},
          "description": "script.projector_off",
          "displayCategories": [
            "ACTIVITY_TRIGGER"
          ],
          "endpointId": "script#projector_off",
          "friendlyName": "projector_off",
          "manufacturerName": "Home Assistant"
        },
        {
          "capabilities": [
            {
              "interface": "Alexa.SceneController",
              "properties": {
                "proactivelyReported": false,
                "retrievable": false,
                "supported": []
              },
              "supportsDeactivation": false,
              "type": "AlexaInterface",
              "version": "3"
            }
          ],
          "cookie": {},
          "description": "script.tv_power_on",
          "displayCategories": [
            "ACTIVITY_TRIGGER"
          ],
          "endpointId": "script#tv_power_on",
          "friendlyName": "tv_power_on",
          "manufacturerName": "Home Assistant"
        },
        {
          "capabilities": [
            {
              "interface": "Alexa.PowerController",
              "properties": {
                "proactivelyReported": true,
                "retrievable": true,
                "supported": [
                  {
                    "name": "powerState"
                  }
                ]
              },
              "type": "AlexaInterface",
              "version": "3"
            },
            {
              "interface": "Alexa.EndpointHealth",
              "properties": {
                "proactivelyReported": false,
                "retrievable": true,
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ]
              },
              "type": "AlexaInterface",
              "version": "3"
            }
          ],
          "cookie": {},
          "description": "switch.projector_off",
          "displayCategories": [
            "SWITCH"
          ],
          "endpointId": "switch#projector_off",
          "friendlyName": "Projector",
          "manufacturerName": "Home Assistant"
        },
        {
          "capabilities": [
            {
              "interface": "Alexa.PowerController",
              "properties": {
                "proactivelyReported": true,
                "retrievable": true,
                "supported": [
                  {
                    "name": "powerState"
                  }
                ]
              },
              "type": "AlexaInterface",
              "version": "3"
            },
            {
              "interface": "Alexa.EndpointHealth",
              "properties": {
                "proactivelyReported": false,
                "retrievable": true,
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ]
              },
              "type": "AlexaInterface",
              "version": "3"
            }
          ],
          "cookie": {},
          "description": "switch.denon_power",
          "displayCategories": [
            "SWITCH"
          ],
          "endpointId": "switch#denon_power",
          "friendlyName": "Denon",
          "manufacturerName": "Home Assistant"
        },
        {
          "capabilities": [
            {
              "interface": "Alexa.PowerController",
              "properties": {
                "proactivelyReported": true,
                "retrievable": true,
                "supported": [
                  {
                    "name": "powerState"
                  }
                ]
              },
              "type": "AlexaInterface",
              "version": "3"
            },
            {
              "interface": "Alexa.EndpointHealth",
              "properties": {
                "proactivelyReported": false,
                "retrievable": true,
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ]
              },
              "type": "AlexaInterface",
              "version": "3"
            }
          ],
          "cookie": {},
          "description": "switch.projector_screen",
          "displayCategories": [
            "SWITCH"
          ],
          "endpointId": "switch#projector_screen",
          "friendlyName": "Projector Screen",
          "manufacturerName": "Home Assistant"
        },
        {
          "capabilities": [
            {
              "interface": "Alexa.PowerController",
              "properties": {
                "proactivelyReported": true,
                "retrievable": true,
                "supported": [
                  {
                    "name": "powerState"
                  }
                ]
              },
              "type": "AlexaInterface",
              "version": "3"
            },
            {
              "interface": "Alexa.EndpointHealth",
              "properties": {
                "proactivelyReported": false,
                "retrievable": true,
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ]
              },
              "type": "AlexaInterface",
              "version": "3"
            }
          ],
          "cookie": {},
          "description": "switch.living_room_lamp",
          "displayCategories": [
            "SWITCH"
          ],
          "endpointId": "switch#living_room_lamp",
          "friendlyName": "Living Room Lamp",
          "manufacturerName": "Home Assistant"
        },
        {
          "capabilities": [
            {
              "interface": "Alexa.PowerController",
              "properties": {
                "proactivelyReported": true,
                "retrievable": true,
                "supported": [
                  {
                    "name": "powerState"
                  }
                ]
              },
              "type": "AlexaInterface",
              "version": "3"
            },
            {
              "interface": "Alexa.EndpointHealth",
              "properties": {
                "proactivelyReported": false,
                "retrievable": true,
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ]
              },
              "type": "AlexaInterface",
              "version": "3"
            }
          ],
          "cookie": {},
          "description": "switch.bt_input",
          "displayCategories": [
            "SWITCH"
          ],
          "endpointId": "switch#bt_input",
          "friendlyName": "BT input",
          "manufacturerName": "Home Assistant"
        },
        {
          "capabilities": [
            {
              "interface": "Alexa.PowerController",
              "properties": {
                "proactivelyReported": true,
                "retrievable": true,
                "supported": [
                  {
                    "name": "powerState"
                  }
                ]
              },
              "type": "AlexaInterface",
              "version": "3"
            },
            {
              "interface": "Alexa.EndpointHealth",
              "properties": {
                "proactivelyReported": false,
                "retrievable": true,
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ]
              },
              "type": "AlexaInterface",
              "version": "3"
            }
          ],
          "cookie": {},
          "description": "switch.bt_power",
          "displayCategories": [
            "SWITCH"
          ],
          "endpointId": "switch#bt_power",
          "friendlyName": "BT Power",
          "manufacturerName": "Home Assistant"
        },
        {
          "capabilities": [
            {
              "interface": "Alexa.PowerController",
              "properties": {
                "proactivelyReported": true,
                "retrievable": true,
                "supported": [
                  {
                    "name": "powerState"
                  }
                ]
              },
              "type": "AlexaInterface",
              "version": "3"
            },
            {
              "interface": "Alexa.EndpointHealth",
              "properties": {
                "proactivelyReported": false,
                "retrievable": true,
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ]
              },
              "type": "AlexaInterface",
              "version": "3"
            }
          ],
          "cookie": {},
          "description": "switch.tv_power",
          "displayCategories": [
            "SWITCH"
          ],
          "endpointId": "switch#tv_power",
          "friendlyName": "TV Power",
          "manufacturerName": "Home Assistant"
        },
        {
          "capabilities": [
            {
              "interface": "Alexa.PowerController",
              "properties": {
                "proactivelyReported": true,
                "retrievable": true,
                "supported": [
                  {
                    "name": "powerState"
                  }
                ]
              },
              "type": "AlexaInterface",
              "version": "3"
            },
            {
              "interface": "Alexa.EndpointHealth",
              "properties": {
                "proactivelyReported": false,
                "retrievable": true,
                "supported": [
                  {
                    "name": "connectivity"
                  }
                ]
              },
              "type": "AlexaInterface",
              "version": "3"
            }
          ],
          "cookie": {},
          "description": "switch.shield_input",
          "displayCategories": [
            "SWITCH"
          ],
          "endpointId": "switch#shield_input",
          "friendlyName": "Shield input",
          "manufacturerName": "Home Assistant"
        }
      ]
    }
  }
}

Everything seems to work in haaska

and I’ve got this in my config file

alexa:
  smart_home:
    filter:
      include_domains:
        - switch
        - script

Not sure what else I should be doing to get Alexa to discover the devices? I can’t see the skill in my alexa skills in the app but not sure that I should be etc…

I saw someone changed payload version to v2 to see if that worked but alas it did not, so I changed it back.

Some help would be really appreciated!! Thanks

Hi everyone

I thought it must be something obvious!

I scrolled up to see if I could find the answer (sorry should have done that in the first place). Anyway, here is the solution that worked for me!

In my Alexa app (iOS) this is what I do:

  • Open left menu
  • Choose “Skills & Games”
  • Select “Your Skills” in the top menu
  • Slide “Enabled” over until you get to “Dev”
  • The skill should be there, and you can activate it.

Hi all,

I have a weird behavior that I could not find the explanation for:
every time I ask Alexa to turn a device on or off it tells me that the device isn’t responding but if I ask Alexa again - all works perfectly. I always have to ask twice.

Any ideas on what could be wrong?

Hi All, making the jump to haaska due to my emulated_hue stopping working. I’ve followed most of the instructions I can, but my lambda seems to have some issue with the recommended tests… I’m getting the following:

START RequestId: 01047dbb-74c0-4ac7-908c-2b0af5c82001 Version: $LATEST
'header': KeyError
Traceback (most recent call last):
  File "/var/task/haaska.py", line 652, in event_handler
    name = event['header']['name']
KeyError: 'header'
END RequestId: 01047dbb-74c0-4ac7-908c-2b0af5c82001

This is from the 0.3.1 release. I do have the awscli installed and working, if I run make discover (after adding my long life token to the Makefile I get the following back:

{
  "payload": {
    "discoveredAppliances": {}
  },
  "header": {
    "namespace": "Alexa.ConnectedHome.Discovery",
    "messageId": "ea1256b8-9247-4967-aca7-6a1d23f92486",
    "name": "DiscoverAppliancesResponse",
    "payloadVersion": "2"
  }
}

Then if i do make test (again, populating the payload with the real token, I get the following:

{
  "payload": {
    "isHealthy": false,
    "description": "401 Client Error: Unauthorized for url: https://ha.mydomain.org/api/states"
  },
  "header": {
    "namespace": "Alexa.ConnectedHome.System",
    "messageId": "7b1fce4d-8248-427b-b20f-66e841a0eb49",
    "name": "HealthCheckResponse",
    "payloadVersion": "2"
  }
}
false
make: *** [test] Error 1

I’ve tried re-generating my token, and adding to the config.json in the lambda editor, but hasn’t helped! If anyone could suggest where I need to look, that would be ace.

I’ve done some more digging via Cloudwatch logs etc… HealthCheckRequest is failing, as it returns invalid json… I’m presuming the string ‘401 unauthorized’.

I’ve tried to replicate the request that haaska.py sending, which includes the x-ha-access - This never seems to work for me? I can only get the curl GET request to work by sending the Authorization: Bearer xxxxxxxx header - As per the docs at https://developers.home-assistant.io/docs/en/external_api_rest.html

And it turns out 0.3.1 is from like 1985 or similar. I think I grabbed an old version from a forked git repo! oops! New version works ok :slight_smile:

I’ve installed haaska according to the instructions on the github page, ran the test on aws console page and execution result is succeeded. I look at the result returned by function execution and I see my devices there. I have enabled haaska skill with alexa app, but discovery finds no new devices. I have no clue what to try next, I can’t find anything useful with google. Help?

Maybe try disabling the haaska skill in your Alexa App and enable it again.

Been there, done that, a dozen times. Just can’t get Alexa to find devices, even though the devices shows up in the lambda>functions test details. So, amazon can connect to my HA, gets my devices listed from HA, but does not discover them? :unamused:

I have set up the haaska skill in amazon. Ran the “test” and got back a “green”, positive reply. The haaska skill shows up in my alexa app but indicates “account linking required”. I have read all the forum’s and tried all the suggested fixes but still get the message “We were unable to link haaska at this time” when trying to enable the skill. I think the problem is related to the fact that when I signed up for Amazon Developer I used a email address that is different from the one I use for Alexa. Any ideas would be greatly appreciated

Fixed by starting over so must have screwed up something.

Good day. I’ve got the skill runnning and works fine. However, alexa still discovers the emulated_hue
(Royal Philips Electronics smart devices) despite having removed the component.
Is there any other way to prevent this?
Thank you

edit: solved it. it seems you need to manually delete the emulated_hue entries from the alexa app and then it stops appearing

1 Like