Is OpenHab Dying?

Speaking as someone with pretty basic coding skills, I’ve asked numerous questions and never been told to RTFM or search the forums… safe to say that without the forums I would have found writing rules very difficult or even impossible. With the forums it’s been pretty straightforward.

3 Likes

I’ll weigh in a little on the rules DSL, at the risk of repeating things that people may have said elsewhere.

The Xtend language has some significant limitations, particularly things like the function syntax if you want to factor anything out, and when trying to generalise groups of items.

Having said that, to my mind the JSR223 has many of the same ugliness problems. The bottom line is that we’re using a language that wasn’t intended to be used in the way we’re using it - xtend was originally for making extensions to the Eclipse platform. Javascript was for browser automation (and not a particularly good language at that either), it’s become so prevalent that people are pressing it into service as a general purpose language, and it’s not really suited to it.

I think it’s easy to point out that Xtend is ugly, but compared to what? If compared to Javascript, then not really so ugly - the JSR223 has it’s own peculiarities and syntactical ugliness (I found the same when using AngularJS with Javascript - they had to seriously torture the language to get it doing what they wanted).

If someone was to say we could use Ruby or some other strongly typed language, and it would have all the data types and Openhab classes natively available, then I’d be quite excited. But it’s also probably not realistic - taking any general purpose language and bending it to Openhab use will probably also introduce ugliness and a need to learn a bunch of quirks.

By no means take this as an argument against progress, more that we need to make sure the grass on the other side is genuinely greener before we go there. I tend to agree that for most users some form of UI, drag and drop, configuration type approach will be best suited. The higher end users can probably live with whatever coding language we give them - they’re a smaller percentage of the user base anyway.

To me the real magic is some way for people to make snippets of code that do things (using whatever language we end in - Xtend or JSR223 or whatever), and then expose those as objects to the drag and drop configuration UI. That means that whenever one of our more expert users makes a block of code to do a task they can then expose that to everyone else in the community - and a small percentage of coders can probably make the features that the large majority of users want. Note here that I’m not talking about people coding new bindings or services in Java and checking them in - that’s beyond a large proportion of our user base. I’m talking about that section of our user community that currently write rules in Xtend being able to package up a section of their rules file into some sort of plugin or library that people can use without needing to know how to code in Xtend. That might be wishful thinking, but if we could work out a way to do that, I think we’d be able to enable a lot of our user base to do things they never could code themselves.

3 Likes

This probably belongs in it’s own thread so I’ll be brief.

  • you seem to be under the impression that jsr223 only supports JavaScript. In addition to JavaScript Nashorn (a JavaScript variant that comes with Java), it also supports Jython (a Python 2.7 variant that runs on Java), and Groovy which I don’t know a lot about.
    -there was effort to get jRuby to work too but technical challenges arose and the work was abandoned.
  • the issue of strongly typed versus weakly typed is philosophical with no real answer.
  • when the whole project can move to Graal VM in newer versions of Java we will be able to support even more languages.
  • in all three currently supported languages all the core Java classes are available for use. Many core OH classes are also available for use.
  • the ability to create and distribute Rule Templates is a key feature of the Next Gen Rules Engine and pretty much everything is in place to support it already except for an easy way to create them and a way to distribute them.
4 Likes

What most people seem to forget, probably because the documentation is not there (but I’m working on it): You can write your logic also in Java.

Java is already a very simple to use language. And it has very powerful means to hide complexity via annotations, e.g. something like this is possible

@OpenhabExtension
class MyLogic {
    @ThingReference(uid = "binding:thingID")
    Thing myThing;

    @Every(10, TimeUnit.Minutes)
    void checkWaterLevel() {
        // Do something with myThing
    }
}

You have full type checking and IDE support, so no runtime syntax errors etc and full debug support on top. You also have full access to all Core classes and services, your code runs native with full speed and if you indeed do something “stupid”, Core can protect you and output meaningful error messages.

Maybe another way for openHAB to not die is to build up on this, because HomeAssistant and python cannot provide live debugging and step through from within an IDE. Let’s use our strengths here.

(I want to point out here that Jython has annotations too and with the helper libraries it is also very easy to use. Just doesn’t provide live debugging.)

11 Likes

Why is this topic focusing on the rule language?..
Ofcouse, rules are a major feature of a smart home system. But without a prober interface and huge support of things, how important is a strong rule langauge then?

