Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

DD WRT Binding

wdesponts edited this page Feb 1, 2017 · 13 revisions

Note: This Binding is available in 1.9.0 and later releases.

Documentation of the DD-WRT binding bundle

Introduction

The DD-WRT Binding can be used for both openHAB1 and openHAB2 instllations thanks to the Compatibility Layer. The steps needed to install and configure this buinding are diffrent, so please pay attention and follow the instructions that apply to your version of openHAB.

Step 1 - Prepare Router

  • Activate the telnet interface via the dd-wrt web interface (Services -> Services --- Telnet Section -> Enable).
  • Make note of the port number (Services -> Services --- Secure Shell Section -> Port).
  • Connect to the router's command line using Telnet (using your favorite telnet client).
  • Get a list of active interfaces using the ifconfig command.
  • Make note of the different interface names. (ath0, br0, eth2, wl0.1 etc).

Step 2 - Install the dd-wrt binding JAR files

Step 3 - Create your ddwrt.cfg file

  • For openHAB1 isntallations, copy/paste the following text into your openhab.cfg file and save the changes.
  • For openHAB2 installation, open your preferred text editor and copy/paste the following test into it.

############################### DD-WRT Binding ####################################
#
#
# IP address of DD-WRT to connect to. Replace XXX.XXX.XXX.XXX with your routers Local IP address.
# Please note that the router and openHAB server should be on the same network.
#
ddwrt:ip=XXX.XXX.XXX.XXX
#
# Port Number for the Telnet connection. Replace YYYYY with the port number. #
ddwrt:port=YYYYY
#
# Connection information for to access the routers command line.
# Only needed if Password Login is activated on the router.
# Replace USERNAME and USERPASSWORD fileds below with your connecton details.
#
ddwrt:username=USERNAME
ddwrt:password=USERPASSWORD
#
# Interface 1. Normally assigned to the 2.4 GHz wifi physical interface (ath0 or wl0).
# Replace INTERFACE1 with the name of the interface you want to trigger.
#
ddwrt:interface_24=INTERFACE1
#
# Interface 2. Normally for the 5 GHz wifi physical interface (ath1 or wl1)
# Replace INTERFACE2 with the name of the interface you want to trigger.
#
ddwrt:interface_50=INTERFACE2
#
# Interface 3. Normally used for Virtual-Interface such as guest wifi (ath1.1 or wl0.1).
# This interface switch triggers additional reset commands on the router.
# Replace INTERFACE3 with the name of the interface you want to trigger.
#
ddwrt:interface_guest=INTERFACE3
#
#
#####################################################################################

  • For openHAB2 installation save the file as ddwrt.cfg to the /conf/Services folder.

Step 4 - Add dd-wrt Items to openHAB

  • Option 1 - Copy/paste the follwoing text into your existing items (*.items) file.
  • Option 2 - Launch your preferred text editor and copy/past the following into a new file.

// DD-WRT Binding //
String DEVICE_NAME "NAME OF ROUTER" <signal> (GROUP1, GROUP2) {ddwrt="routertype"}
Switch INTERFACE1_NAME "INTERFACE1 NAME" <signal> (GROUP1, GROUP2) {ddwrt="wlan24"}
Switch INTERFACE2_NAME "INTERFACE2 NAME" <signal> (GROUP1, GROUP2) {ddwrt="wlan50"}
Switch INTERFACE3_NAME "INTERFACE3 NAME" <signal> (GROUP1, GROUP2) {ddwrt="wlanguest"}

Customize the Item Names

  • Replace DEVICE_NAME, INTERFACE1_NAME, INTERFACE2_NAME and INTERFACE3_NAME.
  • Ensure they are unique througout your openHAB installation.

Customize the Item Descriptions

  • Replace "NAME OF ROUTER", "INTERFACE1 NAME", "INTERFACE2 NAME" and "INTERFACE3 NAME".

Customize the Item Icons

  • Replace or Delete the "" fields.

Customize the Item Group Membership

  • Replace or Delete the "(GROUP1, GROUP2)" fields.

Save your changes

  • Option 1 - Save your edited Items file.
  • Option 2 - Save the file as ddwrt.itmes in the appropriate Items folder based on your openHAB version.

Step 5 - Follow-up

  • Please remember to backup your router before activating and using this binding. Turning off the wrong interface may result in the loss of network access, therfore preventing openHAB from turining them back on.
  • Your routers chipset and configuration will determin the interfaces you can control. Any of the interfaces listed when the ifcomand was run can be attached to the binding.

Installation


User Interfaces


Community

(link to openHAB forum)

Development



Misc


Samples

A good source of inspiration and tips from users gathered over the years. Be aware that things may have changed since they were written and some examples might not work correctly.

Please update the wiki if you do come across any out of date information.

Use case examples

Collections of Rules on a single page

Single Rules

Scripts


Release Notes

Clone this wiki locally