ruebox / openhab2-addons

Add-ons for openHAB 2.x
Eclipse Public License 1.0
16 stars 6 forks source link

Dimmers? #7

Closed lassem closed 6 years ago

lassem commented 6 years ago

I am mainly creating this to share my getAll.xml file. Included my latest log file as well, albeit it was 4+ MB.

Archive.zip

What can I do to contribute?

BastianZim commented 6 years ago

Hey, I'm not the maintainer so not 100% sure, but it would be very helpful if you could test the new thermostat and switch function since it didn't work for me.

Thanks by the way for participating as well!

ruebox commented 6 years ago

Hi there,

I am in a flow and just added the dimmers ... please checkout a testing version attached.

Have fun and just let me know if something is not working.

@lassem Thanks for the xml. It helped a lot to find the correct ids and missing devices. org.openhab.binding.freeathome-2.0.0-SNAPSHOT.jar.zip

lassem commented 6 years ago

I've tried to get that build to run quite a few times now, but I can't get it to work. I've downgraded to OpenHAB 2.0.0-1 (since I couldn't get it to build from your branch rebased onto 2.2.0-SNAPSHOT anymore)

Any ideas? Ubuntu 16.04

2018-03-20 23:41:47.574 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.freeathome-2.0.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.freeathome [175]
  Unresolved requirement: Import-Package: org.openhab.core.library.types

    at org.eclipse.osgi.container.Module.start(Module.java:434)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:392)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1253)[4:org.apache.felix.fileinstall:3.5.6]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1225)[4:org.apache.felix.fileinstall:3.5.6]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:512)[4:org.apache.felix.fileinstall:3.5.6]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)[4:org.apache.felix.fileinstall:3.5.6]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312)[4:org.apache.felix.fileinstall:3.5.6]
ruebox commented 6 years ago

Hi, I can reproduce the issue. It seems to be linked with the pom.xml and manifest because the addon is properly running in my development environment. However, in oh 2.2. release build I get the same error.

In order to run mvn package successfully, I had to add: Import-Package: ... org.openhab.core.library.types,

to Manifest.mf. Then mvn package is successful, but the dependencies are missing.

If you have an idea to solve it ... just let me know.

I will check the internet ... Best

lassem commented 6 years ago

The org.openhab.core.libraries.type package seems to live inside the org.openhab.core.compat1x bundle.

I installed this package https://docs.openhab.org/developers/development/compatibilitylayer.html via the console https://docs.openhab.org/administration/console.html

Not getting an error message in the logs, but not getting the addon either :-/

lassem commented 6 years ago

I got it to work! Not really sure what fixed it. I uninstalled openhab2 by running apt-get purge openhab2 Reinstalled openhab 2.2 with a regular apt-get install openhab2 Selected the expert-package option when configuring openhab. Downloaded your dimmer version of the addon and it worked.

Tested a dimmer and it works, but this version seems to only find some of my dimmers. The 4-fach ones. I am missing amongst others 2/1 dim actuator ABB800C6DF71 and 1/1 dim actuator ABB700C6C787

ruebox commented 6 years ago

Hi @lassem,

I rebuild the jar and now the org.openhab.core.libraries.type are not longer required. I do not know why as I did not changed any code.

However, the binding started successfully with oh 2.2.0 release build and purely ui setup. Seems that some inconsistencies introduced some oh 1. dependencies.

Update will follow.

ruebox commented 6 years ago

@lassem Please find a new version attached. I will now include new dimmer device ids: case "9017": // 1/1 dim actuator case "9019": // 2/1 dim actuator

Please check if the binding is now working in openhab simply UI setup and with your dimmers.

Thanks

lassem commented 6 years ago

@ruebox Did you forget to attach the jar?

ruebox commented 6 years ago

Yes, just updated it with the switches. You will find it on #10

lassem commented 6 years ago

@ruebox Nevermind, just saw Issue #10 👍

lassem commented 6 years ago

Here's an excerpt from the xmpp communication while in the free@home interface and turning the light on and off.

