openhab / org.openhab.ui.habmin

HABmin - a graphical user interface for openHAB 2
230 stars 91 forks source link

openHab 2 and Habmin in IDE #80

Closed paixaop closed 9 years ago

paixaop commented 9 years ago

Chris when I import the HABmin2 project into the IDE to start it with OH2 for development I get the following error:

Project build error: Non-resolvable parent POM for org.openhab.ui:org.openhab.ui.habmin:
[unknown-version]: Could not find artifact org.openhab:pom:pom:2.0.0-SNAPSHOT and 
'parent.relativePath' points at wrong local POM

Then fixed the Relative Path to match the main OH POM file but then got another error

Plugin execution not covered by lifecycle configuration: org.eclipse.tycho:tycho-packaging- 
plugin:0.22.0:build-qualifier (execution: default-build-qualifier, phase: validate)

Did a quick fix in Eclipse on the error and it went away. After adding both ZWave and HABmin bindings to the start list of the Debug Configuration I can see the HABmin link in the OH2 main page but when I click on it I get 404 errors. Where should I put the web files so that Habmin2 works in OH2?

cdjackson commented 9 years ago

On 2 Sep 2015, at 14:46, Pedro Paixao notifications@github.com wrote:

Chris when I import the HABmin2 project into the IDE to start it with OH2 for development I get the following error:

Project build error: Non-resolvable parent POM for org.openhab.ui:org.openhab.ui.habmin:[unknown-version]: Could not find artifact org.openhab:pom:pom:2.0.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM

Does that actually cause a problem? I think I have the same error, but it’s not a problem. The system is NOT configured to be able to use maven - I tried this, but couldn’t get it working. You can only run/compile within the IDE.

Then fixed the Relative Path to match the main OH POM file but then got another error

Plugin execution not covered by lifecycle configuration: org.eclipse.tycho:tycho-packaging-plugin:0.22.0:build-qualifier (execution: default-build-qualifier, phase: validate)

I don’t know what that means...

Did a quick fix in Eclipse on the error and it went away. After adding both ZWave and HABmin bindings to the start list of the Debug Configuration I can see the HABmin link in the OH2 main page but when I click on it I get 404 errors. Where should I put the web files so that Habmin2 works in OH2?

There aren’t any web files to install - they are already part of the JAR - in the web folder.

cdjackson commented 9 years ago

Just another point for information. I'm currently doing a significant overhaul of the UI, so depending on what you're looking to change (if anything), just be aware that it might not be possible to merge. Changes in the JAR should generally be ok, but most web side files will change.

I would suggest you work with the change branch, but if you do, you won't be able to use the zwave binding, which I suspect is what you want to do?

paixaop commented 9 years ago

Yes the plan was to work mainly on the zwave bidinding to add scene support directly. I have a 15 Cooper 5 button scene controllers that I want to program directly. I don't want to do the scenes as openHab rules. Then I want to add the scene configuration GUI to habmin. What's your suggestion?

cdjackson commented 9 years ago

I'm not sure.

Note that Habmin won't support the Zwave binding specific interfaces. It will only support esh interfaces.

We therefore need to work within the constraints of the esh configuration which means that there will be nothing to add in Habmin

Why do you need a scene specific interface? What would it look like in Habmin?

paixaop commented 9 years ago

It's a similar concept used in HomeSeer 3. Like OH they have support for scenes as rules, but when you install their Z-Wave plugin (equivalent to the zwave binding in OH) you get an extra option in the plugin configuration that supports Z-Wave Scenes.

screen shot 2015-09-02 at 7 18 33 pm

Then you can configure scenes as zwave scenes/association commands which are supported by scene controller and scene actuator command classes and associations.

Here is a sample scene with one dimmer.

screen shot 2015-09-02 at 7 17 36 pm

Zwave scenes only support Z-Wave devices, that is indeed a limitation (easily overcome), but they have the benefit of being programmed directly in the wall controllers and switches so they don't need the home automation computer running.

I was thinking of adding a new tab in HABmin 1 interface for scenes. You would be able to configure up to 255 scenes of only Zwave devices. This is supported by ZWave directly. Then the user adds devices to scenes and set their ON/OFF, Level, Temperature, etc...

Step 2 is to transfer the scene configuration to the ZWave controllers. This is done use the Scene Controller and Actuator Command Classes, and the Association command class.

Once a scene is configured in the Z-Wave controller it can be used without OH running. If user want to mix devices (Z-wave and other OH things) we can control the Zwave devices directly from the scene controllers as explained, and OH still receives the scene activation command which can trigger an OH rule.

cdjackson commented 9 years ago

Thanks. Will digest this more tomorrow but second question - what will the data look like between the client and server?

paixaop commented 9 years ago

Similar to

[ {
    sceneId: 1,
    sceneName: "dinner",
    dimmingDuration: 0x10,
    devices: [
        {
             nodeId: 2,
             commandClass: 0x20,
             level: 0
        },
        {
             nodeId: 5,
             commandClass: 0x26,
             level: 30
        },
        ...
    ],
},
{
    sceneId: 2,
    ...
}]
cdjackson commented 9 years ago

I think that the individual components will need somehow to be broken down to separate configuration parameters - complex parameters like this can't be sent...

I would suggest one of the following options -:

Only the last option is likely to be best in the long term I think, but it's also going to be a hard sell to get things added to ESH - at least not quickly.

In the short term, I would suggest you read up on the ESH configuration system and see if you can make this fit...

paixaop commented 9 years ago

Chris how do I register an event handler so that when we get a scene activation command class report message, I can trigger code in the Scene Manager Class?

lsafelix75 commented 9 years ago

Hi, I am having issue to run HABmin as a UI bundle in OH2 eclipse IDE. Problem is when i click on HABMIN from "Welcom to openHAB 2" page, I am getting "HTTP Eror 404" Problem accessing /habmin/index.html.

Obviously, the servelet is unable to locate the file. Question is, which directory should I put webapps/habmin/*? in distribution/openhabhome/ ? Ot anywhere else? Note. this is running from within Eclipse IDE and not the openhab distribution packgae. thanks.

cdjackson commented 9 years ago

There is no webapps folder - you just need to install the JAR file - nothing else.

lsafelix75 commented 9 years ago

Where do i add the jar file to in Eclipse IDE? Cause i am running distribution package instead run from OH2 source code. thanks.

cdjackson commented 9 years ago

I think you just need to import it into the ide