souliss / bindingopenhab

Binding to connect your Souliss Network to openHAB
10 stars 6 forks source link

T18 <-> OpenHab interaction problem or explanation needed #13

Closed marcolino7 closed 8 years ago

marcolino7 commented 8 years ago

I Open this issue, reporting a post from Maciej Łomozik in english ML. I have same behaviour on my system.

This is my first "problem/question" post so once again Hi to everyone and I hope my problem description is good and understandable :)

I'm using T18 with openhab in this configuration

souliss: [...] DigIn2State(AC_IN, Souliss_T1n_OffFeedback, Souliss_T1n_OnFeedback, REM_PULSE); // AC_IN is input pin for sensing state of the relay which can be operated externally (for souliss) Logic_T18(REM_PULSE); LowDigOut(RELAY_PULSE,Souliss_T1n_OnCoil,REM_PULSE); [...]

FAST_x10ms(10) { Timer_StepRelay(REM_PULSE); }

openHAB: sitemap:
[...] Switch item=cykus_garaz mappings=[ON="ON", OFF="OFF"] [...]

item: [...] Switch cykus_garaz "W garazu" {souliss="T18:0:2", autoupdate="false"} [...]

That works like charm with SoulissApp (android). In OpenHAB T18 doesn't work with 1.7.1 binding from stable release. I've switch to souliss_1.7.0.20151027212 and it recognized T18 but the ON/OFF state was not updated. So I've changed this mapping in propertis/states_SOULISStoOH.properties file to:

Typical 18 : N/OFF Digital Output with pulse output with Timer Option

SwitchItem_0x18_0x24=OFF SwitchItem_0x18_0xA1=ON SwitchItem_0x18_0x23=ON and now it works like SoulissApp: state is updated and relay is pulsing on command. So far so good. But I've noticed in OH log:

Received HTTP POST request at 'items/cykus_garaz' with value 'ON'. 18:22:56.834 [INFO ] [.o.b.s.internal.SoulissBinding:142 ] - receiveCommand - cykus_garaz = ON - Typical: 0x18 18:22:56.834 [DEBUG] [.s.i.n.typicals.StateTraslator:68 ] - translate commands: ON -> 0x02 18:22:56.835 [DEBUG] [.o.b.s.i.n.udp.SoulissCommGate:90 ] - sendFORCEFrame - HEX: [33 00 00 00 03 00 00 02 ], soulissNodeIPAddressOnLAN: 192.168.1.151 18:22:56.836 [DEBUG] [s.i.network.udp.SendDispatcher:64 ] - Push 18:22:56.838 [DEBUG] [s.i.network.udp.SendDispatcher:143 ] - Add frame: HEX: [0F 0E 17 97 00 01 01 33 00 00 00 03 00 00 02 ] 18:22:56.881 [DEBUG] [s.i.network.udp.SendDispatcher:217 ] - POP: 1 packets in memory 18:22:56.881 [DEBUG] [s.i.network.udp.SendDispatcher:228 ] - POP: 1 force frame sent 18:22:56.882 [DEBUG] [s.i.network.udp.SendDispatcher:232 ] - Pop frame HEX: [0F 0E 17 97 00 01 01 33 00 00 00 03 00 00 02 ] - Delay for 'SendDispatcherThread' setted to 100 mills. 18:22:56.883 [DEBUG] [s.i.network.udp.SendDispatcher:257 ] - SendDispatcherThread - Functional Code 0x33 - Packet: HEX: [0F 0E 17 97 00 01 01 33 00 00 00 03 00 00 02 ] - Elementi rimanenti in lis ta: 1 18:22:56.884 [DEBUG] [s.i.network.udp.SendDispatcher:327 ] - Compare. Node: 0 Slot: 2 Typical: 18 Command: 0x02 EXPECTED: 0x01 - IN MEMORY: 0x36

[repeated many times] Packet Execution timeout - Requeued

so I looked at the file properties/commands_to_states.properties and there was no entry for T18 so I added

Typical 18

0x18_0x02=0x23 0x18_0x04=0x24

and now this works the same (OK) but the only change in log is : Compare. Node: 0 Slot: 2 Typical: 18 Command: 0x02 EXPECTED: 0x23 - IN MEMORY: 0x35

So can someone explain,please what this "compare" mechanism is and what EXPECTED value is ??

maciek

marcolino7 commented 8 years ago

Original ML Post: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/souliss/AmbC7OMYuEA

fazioa commented 8 years ago

Bugfixed. Can you test it? https://drive.google.com/open?id=0BzYvfLL0ppGAZWlKRjJzNEplRDQ