Control X-10 device with Insteon Hub

For several years I have been controlling the heating in an apartment which is rented for days in an airbnb style using an X-10 dim rail switch. I have a php script which looks at the availability calendar of the apartment and switches the heating on a few hours before the guests arrive and switches it off when they leave. A few days ago the webio device which I was using to connect the system to the internet broke down so I bought an Insteon Hub. The documentation for using the insteon is very confusing. This is why I developed the url creator below. If you follow these instructions you should be able to control your X-10 device using an Insteon Hub in a couple of minutes.

The Insteon Hub comes with an ap which you can use to control X-10 or insteon devices but it is also possible to control devices using a url. (this will allow you to use programs like php to write more sophisticated control systems). If you want to use your Insteon Hub in this way the first thing to do is to find the IP address of the hub. The easiest way to do this is to use a LAN scanner to find the device. There is a free program called advanced IP scanner which is very good. On my system the Insteon Hub is located at http://192.168.0.10 (note the 192.168 addresses are used on your local LAN system) The Insteon Hub has a web server and the default port is 25105 so to connect with the device the base url is this http://192.168.0.10:25105/ If I want to send commands to my device I would replace the http://mydomain.com in the form below with http://192.168.0.10. Then I can use it to create the urls necesary to control my device.

As I want to control the devices over the internet it is necesary to configure the router. I added an entry into Port Forwarding which forwards the traffic on port 25105 to http://192.168.0.10 It is also a good idea to tell the router to give the Insteon Hub a static ip address. I also got a free Dynamic Domain Name from no-ip.com so that I can use a domain name for the url. Most modern routers allow Port Forwarding and Dynamic Domain Names. Once this system is set up I can use the urls created in the system below in my php program. My php script uses a system called CURL to open the urls.

Buy Insteon Hub Amazon.co.uk Buy Insteon Hub at Amazon.com USA

I found the actual codes on this useful page
Base url
Port
A B C D E F G H I J K L M N O P
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
ON OFF BRIGHT DIM ALL ON ALL OFF