Just for the heck of it, I added the port to the end of my URL at my Alexa skill in my Amazon Developer Services console and it stopped working. Removed the port, everything was fine again.
Browse the end point in the browser with and without the port, what happens?
Yeah I removed the port in my console also, still complains that it canāt talk to my home assistant API.
Itās 100% not the port at the end. All the port forwarding is doing is the routerās NAT changing when the requests goes to in the LAN anyway, so that shouldnāt matter. I think thereās something else going on. What do both of your configs.yaml look like?
Did you adjust your router? Removing the port wonāt do anything unless you do that first.
homeassistant:
Name of the location where Home Assistant is running
name: Home
Location required to calculate the time the sun rises and sets
latitude: redacted
longitude: redacted
Impacts weather/sunrise data (altitude above sea level in meters)
elevation: 213
metric for Metric, imperial for Imperial
unit_system: imperial
Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: America/Detroit
frontend:
http:
Uncomment this to add a password (recommended!)
api_password: redacted
ssl_certificate: /etc/letsencrypt/live/stapley.duckdns.org/fullchain.pem
ssl_key: /etc/letsencrypt/live/stapley.duckdns.org/privkey.pem
updater:
discovery:
conversation:
history:
logbook:
sun:
recorder:
group:
living room lights:
- switch.aeotec_dsc06106_smart_energy_switch_switch_4
- switch.aeotec_zw096_smart_switch_6_switch_5
alexa:
intents:
WhereAreWeIntent:
speech:
type: plaintext
text: >
Test
automation: !include automation.yaml
sensor:
- platform: darksky
api_key: redacted
monitored_conditions:
- summary
- icon
- precip_type
- precip_intensity
- precip_probability
- temperature
- apparent_temperature
- wind_speed
- wind_bearing
- cloud_cover
- humidity
- pressure
- visibility
- minutely_summary
- hourly_summary
- daily_summary
- temperature_max
- temperature_min
- apparent_temperature_max
- apparent_temperature_min
- precip_intensity_max
zwave:
usb_path: /dev/ttyUSB0
mqtt:
broker: 192.168.1.21
port: 1883
client_id: home-assistant
keepalive: 60
device_tracker:
- platform: owntracks
- platform: tomato
host: 192.168.1.1
username: root
password: redacted
http_id: redacted
ifttt:
key: redacted
notify:
- name: pushbullet
platform: pushbullet
api_key: redacted
zone:
name: Gym
latitude: redacted
longitude: redacted
radius: 50
icon: mdi:dumbbell
zone 2:
name: Mom and Dads
latitude: redacted
longitude: redacted
radius: 50
icon: mdi:home
So if it isnāt coming from the port issue then the only other thing I can think of is that your setup of the actual intent schema or your intent setup in HA is incorrect and the Method not Allowed error is actually coming from the HA API.
I think it is coming from the API. Iām going to check, re-check, and keep on checking to see. What does your config.yaml look like rpitera?
Hereās my Alexa section:
#
#
# Alexa Integration
#
alexa:
intents:
ActivateSceneIntent:
speech:
type: plaintext
text: !include alexa_confirm.yaml
action:
service: scene.turn_on
data_template:
entity_id: scene.{{ Scene | replace(" ", "_") }}
QueryLockIntent:
speech:
type: plaintext
text: >
{% if is_state('lock.front_door', 'locked') %}
the door is locked Robert
{% else %}
the door is unlocked Robert
{% endif %}
The Alexa confirms file is just a selection of random responses:
>
{{ [
"OK Rob",
"Sure thing Robert",
"My Pleasure Rob",
"Done Rob",
"No worries Robert",
"I'll be glad to",
"Leave it to me",
"Consider it done",
"As you wish",
"By your command",
"Affirmative",
"No Problem hon!"
] | random }}
Hereās the intent schema over at Amazon:
{
"intents": [
{
"intent": "ActivateSceneIntent",
"slots":
[
{
"name" : "Scene",
"type" : "Scenes"
}
]
},
{
"intent": "QueryLockIntent"
}
]
}
Iām using slots for the scene names.
Having the same issue here, both on my previous instance and now a fresh installation from the HaSSbian image.
I thought it might have something to do with my nginx reverse proxy config, but it sounds like other people here are seeing the same thing with built in https.
Add me to the list of people seeing this issue. I too have the annoying requirement that internal and external port numbers must match so I canāt redirect 443->8123 as suggested. Hoping for another solution.
Ok I figured this out by looking at the alexa.py code
So the āMethod Not Allowedā error is due to the fact that the alexa API can only handle POST requests and not GET requests. So when you type the URL in your browser that is using the GET request method which is indeed unsupported.
In order to test your Alexa skill, you can use a tool that can send POST requests, for example: https://www.getpostman.com/
Once I got over this hurdle I still hit another hurdle, which was the fact that Amazon does not like to use a non-standard port. So you have to make sure to port forward port HOST:443 to the internal IP:PORT where you have Home Assistant running with SSL enabled.
Which is what I said 26 days ago.
Yes Robert I saw the discussion on ports you guys had. His original issue was purely GET vs POST.
My issue with the ports was a bit different in nature as well. I wanted to be able to use the same URL for accessing my Home Assistant frontend regardless of being internal or external to my home network. With the Netgear (WNDR3800) router I use not supporting loopback, I had to find a ātrickierā way of handling it. Iāll go into the details in case there are others with a similar issue/desire.
So the Amazon skill only seems to work with port 443. So I set up port forwarding of 443->8123. With just that set up, if I was on my home wifi and tried to go to https://my.duckdns.org it would not use that port forward due to Netgear router not supporting loopback. However if I disabled wifi and used LTE it worked just fine. So my solution was to also set up a port forward 8123->443. That way I could always use https://my.duckdns.org:8123 regardless of my location, and Amazon is happy using https://my.duckdns.org.
Another solution I saw was to install dd-wrt on the router to enable the loopback support, but my workaround seemed like less work.
I hope that makes sense
Hi
Anyone can confirm this ?
āAWS requires a āstraightā SSL pathā
My ISP blocks port 443 and I am having the exact same problem as you guysā¦
From HA docs:
Amazon requires the endpoint of a skill to be hosted via SSL.
From Amazon Developers website developers.amazon.com
The service must accept requests on port 443.
From an article on the same site about testing a custom skill:
Error Card Possible Causes
Unexpected Communication Issue Occurs if Alexa cannot connect to your service to send a request. This can happen for many reasons:
The endpoint specified in the configuration on the developer portal is incorrect.
The web service is not online.
**The endpoint is not configured to accept traffic over port 443.**
(Emphasis added by me)
From StackOverflow:
The Alexa service is strict regarding app endpoints. It will only call out using HTTPS on port 443 whether itās calling an app during development or deployed to production.
Links supplied below since no matter how many times I say this Iām still not being believed.
Thanks for the links an information !!!
me as well ā¦ trying to figure out what to so
Using post man in POST https://lastname.duckdns.org/api/alexa?api_password=secret
I receive this:
<html>
<head>
<title>500 Internal Server Error</title>
</head>
<body>
<h1>500 Internal Server Error</h1>Server got itself in trouble
</body>
</html>
Using post man in GET https://lastname.duckdns.org/api/alexa?api_password=secret
I receive this
405: Method Not Allowed
My alexa: in configuration is
alexa:
intents:
ActivateSceneIntent:
action:
service: scene.turn_on
data_template:
entity_id: scene.{{ Scene | replace(" ", "_") }}
speech:
type: plaintext
text: OK
in the log I noticed this.
16-12-23 11:09:10 homeassistant.components.http: Serving /api/alexa to 192.168.1.253 (auth: True)
16-12-23 11:09:10 aiohttp.server: Error handling request
Traceback (most recent call last):
File "/home/hass/.homeassistant/deps/aiohttp/web_server.py", line 61, in handle_request
resp = yield from self._handler(request)
File "/home/hass/.homeassistant/deps/aiohttp/web.py", line 249, in _handle
resp = yield from handler(request)
File "/usr/lib/python3.4/asyncio/coroutines.py", line 143, in coro
res = yield from res
File "/usr/lib/python3.4/asyncio/coroutines.py", line 143, in coro
res = yield from res
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/http/__init__.py", line 427, in handle
result = yield from result
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/alexa.py", line 136, in post
data = yield from request.json()
File "/home/hass/.homeassistant/deps/aiohttp/web_reqrep.py", line 384, in json
return loads(body)
File "/usr/lib/python3.4/json/__init__.py", line 318, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.4/json/decoder.py", line 343, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.4/json/decoder.py", line 361, in raw_decode
raise ValueError(errmsg("Expecting value", s, err.value)) from None
ValueError: Expecting value: line 1 column 1 (char 0)
1