Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thermostat setting transactions are executed but error out at the end: "The thermostat is not responding" #39

Closed
arigit opened this issue Jul 19, 2018 · 14 comments
Labels
HA-Code Issues that involve the Home Assistant code, that we do not control

Comments

@arigit
Copy link

arigit commented Jul 19, 2018

I implemented this skill - Discovery and switches work fine - but I did run in to a little issue with the thermostat (ecobee).

Via the alexa app I can see and set the temperature, no issues. I can also query the temperature setting and that also works.

But when I ask alexa to set the temperature to any value via voice (Alexa set the thermostat to 24 degrees), I immediately get “I am not quite sure what went wrong”, or sometimes “the thermostat is not responding”.

However, the strange thing is that the setting in the thermostat does get changed immediately in every case, so the command actually works perfectly. But for some reason alexa thinks the transactions are not completing.

This only happens with Thermostat. My other devices are OK. The older Hasska (v2 payload) never showed this kind of problem.

I see no errors or warnings in the HA log at all, and the thermostat is actually set to the requested value. I tried removing and re-adding the skill, re-linking it, etc, no change, there is always the message at the end ('something went wrong', or 'thermostat not responding')

I noticed that the behavior of the haaska v3 "glue" is now to acknowledge the transaction immediately without waiting for HA to respond, (commit in June 24). Could this be causing the problem? either the response is too fast or in the case of thermostats it is missing some information that HA is sending.

I tried to obtain a lambda function trace to look at the signalling back and forth but couldn't figure that out.

If you can point me to a working haaska v3 release prior to the behavior change, that waits and forwards HA's response back to the skill, maybe the error will go away, I can try it and report back results.

Also I can provide any other info you may need.

@anthonylavado
Copy link
Contributor

@arigit Hey Ari,

While I haven't tested this with a thermostat myself, I do know that the Alexa Voice Service does require a response back in a certain time frame in order to acknowledge the status of the request. It is possible that this is why you are getting the errors about the thermostat not responding.

We haven't really changed the code lately to my knowledge - even the last commit on June 21st was solely to provide a fix when building on non-root on Debian systems. The code itself for the relay has not been modified since February 5th or so. Could you point me to the commit you're looking at?

Regarding what could be happening, there should be logging in Debug as per this line:

