Control 4 channel TRIAC dimmer with Openhab 2 and RPi GPIO pins

Hey guys,

I’m brand new to all this home automation stuff so i’m sorry if my knowledge is limited.

I want to control a TRIAC dimmer using Openhab 2 and a Raspberry Pi using the GPIO pins.

This is the board I bought… http://www.ebay.com/itm/4CH-AC-LED-Light-Dimmer-V2-Module-Leading-Edge-ARDUINO-RASPBERRY-Smart-Home-/112410704471

At the moment it everything works in terms of switching using the Switch, this is what I have so far…

//This is the Items file

//Demo items
Switch Lounge{ gpio= “pin:4” }

sitemap home label=“Home”
{
Frame label=“Demo”
{
Switch item=Lounge
}
}

Then I tried changing to this…

//This is the Items file

//Demo items
Dimmer Lounge{ gpio= “pin:4” }

sitemap home label=“Home”
{
Frame label=“Demo”
{
Slider item=Lounge
}
}

The slider moves up and down but the light doesn’t respond at all.

Any help would be appreciated, thanks.

This board is not suitable for direct control from an OpenHAB GPIO pin. It expects inputs as phase angle control. that means each input must be turned on (and off) during each mains power cycle, that is to say 100 times a second. The timing of that after the AC power zero crossing determines the delivered power.

It is intended for use with some dedicated controller doing that work hundreds of times asecond, say an Arduino with appropriate code. A subsystem like that could also listen for an occasional command from OpenHAB, say “channel 1 50% dimmed”, and maintain that state all by itself.

Thank you Ross! That’s all I needed to know, I’ll order an Arduino tonight and see how I get on.

Do you have any idea where I could find the appropriate code? I’ve been looking at other forums and websites and I’m so lost when it comes to writing the code required for dimming the lights.

No idea I’m afraid. Keyword for searching might be “phase angle”

Thank you