Alexa with openhab


(Geetika Varshney) #1

how to setup communication between the alexa skill and openhab2 without IFTTT or any other app


(bob_dickenson) #2

Hue EMULATION in the Addins MISC category NOT the Hue from Bindings.


(Geetika Varshney) #3

is it possible to communicate alexa smart home skill to openhab without alexa app


(Tom) #4

You need the Alexa app/webpage to ‘discover’ the items that you have tagged in openHAB. Once you have done this then you don’t need the app again.


(SiHui) #5

You even can do that without the app: tell Alexa to “Search for devices”


(Geetika Varshney) #6

thank you for suggesting me…the things are working for me…finally alexa can communicate with openhab…its so easy…thanks.


(Geetika Varshney) #7

if I say “alexa turn on office lights” then she respond it correctly
but when I say “alexa, decrease bedroom temperature by 5 degrees” then she is saying bed room is not responding…

Code in items file –
Number BedroomTemperature “Bedroom Temperature” (gBedroom) [ “CurrentTemperature” ]

Code in sitemap file–
Text item=BedroomTemperature

where I am wrong.


(SiHui) #8

Make sure you have all four items including the group correctly set.
Temperature is not supported in all languages as far as I know …

Thermostat control is currently limited until we have a more complete ontology for tagging. There are a few caveats to keep in mind. First is that we assume temperatures are in Celsius unless the thermostat tagged group also contains the tag “Fahrenheit” (shown above). This is a temporary configuration and will hopefully change in the future. Second is that the Alexa skill expects the thermostat mode item (“homekit:HeatingCoolingMode”) to conform exactly to the strings “OFF, HEAT, COOL, AUTO, heat-cool” or “0,1,2,3”. Again this is a temporary restriction until a more complete solution is developed.


(Geetika Varshney) #9

I have defined all those 4 items now my updated item file is
Group gDownstairsThermostat “Downstairs Thermostat” (gFF) [“Thermostat”,“Fahrenheit”]
Number DownstairsThermostatCurrentTemp “Downstairs Thermostat Current Temperature” (gDownstairsThermostat) [ “CurrentTemperature” ]
Number DownstairsThermostatTargetTemperature “Downstairs Thermostat Target Temperature” (gDownstairsThermostat) [ “TargetTemperature” ]
String DownstairsThermostatHeatingCoolingMode “Downstairs Thermostat Heating/Cooling Mode” (gDownstairsThermostat) [ “homekit:HeatingCoolingMode” ]

when I say “alexa set thermostat by 2 degrees” (as mentioned in official alexa smart home post) then she respond “this command is not supported for this device”…

thanks in advance…


(SiHui) #10

If you set your label to "Downstairs Thermostat” you need to tell Alexa to change the "Downstairs Thermostat” temperature, not the


(Geetika Varshney) #11

thanks this is working…


(Søren Kodal) #12

You need to create a “myopenhab.org” account. In OPH2 you need to define which items you will let myopenhab.org “see” Then you have to use the Openhab2 skill on Alexa. This skill make a connection to your myopenhab.org account. Now you can say “turn on my living room light” and it will turn on, if you have named the concerned item the same name in your item file.


(Hans-Jörg Merk) #13

No, you don’t have to expose your items to myopenhab, just do the correct tagging.


(bob_dickenson) #14

@hmerk is correct.


(Geetika Varshney) #15

i define the tag in things.xml like this…

String Temperature CurrentTemperature

and when i talk to Alexa then she responds with the correct value of temperature…

but when i define two items with the same tag like this–

String Temperature CurrentTemperature String Pressure CurrentTemperature

when i ask alexa that “what is temperature set to” she responds “there is more than one thermostat device with the same tag”.

and she not responds with any value neither for temperature nor for pressure.

so my question is how can she determine the same tag (CurrentTemperature) but for different smart home devices(Temperature, Pressure).


(SiHui) #16

Define a different label (= Alexa tag) for each device, for example “Thermostat Floor”, “Thermostat Kitchen”, …


(Geetika Varshney) #18

Hello Sir,
i did it in the same way as you mentioned above but sir the problem is not solved…
this is my things-type.xml file from openhab binding…

   <channel-type id="sample-pressure">
    <item-type>String</item-type>
    <label>Thermostat Pressure</label>
    <description>The Pressure of ST Board</description>
     
       <tags>
    <tag>CurrentTemperature</tag>
    </tags>
   
    <state readOnly="true" pattern="%s">
    </state>
</channel-type>
<channel-type id="sample-temperature">
    <item-type>String</item-type>
    <label>Thermostat Temperature</label>
    <description>The Temperature of ST Board</description>
     
       <tags>
    <tag>CurrentTemperature</tag>
    </tags>
   
    <state readOnly="true" pattern="%s">
    </state>
   
</channel-type>

i have 2 channels with the same tag(“CurrentTemperature”), when alexa searches for SMARTHOME DEVICE she finds 2 Smart Home devices.

when i ask “ALEXA WHAT IS TEMPERATURE IS SET TO?” SHE RESPONDS “I FOUND MORE THAN ONE THERMOSTAT DEVICE, WHICH DEVICE YOU WANT”

then i said “Thermostat pressure” then she respond “SORRY I DONT KNOW THIS”

so basically my problem is "how can she determine 3 channels i.e. “Temperature and Pressure” with the same tag “Current Temperature”


(SiHui) #19

If it does not work with different labels I have no idea, sorry.