I think the problem was interaction from my Vera controller. I removed it and now all seems to be working correctly.