ruebox / openhab2-addons

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

PubSub? #11

Closed lassem closed 6 years ago

lassem commented 6 years ago

I just wanted to ask if you where planning to implement the backchannel to OpenHAB using the XMPP PubSub and IQ functionality?

I guess there is no alternative? I did some feeble attempts last year but couldn't get it to work at the time.

Just curious.

Keep up the good work and just let me know if you need any help. Either testing or getting hands on with some code.

ruebox commented 6 years ago

Hi ... the code actually receives the update events via XMPP already. What is missing is to translate and transfer the event to the correct thing ...

It is planned to be implemented. However, first all the items should work properly ;-)

ruebox commented 6 years ago

@Lucurus @TheSpirit @lassem Hi there, just a short update. Prototype implementation for talk-back is implemented and roughly tested for percentage for raffstore. I will provide a new snapshot for tomorrow. Just too late for today.

However, I would need some support from your side to identify the correct channels. I will let you know how to deal with it :-) Thx.

ruebox commented 6 years ago

Initial version implemented (#35): Please checkout debug_log_dir/update.csv

ruebox commented 6 years ago

@lassem my sysap sends MessageEvents containing an xml that is evaluated as update in the 100418 snapshot (eg when actor is started or raffstore is stopped)

Presence events are only logged but not evaluated(yet)

It seems that your version only uses presence event.

Would be great if you could provide me the raw xml of an presence event eg when the thermostat temp is updated. I would try to incorporate this to the next snapshot.

Which sysap FW version are you using?

Thx

ruebox commented 6 years ago

@lassem Just checked my freeAtHome webui. I do not get continuous presence messages. SysAP is just sending iq:ping events.

If I activate a switch I get update events of the following structure:

<?xml version="1.0"?><project timeStamp="35902" sessionId="8b5bfda" type="update" mrhaVersion="2.0.4" mrhaBuild="3429"><devices><device serialNumber="ABB700C944DD" domainAddress="593C" state="modified" commissioningState="ready"><channels><channel state="modified" i="ch0000" cid="ABB70084"><inputs/><outputs><dataPoint state="modified" i="odp0003"><value>1</value></dataPoint></outputs><parameters/><scenes/></channel></channels><parameters/></device><device serialNumber="ABB260851E51" domainAddress="593C" state="modified" commissioningState="ready"><channels><channel state="modified" i="ch0003" cid="ABB20508"><inputs><dataPoint state="modified" i="idp0001" full="false"><value>1</value></dataPoint></inputs><outputs/><parameters/><scenes/></channel></channels></device></devices></project>

THX. Best

lassem commented 6 years ago
<?xml version="1.0" encoding="UTF-8"?>
<project timeStamp="513174" sessionId="117af773" type="update" mrhaVersion="2.1.6" mrhaBuild="5966">
    <privileges/>
    <devices>
        <device serialNumber="ABB700C92AB4" domainAddress="CFCC" state="modified" commissioningState="ready"
                progress="100">
            <channels>
                <channel state="modified" i="ch0000" cid="ABB702E7">
                    <inputs/>
                    <outputs>
                        <dataPoint state="modified" i="odp0010" full="false">
                            <value>18.48</value>
                        </dataPoint>
                    </outputs>
                    <parameters/>
                    <scenes/>
                </channel>
            </channels>
        </device>
    </devices>
</project>
ruebox commented 6 years ago

@lassem Thanks for the log.

I also see a lot of Headline Messages that encaspulate Events. That is fine so far. You receive the same messages than me. I think also the XML content you posted looks as with my free@home system.

@lassem Could you please also check the surrounding xml structure i.e. the raw XMPP message and compare it to my update xml.

When a switch is pressed, I see in my logs the following XML statement: image

Please note that I only extract items of node=http://abb.com/protocol/update (see line 4 in screenshot). @lassem I could imaging that the nodes are marked with a different address on your system such as node=http://busch-jaeger.com/protocol/update ...

Thx

lassem commented 6 years ago

I will look into this later today I hope.

lassem commented 6 years ago

Like so:

<message from="mrha@busch-jaeger.de" to="379e6dea-3ee4-4570-ae79-2a64667cf01b@busch-jaeger.de/29e92fa7" type="headline">
    <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="1.0" encoding="UTF-8"?>&lt;project timeStamp="226477" sessionId="7989076a"
                        type="update" mrhaVersion="2.1.7" mrhaBuild="5969">&lt;privileges/>&lt;devices>&lt;device
                        serialNumber="ABB700C92AAD" domainAddress="CFCC" state="modified" commissioningState="ready"
                        progress="100">&lt;channels>&lt;channel state="modified" i="ch0000" cid="ABB702E7">&lt;inputs/>&lt;outputs>&lt;dataPoint
                        state="modified" i="odp0010" full="false">&lt;value>22.42&lt;/value>&lt;/dataPoint>&lt;/outputs>&lt;parameters/>&lt;scenes/>&lt;/channel>&lt;/channels>&lt;/device>&lt;/devices&gt;&lt;/project>
                    </data>
                </update>
            </item>
        </items>
    </event>
</message>
lassem commented 6 years ago

That is from own app; I will look at the openhab log.

lassem commented 6 years ago

uhm, with debug logging turned on I seem to be missing a lot of files from the /tmp directory (as discussed in another issue)

lassem commented 6 years ago

Here is a switch update payload:

<message from="mrha@busch-jaeger.de" to="379e6dea-3ee4-4570-ae79-2a64667cf01b@busch-jaeger.de/29e92fa7" type="headline">
    <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="1.0" encoding="UTF-8"?>&lt;project timeStamp="226726" sessionId="7989076a"
                        type="update" mrhaVersion="2.1.7" mrhaBuild="5969">&lt;privileges/>&lt;devices>&lt;device
                        serialNumber="ABB2E9C81751" domainAddress="CFCC" state="modified" commissioningState="ready">&lt;channels>&lt;channel
                        state="modified" i="ch0007" cid="ABB2030B">&lt;inputs>&lt;dataPoint state="modified" i="idp0000"
                        full="false">&lt;value>97&lt;/value>&lt;/dataPoint>&lt;/inputs>&lt;outputs>&lt;dataPoint
                        state="modified" i="odp0000" full="false">&lt;value>97&lt;/value>&lt;/dataPoint&gt;&lt;/outputs>&lt;parameters/>&lt;scenes/>&lt;/channel>&lt;/channels>&lt;/device>&lt;device
                        serialNumber="ABB700C92AA3" domainAddress="CFCC" state="modified" commissioningState="ready"
                        progress="100">&lt;channels>&lt;channel state="modified" i="ch0000" cid="ABB702E7">&lt;inputs>&lt;dataPoint
                        state="modified" i="idp0000" full="false">&lt;value>97&lt;/value>&lt;/dataPoint>&lt;/inputs>&lt;outputs>&lt;dataPoint
                        state="modified" i="odp0000" full="false">&lt;value>97&lt;/value>&lt;/dataPoint>&lt;/outputs>&lt;parameters/>&lt;scenes/>&lt;/channel>&lt;/channels>&lt;/device>&lt;/devices>&lt;/project&gt;
                    </data>
                </update>
            </item>
        </items>
    </event>
</message>
ruebox commented 6 years ago

Hi @lassem, Thx the update. Xml looks very similar to my events. I will generate a test snapshot tonight the improves the logging. Then we will see at least if the binding captures the messages,but xml parsing fails or if the messages are not captured.

I am using jaxb To parse the xml. Could there be an issue. Are you running openjdk?

ruebox commented 6 years ago

Btw how do you Tag the xml in the issue to get syntax highlighting?

lassem commented 6 years ago

No, I am running with Oracle JDK 1.8.0_152. The XML is deserialized using Jackson XML, but with a weird mix of jaxb annotations and jacksonxml annotations.

I do have some issues when deserializing the update data, so in order to get that to work with my current model I have to insert a fake device id attribute into the project element deviceId=FFFF.

lassem commented 6 years ago

To tag xml I use triple back ticks and manually specify xml. It is described in the markdown documentation. It looks like this:

```xml xml goes here ```

ruebox commented 6 years ago

I improved the logging within the event message handler to check if the message is properly received, the update data can be extract or if the decomposition of the is failing. Could you please active debug log for the binding and send me the debug log when sending updates.

Thanks a lot.

org.openhab.binding.freeathome-2.0.0-SNAPSHOT.280418.jar.zip

lassem commented 6 years ago

I pushed all my code to https://github.com/lassem/freeAtHomeNibeLink You can have a look there for any jackson stuff if you're interested.

Some of the code is actually yours and I added the APACHE license to the entire repo; let me know if you want me to remove said code.

lassem commented 6 years ago

I have no idea why I can't get some sensible logs. I only get the getAll.xml and settings.json in the tmp directory...

ruebox commented 6 years ago

Hi the binding should now trace more stuff to the openhab.log. debug trace level for the binding had to be activated perhaps this provides more insughts thx

lassem commented 6 years ago
lasse@voodoo:~$ tail -f /var/log/openhab2/openhab.log
2018-04-28 20:28:45.016 [DEBUG] [.www.protocol.http.HttpURLConnection] - sun.net.www.MessageHeader@5ad495dd7 pairs: {POST /http-bind/ HTTP/1.1: null}{Content-Type: text/xml; charset=utf-8}{User-Agent: Java/1.8.0_161}{Host: 192.168.10.215:5280}{Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2}{Connection: keep-alive}{Content-Length: 122}
2018-04-28 20:28:45.189 [DEBUG] [org.eclipse.jetty.io.IdleTimeout    ] - SelectChannelEndPoint@740593a4{/192.168.10.64:58528<->8080,Open,in,out,-,-,30000/30000,HttpConnection@1d8832a6}{io=0/0,kio=0,kro=1} idle timeout check, elapsed: 30000 ms, remaining: 0 ms
2018-04-28 20:28:45.189 [DEBUG] [org.eclipse.jetty.io.IdleTimeout    ] - SelectChannelEndPoint@740593a4{/192.168.10.64:58528<->8080,Open,in,out,-,-,30000/30000,HttpConnection@1d8832a6}{io=0/0,kio=0,kro=1} idle timeout expired
2018-04-28 20:28:45.189 [DEBUG] [org.eclipse.jetty.io.WriteFlusher   ] - ignored: WriteFlusher@65498347{IDLE} {}
2018-04-28 20:28:45.190 [DEBUG] [rg.eclipse.jetty.io.AbstractEndPoint] - Ignored idle endpoint SelectChannelEndPoint@740593a4{/192.168.10.64:58528<->8080,Open,in,out,-,-,30001/30000,HttpConnection@1d8832a6}{io=0/0,kio=0,kro=1}
2018-04-28 20:28:47.015 [DEBUG] [rg.quartz.core.QuartzSchedulerThread] - batch acquisition of 0 triggers
2018-04-28 20:29:04.014 [DEBUG] [org.eclipse.jetty.io.IdleTimeout    ] - SelectChannelEndPoint@3448d016{/192.168.10.64:58862<->8080,Open,in,out,-,-,30000/30000,HttpConnection@5b64391}{io=0/0,kio=0,kro=1} idle timeout check, elapsed: 30000 ms, remaining: 0 ms
2018-04-28 20:29:04.014 [DEBUG] [org.eclipse.jetty.io.IdleTimeout    ] - SelectChannelEndPoint@3448d016{/192.168.10.64:58862<->8080,Open,in,out,-,-,30000/30000,HttpConnection@5b64391}{io=0/0,kio=0,kro=1} idle timeout expired
2018-04-28 20:29:04.015 [DEBUG] [org.eclipse.jetty.io.WriteFlusher   ] - ignored: WriteFlusher@5c458612{IDLE} {}
2018-04-28 20:29:04.015 [DEBUG] [rg.eclipse.jetty.io.AbstractEndPoint] - Ignored idle endpoint SelectChannelEndPoint@3448d016{/192.168.10.64:58862<->8080,Open,in,out,-,-,30001/30000,HttpConnection@5b64391}{io=0/0,kio=0,kro=1}
2018-04-28 20:29:11.535 [DEBUG] [rg.quartz.core.QuartzSchedulerThread] - batch acquisition of 0 triggers
2018-04-28 20:29:15.190 [DEBUG] [org.eclipse.jetty.io.IdleTimeout    ] - SelectChannelEndPoint@740593a4{/192.168.10.64:58528<->8080,Open,in,out,-,-,30000/30000,HttpConnection@1d8832a6}{io=0/0,kio=0,kro=1} idle timeout check, elapsed: 30000 ms, remaining: 0 ms
2018-04-28 20:29:15.190 [DEBUG] [org.eclipse.jetty.io.IdleTimeout    ] - SelectChannelEndPoint@740593a4{/192.168.10.64:58528<->8080,Open,in,out,-,-,30000/30000,HttpConnection@1d8832a6}{io=0/0,kio=0,kro=1} idle timeout expired
2018-04-28 20:29:15.190 [DEBUG] [org.eclipse.jetty.io.WriteFlusher   ] - ignored: WriteFlusher@65498347{IDLE} {}
2018-04-28 20:29:15.191 [DEBUG] [rg.eclipse.jetty.io.AbstractEndPoint] - Ignored idle endpoint SelectChannelEndPoint@740593a4{/192.168.10.64:58528<->8080,Open,in,out,-,-,30001/30000,HttpConnection@1d8832a6}{io=0/0,kio=0,kro=1}
2018-04-28 20:29:34.015 [DEBUG] [org.eclipse.jetty.io.IdleTimeout    ] - SelectChannelEndPoint@3448d016{/192.168.10.64:58862<->8080,Open,in,out,-,-,30000/30000,HttpConnection@5b64391}{io=0/0,kio=0,kro=1} idle timeout check, elapsed: 30000 ms, remaining: 0 ms
2018-04-28 20:29:34.015 [DEBUG] [org.eclipse.jetty.io.IdleTimeout    ] - SelectChannelEndPoint@3448d016{/192.168.10.64:58862<->8080,Open,in,out,-,-,30000/30000,HttpConnection@5b64391}{io=0/0,kio=0,kro=1} idle timeout expired
2018-04-28 20:29:34.016 [DEBUG] [org.eclipse.jetty.io.WriteFlusher   ] - ignored: WriteFlusher@5c458612{IDLE} {}
2018-04-28 20:29:34.016 [DEBUG] [rg.eclipse.jetty.io.AbstractEndPoint] - Ignored idle endpoint SelectChannelEndPoint@3448d016{/192.168.10.64:58862<->8080,Open,in,out,-,-,30001/30000,HttpConnection@5b64391}{io=0/0,kio=0,kro=1}
2018-04-28 20:29:35.882 [DEBUG] [rg.quartz.core.QuartzSchedulerThread] - batch acquisition of 0 triggers
2018-04-28 20:29:42.101 [DEBUG] [.www.protocol.http.HttpURLConnection] - sun.net.www.MessageHeader@7b2e244c7 pairs: {null: HTTP/1.1 200 OK}{Access-Control-Max-Age: 7200}{Access-Control-Allow-Methods: GET, POST, OPTIONS}{Access-Control-Allow-Headers: Content-Type}{Content-Length: 148}{Access-Control-Allow-Origin: *}{Content-Type: text/xml; charset=utf-8}
2018-04-28 20:29:42.153 [DEBUG] [.www.protocol.http.HttpURLConnection] - sun.net.www.MessageHeader@193534977 pairs: {POST /http-bind/ HTTP/1.1: null}{Content-Type: text/xml; charset=utf-8}{User-Agent: Java/1.8.0_161}{Host: 192.168.10.215:5280}{Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2}{Connection: keep-alive}{Content-Length: 122}
2018-04-28 20:29:45.191 [DEBUG] [org.eclipse.jetty.io.IdleTimeout    ] - SelectChannelEndPoint@740593a4{/192.168.10.64:58528<->8080,Open,in,out,-,-,30000/30000,HttpConnection@1d8832a6}{io=0/0,kio=0,kro=1} idle timeout check, elapsed: 30000 ms, remaining: 0 ms
2018-04-28 20:29:45.191 [DEBUG] [org.eclipse.jetty.io.IdleTimeout    ] - SelectChannelEndPoint@740593a4{/192.168.10.64:58528<->8080,Open,in,out,-,-,30000/30000,HttpConnection@1d8832a6}{io=0/0,kio=0,kro=1} idle timeout expired
2018-04-28 20:29:45.192 [DEBUG] [org.eclipse.jetty.io.WriteFlusher   ] - ignored: WriteFlusher@65498347{IDLE} {}
2018-04-28 20:29:45.192 [DEBUG] [rg.eclipse.jetty.io.AbstractEndPoint] - Ignored idle endpoint SelectChannelEndPoint@740593a4{/192.168.10.64:58528<->8080,Open,in,out,-,-,30001/30000,HttpConnection@1d8832a6}{io=0/0,kio=0,kro=1}
^C
lasse@voodoo:~$ tail -f /var/log/openhab2/events.log
2018-04-28 18:48:07.750 [.ItemChannelLinkAddedEvent] - Link 'freeathome_dimmer_ABB700C6DF1E_ch0006_dimmer_switch-freeathome:dimmer:ABB700C6DF1E_ch0006:dimmer_switch' has been added.
2018-04-28 18:48:07.751 [.ItemChannelLinkAddedEvent] - Link 'freeathome_thermostat_ABB700C92AB0_therm_target_temp-freeathome:thermostat:ABB700C92AB0:therm_target_temp' has been added.
2018-04-28 18:48:07.751 [.ItemChannelLinkAddedEvent] - Link 'freeathome_thermostat_ABB700C92AB0_therm_switch-freeathome:thermostat:ABB700C92AB0:therm_switch' has been added.
2018-04-28 18:48:09.574 [hingStatusInfoChangedEvent] - 'freeathome:thermostat:ABB700C92AB0' changed from UNINITIALIZED to UNINITIALIZED (BRIDGE_UNINITIALIZED)
2018-04-28 18:48:09.677 [hingStatusInfoChangedEvent] - 'freeathome:bridge:e136de8a' changed from UNINITIALIZED to INITIALIZING
2018-04-28 18:48:11.546 [hingStatusInfoChangedEvent] - 'freeathome:bridge:e136de8a' changed from INITIALIZING to ONLINE
2018-04-28 18:48:11.595 [hingStatusInfoChangedEvent] - 'freeathome:thermostat:ABB700C92AB0' changed from UNINITIALIZED (BRIDGE_UNINITIALIZED) to INITIALIZING
2018-04-28 18:48:11.610 [hingStatusInfoChangedEvent] - 'freeathome:thermostat:ABB700C92AB0' changed from INITIALIZING to ONLINE
2018-04-28 18:48:11.611 [hingStatusInfoChangedEvent] - 'freeathome:dimmer:ABB700C6DF1E_ch0006' changed from UNINITIALIZED to INITIALIZING
2018-04-28 18:48:11.625 [hingStatusInfoChangedEvent] - 'freeathome:dimmer:ABB700C6DF1E_ch0006' changed from INITIALIZING to ONLINE

Nah, not very much happening here. I changed the temperature on a thermostat and switched on and off a light. Nothing.

ruebox commented 6 years ago

There is no debug entry in openhab.log from freeathomebinding? Have you activated the debug trace level for the binding? There should be at least entries like Message received etc.

I tested it with raffstore switch ... Does this show something?

ruebox commented 6 years ago

Btw i am logged in as installer. When you login via the official webapp of bj. Is the temperature of the thermostat displayed and updated? Is it the same for the status of the raffstore

ruebox commented 6 years ago

Again one question ... Do you get events with you freeathomebinding implementation? If you have some proposals to change the code you are welcome

In the lastest snapshot I send a presence as proposed ...

lassem commented 6 years ago

logs.zip

lassem commented 6 years ago

Have you pushed your latest changes to Github?

lassem commented 6 years ago

To answer your questions: When I log into the official webapp the temperature is shown. When I move the blinds this is also shown (either in the long press percentage popup) or by the icon flashing.

I have activated the debug log level via openhab-cli console (login/password openhab/habopen)

lassem commented 6 years ago
lasse@voodoo:/tmp$ tail -f update.csv
2018.04.28.22.26.23 ; ABB2E9C81751 ; ch0007 ; odp0000 ; 57 ;
2018.04.28.22.26.36 ; ABB700C92AB4 ; ch0000 ; odp0010 ; 20.6 ;
2018.04.28.22.26.41 ; ABB700C92AB0 ; ch0000 ; odp0013 ; 36 ;
2018.04.28.22.26.53 ; ABB700C92AAD ; ch0000 ; odp0013 ; 55 ;
2018.04.28.22.26.55 ; ABB700C92A84 ; ch0000 ; odp0010 ; 19.52 ;
2018.04.28.22.27.02 ; ABB700C92ADB ; ch0000 ; odp0010 ; 11.34 ;
2018.04.28.22.27.08 ; ABB700C92AA3 ; ch0000 ; odp0010 ; 20.92 ;
2018.04.28.22.27.13 ; ABB700C92AA3 ; ch0000 ; odp0013 ; 57 ;
2018.04.28.22.27.36 ; ABB700C92AB4 ; ch0000 ; odp0010 ; 20.64 ;
2018.04.28.22.27.40 ; ABB700C92A9E ; ch0000 ; odp0010 ; 20.92 ;
2018.04.28.22.28.01 ; ABB700C92AB0 ; ch0000 ; odp0007 ; 0.5 ;
2018.04.28.22.28.01 ; ABB2E9C81751 ; ch0000 ; odp0000 ; 62 ;
2018.04.28.22.28.01 ; ABB700C92AB0 ; ch0000 ; odp0000 ; 62 ;
2018.04.28.22.28.01 ; ABB700C92AB0 ; ch0000 ; odp0006 ; 21.5 ;
2018.04.28.22.28.04 ; ABB700C92AB0 ; ch0000 ; odp0007 ; 0 ;
2018.04.28.22.28.04 ; ABB2E9C81751 ; ch0000 ; odp0000 ; 36 ;
2018.04.28.22.28.04 ; ABB700C92AB0 ; ch0000 ; odp0000 ; 36 ;
2018.04.28.22.28.04 ; ABB700C92AB0 ; ch0000 ; odp0006 ; 21 ;
2018.04.28.22.28.04 ; ABB700C92AAD ; ch0000 ; odp0010 ; 20.98 ;
2018.04.28.22.28.07 ; ABB700C6DF1E ; ch0000 ; odp0000 ; 1 ;
2018.04.28.22.28.07 ; ABB700C6DF1E ; ch0006 ; odp0000 ; 1 ;
2018.04.28.22.28.07 ; ABB700C6DF1E ; ch0006 ; odp0001 ; 66 ;
2018.04.28.22.28.08 ; ABB700C6DF1E ; ch0000 ; odp0000 ; 0 ;
2018.04.28.22.28.08 ; ABB700C6DF1E ; ch0006 ; odp0000 ; 0 ;
2018.04.28.22.28.08 ; ABB700C6DF1E ; ch0006 ; odp0001 ; 0 ;
2018.04.28.22.28.08 ; ABB700C92AA3 ; ch0000 ; odp0010 ; 20.9 ;
2018.04.28.22.28.10 ; ABB700C6DF1E ; ch0003 ; odp0000 ; 0 ;
2018.04.28.22.28.11 ; ABB700C6DF1E ; ch0003 ; odp0000 ; 1 ;
2018.04.28.22.28.12 ; ABB700C6DF1E ; ch0003 ; odp0000 ; 0 ;
2018.04.28.22.28.27 ; ABB700C92AE5 ; ch0000 ; odp0010 ; 19.38 ;
2018.04.28.22.28.34 ; ABB700C92AAD ; ch0000 ; odp0000 ; 57 ;
2018.04.28.22.28.34 ; ABB2E9C81751 ; ch0008 ; odp0000 ; 57 ;
2018.04.28.22.28.38 ; ABB700C92AA3 ; ch0000 ; odp0000 ; 60 ;
2018.04.28.22.28.38 ; ABB2E9C81751 ; ch0007 ; odp0000 ; 60 ;
2018.04.28.22.28.40 ; ABB700C92A9E ; ch0000 ; odp0010 ; 20.94 ;
2018.04.28.22.28.42 ; ABB700C92A96 ; ch0000 ; odp0010 ; 18.64 ;
2018.04.28.22.28.51 ; ABB700C92AAD ; ch0000 ; odp0013 ; 57 ;
2018.04.28.22.28.57 ; ABB700C92A8D ; ch0000 ; odp0010 ; 22.84 ;
2018.04.28.22.29.10 ; ABB700C92A9E ; ch0000 ; odp0000 ; 99 ;
2018.04.28.22.29.11 ; ABB2E9C81751 ; ch0002 ; odp0000 ; 99 ;
2018.04.28.22.29.11 ; ABB700C92AA3 ; ch0000 ; odp0013 ; 60 ;
lassem commented 6 years ago

I might have misunderstood you earlier. If I click something in the official abb webui I now get events in /tmp/ from the addon. Here are some update events that includes window blinds.

2018.04.28.22.34.24 ; ABB700C98A9D ; ch0000 ; odp0002 ; 0 ;
2018.04.28.22.34.24 ; ABB25B712051 ; ch0000 ; odp0000 ; 2 ;
2018.04.28.22.34.24 ; ABB25B712051 ; ch0001 ; odp0000 ; 2 ;
2018.04.28.22.34.25 ; FFFF00000015 ; ch0000 ; odp0000 ; 2 ;
2018.04.28.22.34.25 ; FFFF0000001B ; ch0000 ; odp0000 ; 2 ;
2018.04.28.22.34.27 ; ABB700C92AE5 ; ch0000 ; odp0010 ; 19.36 ;
2018.04.28.22.34.35 ; ABB25B712051 ; ch0000 ; odp0000 ; 0 ;
2018.04.28.22.34.36 ; ABB25B712051 ; ch0000 ; odp0001 ; 0 ;
2018.04.28.22.34.36 ; ABB25B712051 ; ch0001 ; odp0000 ; 0 ;
2018.04.28.22.34.36 ; ABB25B712051 ; ch0001 ; odp0001 ; 0 ;
2018.04.28.22.34.37 ; FFFF00000015 ; ch0000 ; odp0000 ; 0 ;
2018.04.28.22.34.37 ; FFFF0000001B ; ch0000 ; odp0000 ; 1 ;
2018.04.28.22.34.37 ; FFFF00000015 ; ch0000 ; odp0001 ; 0 ;
2018.04.28.22.34.37 ; FFFF0000001B ; ch0000 ; odp0001 ; 33.3333 ;
2018.04.28.22.34.40 ; ABB700C92A9E ; ch0000 ; odp0010 ; 20.92 ;
2018.04.28.22.34.42 ; ABB700C92A96 ; ch0000 ; odp0010 ; 18.64 ;
2018.04.28.22.34.42 ; ABB700C92AE5 ; ch0000 ; odp0000 ; 99 ;
2018.04.28.22.34.43 ; ABB2E9C81751 ; ch000A ; odp0000 ; 99 ;
2018.04.28.22.34.55 ; ABB700C92A84 ; ch0000 ; odp0010 ; 19.47 ;
2018.04.28.22.34.57 ; ABB700C92A8D ; ch0000 ; odp0010 ; 22.78 ;
2018.04.28.22.35.09 ; ABB700C92AB0 ; ch0000 ; odp0000 ; 33 ;
2018.04.28.22.35.10 ; ABB2E9C81751 ; ch0000 ; odp0000 ; 33 ;
2018.04.28.22.35.19 ; ABB700C92AAD ; ch0000 ; odp0000 ; 61 ;
2018.04.28.22.35.19 ; ABB2E9C81751 ; ch0008 ; odp0000 ; 61 ;
2018.04.28.22.35.23 ; ABB700C92AA3 ; ch0000 ; odp0000 ; 67 ;
2018.04.28.22.35.23 ; ABB2E9C81751 ; ch0007 ; odp0000 ; 67 ;
2018.04.28.22.35.25 ; ABB700C92AB0 ; ch0000 ; odp0013 ; 33 ;
2018.04.28.22.35.27 ; ABB700C92AE5 ; ch0000 ; odp0010 ; 19.34 ;
2018.04.28.22.35.28 ; ABB700C92AE5 ; ch0000 ; odp0000 ; 100 ;
2018.04.28.22.35.28 ; ABB2E9C81751 ; ch000A ; odp0000 ; 100 ;
2018.04.28.22.35.40 ; ABB700C92A9E ; ch0000 ; odp0010 ; 20.88 ;
ruebox commented 6 years ago

These are great news.

Only information that are shown and actors that can be controlled in the webui can be utilized via openhab.

Pressing a switch as sensor does not invoke an update event, but the actor provides the events. At least within my setup.

If you provide me the device ID and semantics for some update events I could incorporate this within the code.

Do you get the raffstore percentage fed back to openhab

lassem commented 6 years ago

Free@Home doesn't seem to send continuous updates wrt. raffstore percentages.

Clicking a raffstore (ABB25B712051):

2018.04.29.09.36.54 ; ABB25B712051 ; ch0000 ; odp0000 ; 3 ;
2018.04.29.09.36.55 ; FFFF00000015 ; ch0000 ; odp0000 ; 3 ;
2018.04.29.09.36.55 ; FFFF0000001B ; ch0000 ; odp0000 ; 3 ;
2018.04.29.09.36.55 ; ABB700C92A84 ; ch0000 ; odp0010 ; 19.96 ;
2018.04.29.09.36.56 ; ABB700C92A8D ; ch0000 ; odp0010 ; 22.18 ;
2018.04.29.09.37.04 ; ABB700C92AAD ; ch0000 ; odp0010 ; 23.02 ;
2018.04.29.09.37.05 ; ABB25B712051 ; ch0000 ; odp0000 ; 1 ;
2018.04.29.09.37.05 ; ABB25B712051 ; ch0000 ; odp0001 ; 100 ;
2018.04.29.09.37.06 ; FFFF00000015 ; ch0000 ; odp0000 ; 1 ;
2018.04.29.09.37.06 ; FFFF0000001B ; ch0000 ; odp0000 ; 1 ;
2018.04.29.09.37.06 ; FFFF00000015 ; ch0000 ; odp0001 ; 33.3333 ;
2018.04.29.09.37.06 ; FFFF0000001B ; ch0000 ; odp0001 ; 50 ;
2018.04.29.09.37.07 ; ABB700C92A8D ; ch0000 ; odp0013 ; 87 ;
2018.04.29.09.37.08 ; ABB700C92AA3 ; ch0000 ; odp0010 ; 21.1 ;
lassem commented 6 years ago

My getall.xml contains some parameteres from this device:

                    <parameters>
                        <parameter i="pm0000">
                            <value>11</value>
                        </parameter>
                        <parameter i="pm0001">
                            <value>11</value>
                        </parameter>

pm0000 and pm0001 seems to be my calibrated time to open and time to close (or vice versa) I guess we could apply some heuristics to update the OpenHAB UI with continuous updates using this information if we wanted to. Of course, one would have to calibrate the raffscreens in order for this to work properly.

ruebox commented 6 years ago

@lassem: I merged your pull request to a separate branch for pretesting and improved logging d684476ca605152d2b55249c9f8fe79e46e70f2f

Did you get the update events also with my snapshot: org.openhab.binding.freeathome-2.0.0-SNAPSHOT.280418.jar.zip or only with your latest pull request code changes?

My raffstores only sent an update event when the state was changed. No continuous update events.

Does the thermostat sent an update event when you change the target temperature on the device itself?

ruebox commented 6 years ago

Please note that raffstore percentage is only working with oh 2.2 and not with 2.3-snapshot as the PercentageType was changed.

lassem commented 6 years ago

I only got it to work with my own changes.

lassem commented 6 years ago

Also, the raffstores does not send continuous update events (I think we would have to synthesize this using the pm0000 and pm0001 parameteres). The thermostats sends update events periodically and when setting the temperature on the device itself.

ruebox commented 6 years ago

So raffstore percentage update is working for you on oh 2.2?

Regarding thermostats - Current room temperature: I would assume from your update.csv that the current room temperature is sent via: 2018.04.28.22.34.27 ; ABB700C92AE5 ; ch0000 ; odp0010 ; 19.36 ;

while the target temperature set on the device is sent via: 2018.04.28.22.28.01 ; ABB700C92AB0 ; ch0000 ; odp0006 ; 21.5 ;

If this is correct, I would introduce this to the next snapshot including your pubsub changes.

What do you think?

lassem commented 6 years ago

Thermostats: your logic looks correct. Current room temperature via odp0010 and target temperature set via odp0006. Verified.

lassem commented 6 years ago
2018.05.01.10.25.43 ; ABB700C92AB0 ; ch0000 ; odp0007 ; 0.5 ;
2018.05.01.10.25.43 ; ABB700C92AB0 ; ch0000 ; odp0000 ; 100 ;
2018.05.01.10.25.43 ; ABB700C92AB0 ; ch0000 ; odp0006 ; 21.5 ;
2018.05.01.10.26.31 ; ABB700C92AB0 ; ch0000 ; odp0013 ; 100 ;
2018.05.01.10.26.53 ; ABB700C92AB0 ; ch0000 ; odp0010 ; 20.41 ;
2018.05.01.10.28.23 ; ABB700C92AB0 ; ch0000 ; odp0000 ; 99 ;

I wonder what odp0000 is; could it be actuator opening?

TheSpirit commented 6 years ago

just checked with the newest version and my window blinds. i see the percentage values within the update csv file if i move a blind via the webapp. but the value is not shown within openhab. am i missing something or is this still a bug?

2018.05.01.19.54.21 | ABB700C9CE93 | ch0003 | odp0001 | 38 2018.05.01.19.56.40 | ABB700C9CE93 | ch0000 | odp0002 | 1 2018.05.01.19.56.40 | ABB700C9CE93 | ch0003 | odp0000 | 3 2018.05.01.19.56.44 | ABB700C9CE93 | ch0000 | odp0003 | 0 2018.05.01.19.56.44 | ABB700C9CE93 | ch0003 | odp0000 | 1 2018.05.01.19.56.45 | ABB700C9CE93 | ch0003 | odp0001 | 59 2018.05.01.19.56.51 | ABB700C9CF0E | ch0000 | odp0002 | 0 2018.05.01.19.56.51 | ABB700C9CEA0 | ch0003 | odp0000 | 2

ch0003 and odp0001 is the percentage value of the blind

ruebox commented 6 years ago

With openhab 2.2, the percentage is working, but not with the recent openhab core developer version as the percentage type changed. Just about to fix it ...

TheSpirit commented 6 years ago

i used this version: org.openhab.binding.freeathome-2.0.0-SNAPSHOT.280418.jar.zip; and i use openhab version 2.2

TheSpirit commented 6 years ago

if i understand you, it should work. but maybe i am doing something wrong.

ruebox commented 6 years ago

yes with openhab core 2.2. with 2.3 snapshot not. Normally it only updates if the raffstore is stopped after some runtime. Not always, just let the raffstore running a while

ruebox commented 6 years ago

would be great if you can provide me the thermostat channels for:

ruebox commented 6 years ago

Please find attached a new testing snapshot with

Based on branch feature_update_events with commit: f9a0329554ab8f30baf7df69cc0c708f19b2d5ed org.openhab.binding.freeathome-2.0.0-SNAPSHOT-010518.jar.zip

lassem commented 6 years ago

Thermostat updates are working! So cool, the OH webui responds and shows target and current temperature. Activation and eco mode is not reflected. Here's a dump of me enabling and disabling eco mode a few times.

2018.05.01.21.08.20 ; ABB700C92AB0 ; ch0000 ; odp0009 ; 68 ;
2018.05.01.21.08.20 ; ABB700C92AB0 ; ch0000 ; odp0006 ; 17.5 ;
2018.05.01.21.09.04 ; ABB700C92AB0 ; ch0000 ; odp0009 ; 65 ;
2018.05.01.21.09.04 ; ABB700C92AB0 ; ch0000 ; odp0006 ; 20.5 ;
2018.05.01.21.09.18 ; ABB700C92AB0 ; ch0000 ; odp0006 ; 17.5 ;
2018.05.01.21.09.18 ; ABB700C92AB0 ; ch0000 ; odp0009 ; 68 ;

And here I am turning it on and off

2018.05.01.21.11.24 ; ABB700C92AB0 ; ch0000 ; odp0009 ; 65 ;
2018.05.01.21.11.25 ; ABB700C92AB0 ; ch0000 ; odp0006 ; 20.5 ;
2018.05.01.21.11.33 ; ABB700C92AB0 ; ch0000 ; odp0008 ; 0 ;
2018.05.01.21.11.33 ; ABB700C92AB0 ; ch0000 ; odp0006 ; 7 ;
2018.05.01.21.11.38 ; ABB700C92AB0 ; ch0000 ; odp0008 ; 1 ;
2018.05.01.21.11.38 ; ABB700C92AB0 ; ch0000 ; odp0006 ; 20.5 ;

In other words 2018.05.01.21.09.18 ; ABB700C92AB0 ; ch0000 ; odp0009 ; 68 ; = ECO MODE ENABLED 2018.05.01.21.11.24 ; ABB700C92AB0 ; ch0000 ; odp0009 ; 65 ; = ECO MODE DISABLED

lassem commented 6 years ago
2018.05.01.21.18.49 ; ABB700C92AB0 ; ch0000 ; odp0008 ; 0 ;
2018.05.01.21.18.49 ; ABB700C92AB0 ; ch0000 ; odp0006 ; 7 ;
= DEVICE OFF

2018.05.01.21.19.21 ; ABB700C92AB0 ; ch0000 ; odp0008 ; 1 ;
2018.05.01.21.19.21 ; ABB700C92AB0 ; ch0000 ; odp0006 ; 20.5 ;
= DEVICE ON
lassem commented 6 years ago

Come to think of it; this should probably go into a wiki page...

lassem commented 6 years ago

Update events for a dimmer when going from ~100% to ~0% (OH UI not updating) Operated from the physical switch.

2018.05.01.21.21.25 ; ABB700C6DF1E ; ch0000 ; odp0001 ; 1 ;
2018.05.01.21.21.25 ; ABB700C6DF1E ; ch0006 ; odp0001 ; 94 ;
2018.05.01.21.21.25 ; ABB700C6DF1E ; ch0006 ; odp0001 ; 86 ;
2018.05.01.21.21.26 ; ABB700C6DF1E ; ch0006 ; odp0001 ; 78 ;
2018.05.01.21.21.26 ; ABB700C6DF1E ; ch0006 ; odp0001 ; 71 ;
2018.05.01.21.21.26 ; ABB700C6DF1E ; ch0006 ; odp0001 ; 63 ;
2018.05.01.21.21.27 ; ABB700C6DF1E ; ch0006 ; odp0001 ; 55 ;
2018.05.01.21.21.27 ; ABB700C6DF1E ; ch0006 ; odp0001 ; 47 ;
2018.05.01.21.21.28 ; ABB700C6DF1E ; ch0006 ; odp0001 ; 39 ;
2018.05.01.21.21.28 ; ABB700C6DF1E ; ch0006 ; odp0001 ; 31 ;
2018.05.01.21.21.28 ; ABB700C6DF1E ; ch0006 ; odp0001 ; 24 ;
2018.05.01.21.21.29 ; ABB700C6DF1E ; ch0006 ; odp0001 ; 16 ;
2018.05.01.21.21.29 ; ABB700C6DF1E ; ch0006 ; odp0001 ; 8 ;
2018.05.01.21.21.30 ; ABB700C6DF1E ; ch0006 ; odp0001 ; 1 ;
2018.05.01.21.21.32 ; ABB700C6DF1E ; ch0000 ; odp0001 ; 0 ;