The Haaska Super Thread

haaska
Tags: #<Tag:0x00007fd0784b5de8>

#82

I see it was suppised to be haaska.event_handler. I changed it & the error changed.
I set my configuration.yaml just like the wiki.

api:

alexa:
  smart_home:

The error is now

START RequestId: ad5776f3-ecfc-49e2-bca6-36bc64929ab7 Version: $LATEST
(‘Connection aborted.’, RemoteDisconnected(‘Remote end closed connection without response’,)): ConnectionError
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 65, in post
timeout=(None, read_timeout))
File “/var/task/requests/sessions.py”, line 581, in post
return self.request(‘POST’, url, data=data, json=json, **kwargs)
File “/var/task/requests/sessions.py”, line 533, in request
resp = self.send(prep, **send_kwargs)
File “/var/task/requests/sessions.py”, line 646, in send
r = adapter.send(request, **kwargs)
File “/var/task/requests/adapters.py”, line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: (‘Connection aborted.’, RemoteDisconnected(‘Remote end closed connection without response’,))

END RequestId: ad5776f3-ecfc-49e2-bca6-36bc64929ab7

Any ideas?? I notice if I browse to /api/smart_home I get a text page from HA saying 404 not found.


#83

Hello!
I was able to set-up haaska and I can see aaaaaalll my devices in Alexa.
Now, which is the best way to ask alexa for a sensor? :slight_smile:
I can see it on the app and it’s showing me the temperature.
Many thaks and great job!!
Simon


#84

Do mean you see it in the alexa app and see the temp?


#85

Hello,
I see the value in the Alexa app, yes.
I would like to ask alexa to read it, i.e. "Alexa, tell me the actual temperature in ".
I can actually do it for turning ON/OFF the devices.
Thanks!!
Simon


#86

Hmm interesting. I have some ecobee sensors and thermostat set up in Alexa using the ecobee skill. I am able to ask alexa what is the temp of the thermostat. But was was pretty neat, was I created rooms with Alexa, added the individual ecobee sensors to each room and then was able to ask “alexa what is the temperature of the bedroom.” Try playing around with that. Basically if the app sees the temp, I suspect you should be able to ask, just might take a few tries to figure out the actual wording


#87

