Official Alexa Smart Home Skill for openHAB 2

Yes, this is supported, you would say “Alexa what is the bathroom temperature”. If the item is part of a thermostat group then “bathroom” should be the name of that group. If the item is not part of a Thermostat (group), then bathroom would be the name of the actual item. I think this is still US only for now, but the code is deployed to both US and EU regions, so when they open it up to non US users, it should just work

Using nightly builds.
Good news: Current temperature works.
Bad news: Alexa tells me it’s 162 degrees.
Obviously Fahrenheit is treated as Celsius and converted.
Question: My bug or yours?

did you tag the item as [“fahrenheit”] ? We assume all items are in C unless tagged with “fahrenheit” . If you tag this at the thermostat group level, it applies to all members, if your temp is not part of a thermo group (standalone), then tag that item. Alexa needs temperatures reported in C which is why this is a little complex.

1 Like

Thanks @digitaldan! I needed to tag the thermostat group as Fahrenheit. For completeness and anyone else “tuning in” my items look like this:

Group LivingRoomThermostat "Downstairs" [ "Thermostat", "Fahrenheit" ] Number zwave_node2_thermostat_temperature "Downstairs Current Temperature" (LivingRoomThermostat) ["CurrentTemperature"] Number zwave_node2_thermostat_target_temperature "Downstairs Target Temperature" (LivingRoomThermostat) [ "TargetTemperature" ] String zwave_node2_thermostat_modesetting "Downstairs Heating/Cooling Mode" (LivingRoomThermostat) [ "homekit:HeatingCoolingMode" ]

2 Likes

I just pushed out an update to support querying the target temperature and mode of a thermostat, so you would say “Alexa, what is the thermostat set to?” and it will respond something like “AC mode is set to 71”. Modes are a bit tricky right now, we don’t have a way of mapping them in OH yet so your item’s modes need to be one of these 0 or OFF, 1 or HEAT, 2 or COOL, 3 or AUTO or heat-cool . (the heat-cool is a nest thing). Again I think this is still US only, but is deployed to both the US and EU regions, so will be available if they expand language support.

Does anyone know the range of values that the temperature can return? Seems like I can use it for other status and information besides temperature as long as I am willing to label the item with temperature and put up with Alexa saying the value is a temperature. That’s not ideal, but it is still useful. Garage door temperature could be 0 or 1 for closed/open, etc. I’m sure 0 and 1 are valid temperatures, but how far can the range go? Is she willing to say that my “house power” temperature is 1800 degrees? Thanks.

Hi @hmerk and @skatun,

Thank you both for your replies.
For some simple items, I just changed the Dutch label in my item-definition to an English one. In my sitemap I have again defined my Dutch label. This is a pragmatical approach.

For some more complex items, I have followed Skatun’s approach, with a virtual item and a rule.

I have another question. The temperature in my livingroom is defined as follows:

Group:Number:AVG gGV_Living_Temp					"Livingroom Temperature [%.1f °C]" 					<temperature>		(gGV_Living)			[ "CurrentTemperature" ]

This group is calculating an average of multiple temperature sensors in the living room.

If I query Alexa by saying “What is the livingroom temperature?” (assuming that is the correct query), Alexa respons with “Sorry, I’ve found several devices with that name, which one do you want?”.

Currently, I only have one “currenttemperature” item.

Maybe Alexa/Openhab is struggling with the fact it is a group? Or am I doing something else wrong?

Alexa can be very sensitive about names, this is before the command ever gets to our app. Try dropping the “temperature” from your label ? I think that may be confusing Alexa

Hi digitaldan,

Thanks. Removing “temperature” from the name, and just call it “livingroom” has done something right.

If I now ask “What is the temperature in the livingroom?” Alexa answers with “Hm, livingroom is not responding”.

The value of that item was 21.8°C at that time.

