Simple jython example

Hello guys…

Searched around, but can’t find a example on a really simple rule in jython - could be a switch triggering a output and sets a timer that turn the output off after 5 minutes…

Could someone lead me the way?

Maybe you’ve already checked these but there’s some documentation here:


and

Hope it helps.

Also check out some of the Lucid postings. @RRoe and @5iver have posted several tutorials to the forum here and there which should be useful.

You should also find a lot of examples looking at everything posted under the jython tag.

Are you using an OH snapshot build? There was a somewhat recent change that may effect you.

PLanning to upgrade to latest now one of the days before i start with the JSR :slight_smile:

Thanks guys - i’ll start reading :slight_smile:

The OH documentation has been updated to include the TriggerBuilder change, so you should be OK if you are planning on using the raw ESH API. If you are planning to use the modules from OH-Jython-Scripters, then give me some time to do some updates. If you get really anxious to use them with an OH snapshot, my fork has some updates to be compatible with the change, but i have a few really cool updates that I haven’t committed yet!

Let me know if you have any questions or need some more examples!

Awesome… it’s not anything that’s must be done right now, just collecting information so I can start it up in the near future - maybe your new cool update is worth the wait?

I plan to use the Jython language :slight_smile:

I’ve made a single decorator to handle any type of trigger, and I’m working on a more Rules DSL-like format for using it. Should be ready soon.

1 Like

Awesome - let me know when it’s done :slight_smile:

I’ve finished this and have tested it for a week or so. There’s one piece of it that I’d like to rework, but it has been working fine for me. PM me if you’d like to test it out for me before I put a post together.