Skip to content

Latest commit

 

History

History
75 lines (62 loc) · 3.53 KB

Controlling-openHAB-with-Android.md

File metadata and controls

75 lines (62 loc) · 3.53 KB

There are a few different way to controll openHAB with your android smartphone.

Manual

Web interface

The simplest way is to use the browser and open the openHAB [[web interface|Web-AppUI]].

HABdroid

Use the official android app HABdroid.

NFC

HABdroid supports NFC

HABsweetie

HABSweetie is an alternative android app.

3Hou.se

3Hou.se Alternative android app with widgets. in active beta now.

Automation

Tasker

Since you are already playing with home automation, you might as well try to automate some thing with your phone.
One of the best ways to automate anything on your android is using the app Tasker.

It is a little tricky at the beginning. But once you understand how Tasker works, there are endless posibilities.
A good place to start is the YouTube-Channel Tasker 101 Tutorials

Send a command to openHAB via HTTP Get

To send a command (set a value to an item) you can use the build-in action "HTTP Get".

  • create a new task
  • add the "HTTP Get" action
  • fill in the fisrt three fields
    • Since you might want to use more than one actions it is adviseable to use global variables (start with capital letter) for "Server:Port"
    • Like: %OHSERVER:%OHPORT
  • put "CMD" into the Path-field
  • write the itemname and the value into the Attributes-field
    • Like: MeAtHome=ON
  • exit this action and exit the task
  • in the VARS tab (right top corner) you can see and define the global variables
    • fill in the IP and the port Now you can run the task and see if it works.

Read a item value from openHAB via RESTask

In order to read a value of an item via the [[REST-API|REST-API]] you can use the tasker plugin RESTask.

  • Read the description in the Play Store
  • add the RESTask action to your task
  • Configure
    • Request Type: GET
    • Host: http://%OHSERVER:%OHPORT/rest/items/Temp_Bedroom/state
      • see above about global variables
    • save
  • add an Wait action "until %RTCODE is set"
  • add an action (e.g Flash) to output the %RTRES-variable

Set and Get values from openHAB via HABSweetie plugin

HABSweetie provides a tasker plugin.

Examples

Mute radio during a call

One use case could be to mute your radio (or pause a movie) when you receive a call.

  • openHAB
    • create a switch item in openHAB called "CallInProgress"
    • define a rule to mute your radio when the state of "CallInProgress" changes from OFF to ON
    • define a rule to unmute your radio when the state of "CallInProgress" changes from ON to OFF
  • Tasker
    • create a tasker profile
      • use the "Call" state to trigger the task when a call starts
    • add a begin task and use the HTTP Get action to set "CallInProgress" to "ON"
    • add an end task and use the HTTP Get action to set "CallInProgress" to "OFF"

more ideas

  • tell openHAB you are at home when the smartphone connects to your home wifi
  • use the Tasker plugin AutoVoice to control anything with your vioce
  • start the radio in the morning when the alarm (of your smartphone) goes off