<datagrab>
    <iq xmlns="jabber:client" to="mrha@busch-jaeger.de/rpc" type="set" id="1521825556464">
        <query xmlns="jabber:iq:rpc">
            <methodCall>
                <methodName>RemoteInterface.setDatapoint</methodName>
                <params>
                    <param>
                        <value>
                            <string>ABB700C6DF1E/ch0006/idp0000</string>
                        </value>
                    </param>
                    <param>
                        <value>
                            <string>0</string>
                        </value>
                    </param>
                </params>
            </methodCall>
        </query>
    </iq>
    <iq type='result' to='installer@busch-jaeger.de/c54216' from='mrha@busch-jaeger.de/rpc' id='1521825556464'
        xmlns='jabber:client'>
        <query xmlns='jabber:iq:rpc'>
            <methodResponse>
                <params>
                    <param>
                        <value>
                            <boolean>1</boolean>
                        </value>
                    </param>
                </params>
            </methodResponse>
        </query>
    </iq>
    <message xmlns='jabber:client' type='headline' to='installer@busch-jaeger.de/c54216' from='mrha@busch-jaeger.de'>
        <event xmlns='http://jabber.org/protocol/pubsub#event'>
            <items node='http://abb.com/protocol/update'>
                <item id='1'>
                    <update xmlns='http://abb.com/protocol/update'>
                        <data>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;project timeStamp=&quot;479821&quot;
                            sessionId=&quot;117af773&quot; type=&quot;update&quot; mrhaVersion=&quot;2.1.6&quot;
                            mrhaBuild=&quot;5966&quot;&gt;&lt;privileges/&gt;&lt;devices&gt;&lt;device serialNumber=&quot;ABB700C6DF1E&quot;
                            domainAddress=&quot;CFCC&quot; state=&quot;modified&quot; commissioningState=&quot;ready&quot;
                            progress=&quot;100&quot;&gt;&lt;channels&gt;&lt;channel state=&quot;modified&quot; i=&quot;ch0000&quot;
                            cid=&quot;ABB705E9&quot;&gt;&lt;inputs&gt;&lt;dataPoint state=&quot;modified&quot; i=&quot;idp0000&quot;
                            full=&quot;false&quot;&gt;&lt;value&gt;0&lt;/value&gt;&lt;/dataPoint&gt;&lt;/inputs&gt;&lt;outputs/&gt;&lt;parameters/&gt;&lt;scenes/&gt;&lt;/channel&gt;&lt;channel
                            state=&quot;modified&quot; i=&quot;ch0006&quot; cid=&quot;ABB70262&quot;&gt;&lt;inputs&gt;&lt;dataPoint
                            state=&quot;modified&quot; i=&quot;idp0000&quot; full=&quot;false&quot;&gt;&lt;value&gt;0&lt;/value&gt;&lt;/dataPoint&gt;&lt;/inputs&gt;&lt;outputs&gt;&lt;dataPoint
                            state=&quot;modified&quot; i=&quot;odp0000&quot; full=&quot;false&quot;&gt;&lt;value&gt;0&lt;/value&gt;&lt;/dataPoint&gt;&lt;/outputs&gt;&lt;parameters/&gt;&lt;scenes/&gt;&lt;/channel&gt;&lt;/channels&gt;&lt;parameters/&gt;&lt;/device&gt;&lt;/devices&gt;&lt;/project&gt;
                        </data>
                    </update>
                </item>
            </items>
        </event>
    </message>
    <message xmlns='jabber:client' type='headline' to='installer@busch-jaeger.de/c54216' from='mrha@busch-jaeger.de'>
        <event xmlns='http://jabber.org/protocol/pubsub#event'>
            <items node='http://abb.com/protocol/update'>
                <item id='1'>
                    <update xmlns='http://abb.com/protocol/update'>
                        <data>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;project timeStamp=&quot;479822&quot;
                            sessionId=&quot;117af773&quot; type=&quot;update&quot; mrhaVersion=&quot;2.1.6&quot;
                            mrhaBuild=&quot;5966&quot;&gt;&lt;privileges/&gt;&lt;devices&gt;&lt;device serialNumber=&quot;ABB700C6DF1E&quot;
                            domainAddress=&quot;CFCC&quot; state=&quot;modified&quot; commissioningState=&quot;ready&quot;
                            progress=&quot;100&quot;&gt;&lt;channels&gt;&lt;channel state=&quot;modified&quot; i=&quot;ch0006&quot;
                            cid=&quot;ABB70262&quot;&gt;&lt;inputs/&gt;&lt;outputs&gt;&lt;dataPoint state=&quot;modified&quot;
                            i=&quot;odp0001&quot; full=&quot;false&quot;&gt;&lt;value&gt;0&lt;/value&gt;&lt;/dataPoint&gt;&lt;/outputs&gt;&lt;parameters/&gt;&lt;scenes/&gt;&lt;/channel&gt;&lt;/channels&gt;&lt;parameters/&gt;&lt;/device&gt;&lt;/devices&gt;&lt;/project&gt;
                        </data>
                    </update>
                </item>
            </items>
        </event>
    </message>
    <iq xmlns="jabber:client" to="mrha@busch-jaeger.de/rpc" type="set" id="1521825561652">
        <query xmlns="jabber:iq:rpc">
            <methodCall>
                <methodName>RemoteInterface.setDatapoint</methodName>
                <params>
                    <param>
                        <value>
                            <string>ABB700C6DF1E/ch0006/idp0000</string>
                        </value>
                    </param>
                    <param>
                        <value>
                            <string>1</string>
                        </value>
                    </param>
                </params>
            </methodCall>
        </query>
    </iq>
    <iq type='result' to='installer@busch-jaeger.de/c54216' from='mrha@busch-jaeger.de/rpc' id='1521825561652'
        xmlns='jabber:client'>
        <query xmlns='jabber:iq:rpc'>
            <methodResponse>
                <params>
                    <param>
                        <value>
                            <boolean>1</boolean>
                        </value>
                    </param>
                </params>
            </methodResponse>
        </query>
    </iq>
    <message xmlns='jabber:client' type='headline' to='installer@busch-jaeger.de/c54216' from='mrha@busch-jaeger.de'>
        <event xmlns='http://jabber.org/protocol/pubsub#event'>
            <items node='http://abb.com/protocol/update'>
                <item id='1'>
                    <update xmlns='http://abb.com/protocol/update'>
                        <data>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;project timeStamp=&quot;479823&quot;
                            sessionId=&quot;117af773&quot; type=&quot;update&quot; mrhaVersion=&quot;2.1.6&quot;
                            mrhaBuild=&quot;5966&quot;&gt;&lt;privileges/&gt;&lt;devices&gt;&lt;device serialNumber=&quot;ABB700C6DF1E&quot;
                            domainAddress=&quot;CFCC&quot; state=&quot;modified&quot; commissioningState=&quot;ready&quot;
                            progress=&quot;100&quot;&gt;&lt;channels&gt;&lt;channel state=&quot;modified&quot; i=&quot;ch0000&quot;
                            cid=&quot;ABB705E9&quot;&gt;&lt;inputs&gt;&lt;dataPoint state=&quot;modified&quot; i=&quot;idp0000&quot;
                            full=&quot;false&quot;&gt;&lt;value&gt;1&lt;/value&gt;&lt;/dataPoint&gt;&lt;/inputs&gt;&lt;outputs/&gt;&lt;parameters/&gt;&lt;scenes/&gt;&lt;/channel&gt;&lt;channel
                            state=&quot;modified&quot; i=&quot;ch0006&quot; cid=&quot;ABB70262&quot;&gt;&lt;inputs&gt;&lt;dataPoint
                            state=&quot;modified&quot; i=&quot;idp0000&quot; full=&quot;false&quot;&gt;&lt;value&gt;1&lt;/value&gt;&lt;/dataPoint&gt;&lt;/inputs&gt;&lt;outputs&gt;&lt;dataPoint
                            state=&quot;modified&quot; i=&quot;odp0000&quot; full=&quot;false&quot;&gt;&lt;value&gt;1&lt;/value&gt;&lt;/dataPoint&gt;&lt;/outputs&gt;&lt;parameters/&gt;&lt;scenes/&gt;&lt;/channel&gt;&lt;/channels&gt;&lt;parameters/&gt;&lt;/device&gt;&lt;/devices&gt;&lt;/project&gt;
                        </data>
                    </update>
                </item>
            </items>
        </event>
    </message>
    <message xmlns='jabber:client' type='headline' to='installer@busch-jaeger.de/c54216' from='mrha@busch-jaeger.de'>
        <event xmlns='http://jabber.org/protocol/pubsub#event'>
            <items node='http://abb.com/protocol/update'>
                <item id='1'>
                    <update xmlns='http://abb.com/protocol/update'>
                        <data>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;project timeStamp=&quot;479824&quot;
                            sessionId=&quot;117af773&quot; type=&quot;update&quot; mrhaVersion=&quot;2.1.6&quot;
                            mrhaBuild=&quot;5966&quot;&gt;&lt;privileges/&gt;&lt;devices&gt;&lt;device serialNumber=&quot;ABB700C6DF1E&quot;
                            domainAddress=&quot;CFCC&quot; state=&quot;modified&quot; commissioningState=&quot;ready&quot;
                            progress=&quot;100&quot;&gt;&lt;channels&gt;&lt;channel state=&quot;modified&quot; i=&quot;ch0006&quot;
                            cid=&quot;ABB70262&quot;&gt;&lt;inputs/&gt;&lt;outputs&gt;&lt;dataPoint state=&quot;modified&quot;
                            i=&quot;odp0001&quot; full=&quot;false&quot;&gt;&lt;value&gt;12&lt;/value&gt;&lt;/dataPoint&gt;&lt;/outputs&gt;&lt;parameters/&gt;&lt;scenes/&gt;&lt;/channel&gt;&lt;/channels&gt;&lt;parameters/&gt;&lt;/device&gt;&lt;/devices&gt;&lt;/project&gt;
                        </data>
                    </update>
                </item>
            </items>
        </event>
    </message>
</datagrab>
ruebox commented 6 years ago

Hi. looks like as if some device channels do not start at ch000, but with #channels - 1

Could you please manually adapt the channels of the following devices via PaperUI: Serial - deviceTypeId - discovered channel -> new channel

If all your dimmers are then working. I would generate a new version with adapted discovery.

ruebox commented 6 years ago

fixed with 877685f7dc95448b4322c84bc1199ee899278034

ruebox commented 6 years ago

closed. please checkout #14