Control an ESP8266 LED Dimmer using OpenHAB

Recently I’ve switched to OpenHAB and now I wanted to control the ESP8266 LED Dimmer using OpenHAB. So I’ve put a script together that can be used to set the dimming level using a slider in OpenHAB.

The first part is to create a ESP8266 LED Dimmer. After this is completed, the dimming level can be controlled by sending an http call to the webserver on the ESP8266 with the value (0-100) for the LED-strip: http://192.168.0.xx/led/0

Next create a new item in OpenHAB. To do this, add the following line to the items file:

Dimmer LED_Dimmer "LED Dimmer" <light> { http=">[*:GET:http://192.168.0.xx/led/%2$s/]" }

And create a control for this item in the sitemap, so it can be controlled from the web-interface or mobile app:

Slider item=LED_Dimmer

Now you will be able to control the LED Dimmer from OpenHAB. For example, in the OpenHAB iOS application this will look like this: