Here are the steps to get your HestiaPi connected to Alexa (USA HVAC version). Well almost, I still have to get the Mode functionality done.
Refer to this video Complete Guide Setup openHAB Cloud Connector and myopenhab.org (Setup Remote Access)
- The openHAB Cloud connector should already be installed if you used an official image
- On your local openHAB web UI, go to hestiapi.local:8080/paperui/index.html (Configuration, Services,IO tab)
- Click CONFIGURE
- In the Mode dropdown, select Notifications & Remote Access
- For ** Base URL for the openHAB Cloud server** enter https://myopenhab.org/
- Click SAVE
- You’ll need you UID & Secret values to link your HestiaPi. These should already exist (if you used the hestia-pi-touch-* image) at /var/lib/openhab2/uuid and /var/lib/openhab2/openhabcloud/secret
- Go to myopenhab.org
- Enter your email address & the values for UUID and Secret obtained above and click Register
- If everything worked you should see a green Online box a the top of the screen, if not reboot you HestiaPi
- You should be able to remotely access your UI from the myopenhab website!
To enable the Alexa functionality:
- Edit your /etc/openhab2/items/default.items file:
Insert these lines:
Group Thermostat "Thermostat" {alexa="Endpoint.Thermostat"}
Number Mode "Mode [%s]" (Thermostat) {alexa="ThermostatController.thermostatMode" [OFF=0,HEAT=1,COOL=2,AUTO=3]}
Change these lines:
Number MyTempProxy "Temperature [%.0f °F]" <temperature> (Thermostat) { mqtt=">[mosquitto:hestia/local/temperature:state:*:default]", alexa="TemperatureSensor.temperature" [scale="Fahrenheit"] }
Number TempMaxSetpoint "Temperature Max Setpoint[%.0f °F]" (Thermostat) { mqtt=">[mosquitto:hestia/local/tempmaxsetpoint:state:*:default],<[mosquitto:hestia/local/settempmaxsetpoint:state:default]", alexa="ThermostatController.upperSetpoint" [scale="Fahrenheit"] }
Number TempMinSetpoint "Temperature Min Setpoint[%.0f °F]" (Thermostat) { mqtt=">[mosquitto:hestia/local/tempminsetpoint:state:*:default],<[mosquitto:hestia/local/settempminsetpoint:state:default]", alexa="ThermostatController.lowerSetpoint" [scale="Fahrenheit"]}
Edit your /etc/openhab2/rules/default.rules file:
rule "set Cooling Mode"
when
Item MyTempProxy received update
then
Mode.postUpdate("3")
end
NOTE: This is a dummy function to keep Alexa happy, doesn’t change the mode yet.
- Next install/open to the Alexa app on your smartphone.
- Add the openHAB skill if you haven’t yet. Select menu top left, select Skills & Games and search for openHAB. If I remember correctly, it may ask for permission to access the openHAB app here.
- To add your HestiaPi to Alexa, select the Devices icon on the bottom right, then the + icon top right. Add Device, Thermostat, * Other then DISCOVER DEVICES. The app should find your HestiaPi after several seconds.
- When the app finds your HestiaPi, select SET UP YOUR DEVICE, add it to a group or select SKIP, finally select DONE
- You should see a Thermostats icon on your DEVICES page
- When you select it you should see the current Max & Min setpoints in addition to the current temperature.
You should now be able to say thing like:
Alexa, set Thermostat to 78 degrees
Alexa, decrease Thermostat by 2 degrees
Alexa, increase Thermostat by 1 degrees
Alexa, decrease Thermostat
Alexa, what is Thermostat set to?
Alexa, what is Thermostat temperature?
I still have to test these commands though, as I think the openHAB rules only support incremental temperature changes. You definitely can adjust the temperatures on the Thermostat page in Alexa.
I’m busy working on being able to set the Mode via openHAB, which will allow you to turn on the A/C or heating via Alexa.
Let me know if you figure out any improvements!