We still have more bindings than HomeAssistant and adding about 2 per month. It’s not the problem of not having enough “Things”. We also have a proper interface. The binding interface in its basics hasn’t changed since about 2 years.

1 Like

In my saying, it is not a competition. It´s basic requirement for any smart home system to support alot of things, (devices etc). I couldn´t care less if openhab got more binding than HA, if it means it doesn´t support whats needed. So it´s not the actual amount of bindings which is important.

In my opinion, a smart home system should:

Have a huge support for devices/things.
Easy to setup and maintain.
Strong possibiliies through rules.

If any one of these dependencies is lacking or struggling to keep up with the needs, the whole system will more or less fail, or be less attractive. Which is why I fail to understand the focus on rules language only.

But this is a general speaking ofcouse.

Sorry, I meant user-interface. Not the binding interface. (I have no idea about bindings are created).

It’s a focus of discussion here because that is where this thread has gone. If you read the full thread you will see that pretty much everything has been mentioned and talked about from OH’s marketing, approval for new bindings, making development of bindings better, UI improvements, etc.

Don’t mistake a few posts focusing on one specific topic to mean that all other topics are being ignored or forgotten.

5 Likes

I dont. But I get concerned when I see a discussion about which language to use for rules, insted of focusing on creating a UI for drag and drop rules. Then the actual rule language doesnt really matter for the common user.

And others have a strong concern over what language is chosen and wouldn’t use a drag and drop UI. OH has to do its best to accommodate as must as possible for all of these users. Forbidding the discussion of languages seems exceptionally unreasonable to me.

3 Likes

The new control UI that replaces Paper UI+Classic UI+Modern UI etc is basically finished, judging by the fact that it will be presented to foundation members this month. My Setup&Maintenance UI is also finished and I’m currently working on Core pull requests to add missing functionality.

So all in all I’d say that on the UI front we are settled for OH 3.

31 Likes

@David_Graeff thanks for hard work!

3 Likes

I appreciate you speaking on behalf of the common user, but I don’t think we should assume that the common user will never go beyond GUI rules. So, the rule language does matters to every OH user. Ideally, it will work well for experienced programmers while still being accessible to people who are learning to code.

MIT’s Scratch language for kids is a good example. You start out with the drag-and-drop interface to understand core concepts, and as you progress you can begin working directly within Scratch’s code editor.

What I’ve gotten from this discussion is that we need better GUI (I’m looking forward to seeing @David_Graeff’s work) AND a comprehensive rule language, so that we can accommodate beginners properly, enable intermediate users to take on bigger tasks when they’re ready, and minimize limitations on advanced/expert users. This is not an easy challenge, but it’s not unique to OH. Every product/service struggles to balance diverse user needs.

Wow, I was not aware of this possibility. Just to se sure to understand you correctly: I could write my rules in Java?

Yes, that is exactly what is missing now. So how to do it with Java?

THIS IS NOT A FLAME RANT - JUST ONLY A QUESTION FOR CLARITY

David - are you speaking for yourself when you say that we are “all settled” or is this a statement from OH maintainers?

I ask not out of mean spirit but for clarification…if everyone has agreed that this is the way forward I’m excited, we have a goal post to shoot for. I appreciate all of the hard work that you’ve put forward…you have done so much to make OH a better platform for us all.

I know there have been other UI’s proposed and KAI has said it was premature to have those conversations…

This is why I ask.

1 Like

See https://www.eventbrite.com/e/smart-home-day-tickets-60972676918: “13:30 A new frontend for openHAB (Yannick Schaus)” and in the webui repo for the new control UI discussion.

My Paper UI NG design study that I now call Setup&Maintenance UI is not recognised by the webui team, but personally maintained.

There are not more than those two UIs as far as I know and they complement each other.

Thanks for the response…

I was speaking of Yannicks…

Do you know if there are any plans to stream the smart home day event? I’d love to be able to watch from afar…I could also donate some streaming bandwidth if needed.

Squid

My intention was not to make it forbidden. But I find it strange to discuss something which isn´t a main concern, when other things such as UI´s are in a desperate need of a makeup.

I hope your right.

Something which isn’t a main concern for you. For those who where discussing it it is a main concern. Everyone had their own set of major concerns and they will discuss it.