logger.debug('request for %s sent without waiting for response',

You'll have to forgive me for details on how to access it, I'm more of a "documentation" maintainer here.

Perhaps @mike-grant can comment?

@anthonylavado
Copy link
Contributor

Aha! I see now. If you set your config to Debug, you can get some more details from the function:

"debug": false,

@arigit
Copy link
Author

arigit commented Jul 19, 2018

Thanks! will test this. Where do I collect the debug logs? a debug file is created as part of the lambda files? (sorry I'm a newbie with lambdas)

@anthonylavado
Copy link
Contributor

@arigit I'm a newbie too unfortunately - I believe you should get data somewhere in AWS, I just don't remember where.

I also now see the commit you're pointing to. It was June 24th of 2017, technically for the v2 version of Haaska (we should probably clean out that changelog). The code now is completely different from what existed then.

@anthonylavado
Copy link
Contributor

@arigit I believe this should get you some info:

  • Sign in to the Lambda console
  • Click on the haaska function
  • Change from the Configuration tab to the Monitoring tab
  • Click "View logs in CloudWatch" at the top right

@arigit
Copy link
Author

arigit commented Jul 19, 2018

Thanks! here's an extract of a sample transaction. I don't see any error.
Also the thermostat gets set to the requested temperature, HA's logs are empty, no issue there.

It's like the skill is expecting something different from what is being sent to it.

[DEBUG] 2018-07-19T21:46:52.64Z 3f28ba61-8b9d-11e8-ace2-b1572c30f59a calling alexa/smart_home with {'directive': {'header': {'namespace': 'Alexa', 'name': 'ReportState', 'payloadVersion': '3', 'messageId': 'a8b1a57f-4321-4289-a59c-9295c7c724f6', 'correlationToken':

[DEBUG] 2018-07-19T21:46:52.65Z 3f28ba61-8b9d-11e8-ace2-b1572c30f59a Starting new HTTPS connection (1): blah.blah:443

2018-07-19T21:46:52.260Z 3f28ba61-8b9d-11e8-ace2-b1572c30f59a https://blah.blah:443 "POST /api/alexa/smart_home HTTP/1.1" 200 1928

END RequestId: 3f28ba61-8b9d-11e8-ace2-b1572c30f59a

[DEBUG] 2018-07-19T21:52:40.636Z 0ee78ee2-8b9e-11e8-accd-4fc1cddd38fa calling alexa/smart_home with {'directive': {'header': {'namespace': 'Alexa', 'name': 'ReportState', 'payloadVersion': '3', 'messageId': '030e7921-a2e1-456f-a00f-780a2ecac05c', 'correlationToken':

[DEBUG] 2018-07-19T21:52:40.637Z 0ee78ee2-8b9e-11e8-accd-4fc1cddd38fa Starting new HTTPS connection (1): blah.blah:443

[DEBUG] 2018-07-19T21:52:40.978Z 0ee78ee2-8b9e-11e8-accd-4fc1cddd38fa https://blah.blah:443 "POST /api/alexa/smart_home HTTP/1.1" 200 1928

[DEBUG] 2018-07-19T21:53:06.677Z 1e715f0e-8b9e-11e8-bba9-6b1efd2a8cdc calling alexa/smart_home with {'directive': {'header': {'namespace': 'Alexa.ThermostatController', 'name': 'SetTargetTemperature', 'payloadVersion': '3', 'messageId': '8512432c-6f39-45db-b0b3-ff83695bd8bd', 'correlationToken':
...
'endpointId': 'climate#thermostat', 'cookie': {}}, 'payload': {'targetSetpoint': {'value': 25.0, 'scale': 'CELSIUS'}}}}

[DEBUG] 2018-07-19T21:53:06.684Z 1e715f0e-8b9e-11e8-bba9-6b1efd2a8cdc Starting new HTTPS connection (1): blah.blah:443

[DEBUG] 2018-07-19T21:53:07.10Z 1e715f0e-8b9e-11e8-bba9-6b1efd2a8cdc https://blah.blah:443 "POST /api/alexa/smart_home HTTP/1.1" 200 1580

@arigit
Copy link
Author

arigit commented Jul 19, 2018

I'm activating debug logs in the skill to see if anything strange there

@arigit
Copy link
Author

arigit commented Jul 19, 2018

Debug logs from HA

2018-07-19 18:17:10 DEBUG (MainThread) [homeassistant.components.alexa.smart_home] Received Alexa Smart Home request: {'directive': {'header': {'payloadVersion': '3', 'name': 'SetTargetTemperature', 'correlationToken': 'AAAAAAAAAAAGp......==', 'namespace': 'Alexa.ThermostatController', 'messageId': '7ece5a60-3f0f-4e24-99c7-0fcad8e8c955'}, 'payload': {'targetSetpoint': {'value': 25.0, 'scale': 'CELSIUS'}}, 'endpoint': {'scope': {'type': 'BearerToken', 'token': 'Atza|IwEBIP.....-LwVwz'}, 'endpointId': 'climate#thermostat', 'cookie': {}}}}

2018-07-19 18:17:10 DEBUG (MainThread) [homeassistant.components.alexa.smart_home] Sending Alexa Smart Home response: {'event': {'header': {'payloadVersion': '3', 'name': 'Response', 'correlationToken': 'AAAAAAAAAAAGpY/eKqGi....4cZWgg==', 'namespace': 'Alexa', 'messageId': '6394bf62-1a85-4fb9-b400-35aa4098f0ba'}, 'payload': {}, 'endpoint': {'scope': {'type': 'BearerToken', 'token': 'Atza|IwEBIP...sxq-LwVwz'}, 'endpointId': 'climate#thermostat', 'cookie': {}}}}

2018-07-19 18:17:10 INFO (Thread-2) [homeassistant.components.ecobee] Ecobee data updated successfully

HA looks all good. it receives the command, and it changes de thermostat, and sends a response

Now on the Lambda logs, I don't see any response going back to the Skill at all
These are the cloudwatch events for the same test:

CLOUDWATCH LOGS

(the request arrives from the Echo)

[DEBUG] 2018-07-19T22:17:09.956Z 7aaca408-8ba1-11e8-94eb-2f2df855d16e calling alexa/smart_home with {'directive': {'header': {'namespace': 'Alexa.ThermostatController', 'name': 'SetTargetTemperature', 'payloadVersion': '3', 'messageId': '7ece5a60-3f0f-4e24-99c7-0fcad8e8c955', 'correlationToken': 'AAAAAAAAAAAGpY/eKq...M1SdNgYfSvkfQ9dA4cZWgg=='}, 'endpoint': {'scope': {'type': 'BearerToken', 'token': 'Atza|IwEBIPpyjEpL1o...GCsxq-LwVwz'}, 'endpointId': 'climate#thermostat', 'cookie': {}}, 'payload': {'targetSetpoint': {'value': 25.0, 'scale': 'CELSIUS'}}}}

(coonects and posts to my HA)

[DEBUG] 2018-07-19T22:17:09.957Z 7aaca408-8ba1-11e8-94eb-2f2df855d16e Starting new HTTPS connection (1): blah.blah:443

[DEBUG] 2018-07-19T22:17:10.269Z 7aaca408-8ba1-11e8-94eb-2f2df855d16e https://blah:blah:443 "POST /api/alexa/smart_home HTTP/1.1" 200 1580

END RequestId: 7aaca408-8ba1-11e8-94eb-2f2df855d16e

REPORT RequestId: 7aaca408-8ba1-11e8-94eb-2f2df855d16e Duration: 335.12 ms Billed Duration: 400 ms Memory Size: 128 MB Max Memory Used: 31 MB

And there is nothing else! no response sent back to amazon.

@anthonylavado
Copy link
Contributor

@arigit Thanks for the logs. I figured it out!

The Smart Home API in HA is not returning values in all scenarios for the thermostat/climate components. This was recently fixed and merged, but it won’t be available until a future release.

See the commit here: home-assistant/core#15352

Keep any eye on the blog to see when it gets included. Since the release notes always reference the commit number, you can search that when a new post goes up.

Blog (Release Notes): https://www.home-assistant.io/blog/categories/release-notes/

@arigit
Copy link
Author

arigit commented Jul 20, 2018

@anthonylavado Thanks for following up! I will give this another shot when they release HA 0.74, I see it's in beta. For now it's usable, the control part works, and it's a net-benefit over the older haaska with v2 payloads.

@arigit
Copy link
Author

arigit commented Jul 20, 2018

well they released 0.74 today :) - just updated, tested, bummer: issue still there :(. Thermostat changes still succeeded from HA's point of view but always ending on an Alexa error condition "I'm not sure what went wrong". Nothing in HA logs, even in debug mode, same as above.

Next test I can think of is to try HA's own cloud integration instead of Haaska and compare results. That will help isolate whether this is a haaska issue or HA issue - will try that late today

@anthonylavado
Copy link
Contributor

@arigit Thank you for testing. Let us know.

I’d be curious to see if it happens with my Nest. Up to this point I’ve been using the official skill for it.

What make/model thermostat do you have?

@arigit
Copy link
Author

arigit commented Jul 20, 2018

This is with an ecobee v3. It never had issues with the old haaska. In the many tests I tried, I created new api keys etc but no change.

@arigit
Copy link
Author

arigit commented Jul 20, 2018

I could reproduce the same problem with HA's own Cloud integration

home-assistant/core#15580

@anthonylavado anthonylavado added the HA-Code Issues that involve the Home Assistant code, that we do not control label Jul 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HA-Code Issues that involve the Home Assistant code, that we do not control
Projects
None yet
Development

No branches or pull requests

2 participants