I am having issues getting Alexa to discover openhab devices, I used to have this working just fine and after renaming some items it broke and won’t discover openhab items. I have resorted to creating a alexa.items file with the following:
Switch AlexaDiningroomLight “Diningroom Light” [“Lighting”] { channel=“zwave:device:aeotec:node7:switch_dimmer” }
Dimmer AlexaKitchenLight “Kitchen Light” [“Lighting”] { channel=“zwave:device:aeotec:node8:switch_dimmer” }
i am able to access the rest api via myopenhab.org:
https://myopenhab.org/rest/items/AlexaFrontDoorLight/
returns the following:
{
“link”: “https://myopenhab.org/rest/items/AlexaFrontDoorLight”,
“state”: “0”,
“type”: “Dimmer”,
“name”: “AlexaFrontDoorLight”,
“label”: “Front Door Light”,
“tags”: [
“Lighting”
],
“groupNames”: []
}

still no luck, i have deleted myopenhab.org account and recreated it to no avail, restarted openhab2, switched my pi3 from wifi to ethernet connection, removed and re-enabled OpenHAB skill, de-authorized alexa app on myopenhab.org and re-enabled OpenHAB skill all to no avail. I can discover nothing from openhab anymore. Anyone have any idea what i can try? I want to see if alexa is actually calling the openhab rest on my pi but not sure where/how i can find the http logs (perhaps i need to goto karaf and turn on DEBUG for some unknown module???) I am compleatly frustrated with this and hopefully i just misspelled something! I can only think of 1 last thing which i havn’t tried and thats to disconnect 2 of my 3 echos and retry?
Any Suggestion would be very appericated

Is device discovery enabled for hue emulation service?
Just an idea.

Does “https://myopenhab.org/rest/items/” return quickly for you? How many tagged items do you have? Can you give me an exact time you ran discovery (so I can look at the logs), what region (US, UK, DE) are you in? I’ll see if I can find something on the AWS side if I can.

Hmm, that means there was an error, can you do this again and tell me the exact time you ran it so I can look at the logs?

@digitaldan: I just did it again.

Question: What is the temperature in the livingroom?
Answer: Hm, livingroom is not responding.
Timestamp: 18:59:15 CET (just now).

Thanks for checking!
Dries

Can you try again? I just turned up logging, also what region (US,EU, etc…) are you in?

Nm, I see you are in the EU :slight_smile:

@digitaldan: I just did it again.

Question: What is the temperature in the livingroom?
Answer: Hm, livingroom is not responding.
Timestamp: 19:30:45 CET (just now).
Thanks for checking!
Dries

I see, you have tagged a group item as the CurrentTemperature, when we see a group we assume its members are tagged, but do not treat the group as something to report on, this is to support the homekit style grouping of thermostat items. So it needs to be an item, not a group item. I wish there was a better way to do it.

Hi Dan,

Thanks. I have created a new (virtual item) and a rule that copies the value from the group to the new item.

Question: "What is the temperature in the livingroom?"
Answer: “Inside, it’s 22”.
(actual value: 22.8°C)

It works. :slight_smile:

Additional question: can I expect Alexa to be more accurate? I would like to know it’s 22.8°C, not just “22°C”.

Hi Dan,
thanks for getting back. I just ran device discovery time was 12:43.30pm CST. I have 12 items w/ [“Lighting”] tag and zwave binding in my lights.items, I have duplicated 4 of these items in alexa.items for testing/debug purpose. I have renamed the alexa.items items (required for duplicates), changed description, removed the group and icon to keep it as basic as possible. If i ever get this working again I would like to remove the [“Lighting”] tags from all 12 zwave items in my main lights.items file and duplicate all 12 in the alexa.items as I think it will make it easier to manage the description for alexa.Let me know if i can do anything to help, I am happy to edit, change, test for you to help w/ debugging.
FYI I forgot to mention I did my initial alexa device discovery (when it found all 12 taged items) when i had my pi connected to ethernet cable. I later switched my pi to use WiFi after changed some item names/description and did a re-discovery (which didnt find anything, although original items did work). I then removed a couple of zwave devices from alexa did a re-discovery and it never re-found them. after reading thru the coumminuity post i decided to disable WiFi on the Pi and connect back to Ethernet and also forget all devices and groups on alexa and do a re-discovery and still nothing.
, David