Alexa thermostat integration works but keeps saying something went wrong!

This is a new thread based on various problem reports from @Matt77, @Kanusel and @boke in Official Alexa Smart Home Skill for openHAB 2.

In summary, we’ve all got working Alexa / Thermostat integrations but we keep finding that when we ask Alexa to set the thermostat temperature she will say: “I’m sorry, I don’t know what went wrong” - or similar. The thermostat does actually update, so the action works, but it sounds like the response from openHAB cloud is an error or something so Alexa also thinks it is an error.

In my case this is my configuration:

Group gLoungeThermostat "Lounge Thermostat" [ "Thermostat", "Centigrade" ]
Number thermostat_lounge_temperature "Lounge temperature [%.1f °C]" <temperature> (gPersistChange, gLoungeThermostat) [ "CurrentTemperature" ] {channel="zwave:device:15a8680e20e:node7:sensor_temperature"}
Number thermostat_lounge_setpoint "Lounge setpoint [%.1f °C]" <temperature> (gPersistChange, gLoungeThermostat) [ "TargetTemperature" ] {channel="zwave:device:15a8680e20e:node7:thermostat_setpoint_heating"}
Number thermostat_lounge_battery "Lounge battery [%f]" <temperature> (gPersistChange) {channel="zwave:device:15a8680e20e:node7:battery-level"}
String thermostat_lounge_cooling_mode "Lounge Thermostat Heating/Cooling Mode" (gLoungeThermostat) [ "homekit:HeatingCoolingMode" ]

I’ve not yet tried to look at the source code for the Alexa code - I presume it is a set of AWS lambdas as I believe that is the mandated interface for Alexa skills. I’m happy to have a dig if someone can point me to the right place.

Alternately, if someone has access to the logs and might be able to dig into any thermostat requests and see if there are related errors that would be incredibly useful. Are we able to see errors related to openHAB cloud operations for our own accounts somewhere?


Did you initialize your mode item with a valid state?
If not, Alexa might see a problem with an unknown state.

Interesting. So you have an example for a initialization? Never touched The heatingcoolingmode.

Best regards

Thanks @hmerk - I have not.

Having looked at the Alexa docs I presume the valid states are those found here? Looks like HEAT, COOL, AUTO, ECO and OFF. When I ask Alexa to set the mode of the thermostat she doesn’t know how to do it.

I’m also not clear how to initialise the string item to a value. I might try to do it in a script, but any suggestions would be most welcome if there is a way to do it in the UI quickly (at least to work out if this might be the issue).


You can send commands or state updates to any item trough REST API, simply install REST API docs via PaperUi and you get the needed interface to do so.
Other pissibility is a rule triggerd by system started issueing a „itemName“.postUpdate(„STATE“)

1 Like

@hmerk i set the state via REST API for the MODE item and everything is now 100% working.
Thanks a lot

This is now working properly for me too.

More details for those who come after me:

  • Install the misc-restdocs (found under the misc category as REST Documentation in the Paper UI addons page)
  • At the top level of your OpenHAB webapp you will now find the REST API interface
  • Scroll down to items and expand it
  • Start by expanding the GET /items endpoint
    • click the Try it out button
    • in the Response body, find the mode item from your thermostat
    • Copy the value of the name field
  • Now expand the PUT /items/{itemname}/state endpoint
    • Paste in the name of your item into the itemname field
    • Type in your desired mode (probably HEAT for heating and COOL for A/C)
    • Click on the Try it out button
    • With any luck the response code you get will be 202.

I wonder if the Alexa code could deal with this error condition and give a more meaningful error. Either way I’m glad it is now fixed (until next boot at least). Thanks @hmerk!

If you setup persistence for your items, the state will survive a restart. Other possibility is to create a rule setting the state on every restart.

I couldn’t get rid of the “something went wrong” message with this method – I can set the STATE to any string (even XXXXXXXX) and the response is 202.

Group gMAX "Keller" (gFF) [ "Thermostat" ]
String maxMode "Heizung im Keller Modus" (gMAX)[ "homekit:HeatingCoolingMode" ] {channel="max:thermostat:85bc79bb:KEQ0695917:mode"}
Number maxActual  "Heizung im Keller Ist" (gMAX)[ "CurrentTemperature" ] {channel="max:thermostat:85bc79bb:KEQ0695917:actual_temp"}
Number maxSetTemp "Heizung im Keller" (gMAX)[ "TargetTemperature" ] {channel="max:thermostat:85bc79bb:KEQ0695917:set_temp"}

Any ideas? Thanks! Michael