Hi all,
I’ve been tinkering with openHAB for a while now and have quite a few rules running in the existing Xtend based language. I have never quite gotten my rules doing as much as I have planned though, and I often have annoying bugs that I haven’t fixed, due to a lack of time and a lot of unexpected interruptions.
I finally think I have some time coming up where I will be able to work on things, but it seems that openHAB is moving away from Xtend and that Jython will be the preferred way to build rules in the near future (is this correct?).
I have done a little bit of experimenting with Jython, and have the basics working in my setup, but at this stage I don’t really have a good feeling for how to write rules in Jython for openHAB. I’ve looked at lots of examples, but with no Python background, I don’t feel anywhere near as confident writing rules as I do with the existing rules DSL. I have a strong Ruby background which I hoped would translate to Python, but they are less simliar than I had hoped.
There doesn’t appear to be any comprehensive documentation for using Jython to write rules at the moment (I’ll be happy if someone can prove me wrong on this and show me otherwise). So I’m left with a few choices and wondering what people would recommend.
-
Forget about Jython for now and just write rules the existing way that I know how and make the best use of the time I have now. But will this lead to problems for me down the track when all the cool kids have moved away? Will the old way be supported indefinitely in openHAB or will I eventually have to rewrite them one day anyway?
-
Tinker away with my existing rules trying to convert them to Jython to learn as I go. Hopefully getting to the point where my understanding reaches some sort of ignition point and it all starts to make sense. This is what I have done so far and, while I have made some progress, I feel like it has been slow going.
-
Take some time out and learn Python properly. Obviously I won’t achieve anything tangible for a while, but hopefully when I come back to it things will make sense.
Thanks for reading this. I expect it will generate a few differing opinions, but I will be appreciative of any insights people have.