[Documentation] [TitleIndex] [WordIndex

Only released in EOL distros:  

Package Summary

The iot_bridge provides a bi-directional bridge between ROS and the OpenHAB Home Automation system. This allows a ROS robot to connect to a vast variety of IoT devices such as motion detectors, Z-Wave devices, lighting, door locks, etc.

Package Summary

The iot_bridge provides a bi-directional bridge between ROS and the OpenHAB Home Automation system. This allows a ROS robot to connect to a vast variety of IoT devices such as motion detectors, Z-Wave devices, lighting, door locks, etc.

Package Summary

The iot_bridge provides a bi-directional bridge between ROS and the OpenHAB Home Automation system. This allows a ROS robot to connect to a vast variety of IoT devices such as motion detectors, Z-Wave devices, lighting, door locks, etc.

Package Summary

The iot_bridge provides a bi-directional bridge between ROS and the OpenHAB Home Automation system. This allows a ROS robot to connect to a vast variety of IoT devices such as motion detectors, Z-Wave devices, lighting, door locks, etc.

Overview

The IoT Bridge provides a bridge between ROS and the OpenHAB Home-Automation system.

Connect your robot to the wider world

With the iot_bridge, any OpenHAB device can be easily setup to publish updates to the iot_updates topic in ROS, giving a ROS robot knowledge of any Home Automation device. ROS can publish to the iot_set topic (or iot_command) and the device in OpenHAB will be set to the new value (or act on the specified command).

Installing

  1. Install OpenHAB from openhab.org

  2. Install iot bridge on the ROS system:

    • Go to iot bridge and find the GIT clone address

    • On your ROS system:
              cd catkin_ws/src
              git clone address-from-above
              cd ..
              catkin_make
  3. Edit iot_bridge/config/items.yaml:
    • Update host address and port to match your OpenHAB server
  4. Edit Openhab's item file
    • Create the ROS group: Group ROS (All)
    • Add the (ROS) group to each item that should send status updates to ROS.

Note that the items must be directly in a (ROS) group, not in a sub-group of the (ROS) group. Note, this is only needed for status updates to go from OpenHAB to ROS - you can send commands from ROS to any OpenHAB item regardless of what group it is in.

Sample Open_HAB item definition:

NOTE: you must have two or more items defined in the ROS group.

Group ROS (All)
String ROS_Status "ROS [%s]"
Switch Light_GF_Corridor_Ceiling  "Ceiling"  (GF_Corridor, Lights, ROS)
Switch Light_GF_Bathroom (GF_Bathroom, Lights, ROS)

Launch

  1. Launch
    • roslaunch iot_bridge iot.launch

  2. Test:
    • Test receiving from OpenHAB
      • In your browser, go to http://localhost:8080/rest/items/ROS

      • You should see an XML response with the state of the items you have put in the ROS group
      • In the console, type
               rostopic echo /iot_updates
      • Bring up the OpenHAB demo site in your browser and change an item in the ROS group
      • You should see the new state in the rostopic echo console
    • Test sending to OpenHAB
          cd catkin_ws/src/iot_bridge/scripts
          ./iot_test  item_name item_value
      • You should see the message logged where you did the roslaunch.
      • If you have the OpenHAB demo site in your browser, you should see the item you named changed to your specified value.
      • The value must be valid for that device (number, or ON/OFF, or OPEN/CLOSED). See openhab/items for a summary of valid values.

  3. Statistics
    • You can place the ROS_Status item in your OpenHAB sitemap. It will display the
    • time of the last update (to nearest minute) and counts of messages and errors.
    • Place the following in demo.sitemap:
      •            Text item=ROS_Status label="ROS [%s]"

Interfaces

Send a Command to an OpenHAB item

When iot_bridge receives a name/value pair from the ROS iot_command topic, it publishes those to OpenHAB and OpenHAB sends that command to the device specified. The value must be valid for that device. See openhab/items for a summary of valid values.

For Example:

A ROS program wants to turn on a ceiling light. It publishes the following to the iot_command topic:

This will turn on the Ground Floor Corridor ceiling light. See sample code in iot_test.

Set Status for an OpenHAB Item

When the iot_bridge receives a name/value pair from the ROS iot_set topic, it publishes those to OpenHAB and OpenHAB updates the status for the item specified (e.g. indicate that a switch is now ON).

For Example:

A ROS program running Facial Detection detects that Sarah is present. It publishes the following to the iot_set topic:

This will set the facedetection item in OpenHAB to Sarah, indicating Sarah has been detected. See sample code in iot_test.

Receive item updates from OpenHAB

The IoT bridge receives updates from OpenHAB and publishes those as name/value pairs to the iot_updates ROS topic.

To see updates from the command line, type:

rostopic echo iot_updates

For example: A motion detector is triggered in OpenHAB. The openhab bridge will publish the following to the iot_updates topic in ROS

Request Refresh of all Item states

ROS topic subscribed by iot_bridge:

For Example:

A ROS program publishes the following to the iot_command topic:

openhab will send the current status of every item in the (ROS) group to the iot_updates topic. Subsequent status will continue to send only when they change.

Bug Reports & Feature Requests

Use GitHub to report bugs or submit feature requests.

We appreciate the time and effort spent submitting bug reports.


2022-05-28 12:39