Ok, thanks, I’ll give a detailed try. Most of the time, I’m asking wrong and funny things happens, like music from spotify :smiley:
BTW, another question. Now, I’ve NOT filtered devices, so via haaska near everything is shown.
I’ve a device (connected from Home Assistant via MQTT / mysensors) which is shown as follow in Home Assistant:

    "sensor_id": 24,
    "children": {
        "1": {
            "id": 1,
            "type": 13,
            "description": "WATT",
            "values": {
                "24": "262.5",
                "25": "182.0",
                "17": "268.1"
            }
        },

Its possible that nested values are not exposed to haaska / Amazon?
The device doesn’t show up. In Home assistant is like this:

 [sensor.node24power_24_1]
 268.1
 battery_level: 0
 heartbeat: 0
 child_id: 1
 description: WATT
 device: mqtt
 node_id: 24
 V_VAR1: 262.5
 V_VAR2: 182.0
 V_WATT: 268.1
 unit_of_measurement: W
 friendly_name: node24Power 24 1

Ideas?

Thanks!

Simon


#88

I am facing a problem in Testing Haaska

START RequestId: c2d52e4f-82f8-45ad-b81d-44237b05928d Version: $LATEST
Expecting value: line 2 column 10 (char 11): JSONDecodeError
Traceback (most recent call last):
  File "/var/task/haaska.py", line 106, in event_handler
    config = Configuration('config.json')
  File "/var/task/haaska.py", line 80, in __init__
    self._json = json.load(f)
  File "/var/lang/lib/python3.6/json/__init__.py", line 299, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/var/lang/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/var/lang/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/var/lang/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 10 (char 11)

END RequestId: c2d52e4f-82f8-45ad-b81d-44237b05928d
REPORT RequestId: c2d52e4f-82f8-45ad-b81d-44237b05928d	Duration: 30.76 ms	Billed Duration: 100 ms 	Memory Size: 128 MB	Max Memory Used: 65 MB

#89

Hi @xefil! I just replied on your GitHub issue, but for everyone here to see:

Alexa’s Smart Home Skill API does not support all sensors. As a result, it’s not something that either Haaska or Home Assistant can fix/change.

For reference, this page lists the capabilities that could be used (please note that not all of these are implemented by Home Assistant):
https://developer.amazon.com/docs/device-apis/list-of-interfaces.html

It does have a handy reference for utterances (phrases) though!


#90

Hi @smile :wave:

It looks like there’s an error in your config.json. If I had to guess, you’re missing something in the URL line.

Just like in the example, it’s important to make sure that the quotes " are there, and that the colon :is there as well.

{
  "url": "http://localhost:8123/api",
  "bearer_token": "",
  "debug": false,
  "ssl_verify": true,
  "ssl_client": []
}

Even if everything looks correct, try taking out the quotes and putting them back in. Sometimes a computer/phone/tablet will put in smart/curly quotes “”, instead of the correct straight quotes "".


#91

config.json

{
  "url": "http://hassio.local:8123/api",
  "bearer_token": "example QiLCJhbGciOiJIUzI1NiJ",
  "debug": false,
  "ssl_verify": true,
  "ssl_client": []
}


Response:
{
  "errorMessage": "HTTPConnectionPool(host='hassio.local', port=8123): Max retries exceeded with url: /api/alexa/smart_home (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f7b49bb4c50>: Failed to establish a new connection: [Errno -2] Name or service not known',))",
  "errorType": "ConnectionError",
  "stackTrace": [
    [
      "/var/task/haaska.py",
      111,
      "event_handler",
      "return ha.post('alexa/smart_home', event, wait=True)"
    ],
    [
      "/var/task/haaska.py",
      65,
      "post",
      "timeout=(None, read_timeout))"
    ],
    [
      "/var/task/requests/sessions.py",
      581,
      "post",
      "return self.request('POST', url, data=data, json=json, **kwargs)"
    ],
    [
      "/var/task/requests/sessions.py",
      533,
      "request",
      "resp = self.send(prep, **send_kwargs)"
    ],
    [
      "/var/task/requests/sessions.py",
      646,
      "send",
      "r = adapter.send(request, **kwargs)"
    ],
    [
      "/var/task/requests/adapters.py",
      516,
      "send",
      "raise ConnectionError(e, request=request)"
    ]
  ]
}

Request ID:
"c744a72a-7459-4fd7-ad92-ccd9524b27b9"

Function Logs:
START RequestId: c744a72a-7459-4fd7-ad92-ccd9524b27b9 Version: $LATEST
HTTPConnectionPool(host='hassio.local', port=8123): Max retries exceeded with url: /api/alexa/smart_home (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f7b49bb4c50>: Failed to establish a new connection: [Errno -2] Name or service not known',)): ConnectionError
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 65, in post
    timeout=(None, read_timeout))
  File "/var/task/requests/sessions.py", line 581, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/var/task/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/var/task/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/var/task/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='hassio.local', port=8123): Max retries exceeded with url: /api/alexa/smart_home (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f7b49bb4c50>: Failed to establish a new connection: [Errno -2] Name or service not known',))

END RequestId: c744a72a-7459-4fd7-ad92-ccd9524b27b9
REPORT RequestId: c744a72a-7459-4fd7-ad92-ccd9524b27b9	Duration: 216.82 ms	Billed Duration: 300 ms 	Memory Size: 128 MB	Max Memory Used: 63 MB	

config.json

{
  "url": "http://my.duckdns.org/api",
  "bearer_token": "example QiLCJhbGciOiJIUzI1NiJ",
  "debug": false,
  "ssl_verify": true,
  "ssl_client": []
}


Response:
{
  "errorMessage": "2019-03-16T00:50:12.736Z 29f3eb20-7820-4a71-825f-9c340566f10a Task timed out after 3.00 seconds"
}

Request ID:
"29f3eb20-7820-4a71-825f-9c340566f10a"

Function Logs:
START RequestId: 29f3eb20-7820-4a71-825f-9c340566f10a Version: $LATEST
END RequestId: 29f3eb20-7820-4a71-825f-9c340566f10a
REPORT RequestId: 29f3eb20-7820-4a71-825f-9c340566f10a	Duration: 3003.15 ms	Billed Duration: 3000 ms 	Memory Size: 128 MB	Max Memory Used: 64 MB	
2019-03-16T00:50:12.736Z 29f3eb20-7820-4a71-825f-9c340566f10a Task timed out after 3.00 seconds