New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Zibase] Update and bug corrections #4116

Open
wants to merge 12 commits into
base: master
from

Conversation

Projects
None yet
5 participants
@jit06
Contributor

jit06 commented Feb 28, 2016

Corrected some bugs :

  • handle case where zibase does not respond => j-zapi return null
  • handle case where jzapi return null for receiver value

Updated:

  • added support for chacon emiter (id like H8, I12, etc.)
  • added debug log entry when item ID is null
  • changed jzapi 0.0.5 by 0.0.6

@teichsta teichsta added the bug label Mar 6, 2016

@teichsta

This comment has been minimized.

Show comment
Hide comment
@teichsta

teichsta Mar 6, 2016

Member

Hi @jit06 thanks for your contribution. Please find my review comment inline. Please also squash your commits into one, once you are finished … would you consider this fix as relevant for 1.8?

Member

teichsta commented Mar 6, 2016

Hi @jit06 thanks for your contribution. Please find my review comment inline. Please also squash your commits into one, once you are finished … would you consider this fix as relevant for 1.8?

@jit06

This comment has been minimized.

Show comment
Hide comment
@jit06

jit06 Mar 7, 2016

Contributor

Hi @teichsta ! thank you for your comments.
Short version: the new version of the binding could be relevant for 1.8 as it brings little more stability, but I may not have the time to do it quickly.

Long version : I have problem with my eclipse env which is does not work anymore since I updated the whole repository... so it's not very easy to change-test-merge as I'm doing it tests and compilation throught maven only. I tried to reinstall, with both old version and new version of the guide, with no success.... and I have very few time to spend on installing a dev env for now ;)

Contributor

jit06 commented Mar 7, 2016

Hi @teichsta ! thank you for your comments.
Short version: the new version of the binding could be relevant for 1.8 as it brings little more stability, but I may not have the time to do it quickly.

Long version : I have problem with my eclipse env which is does not work anymore since I updated the whole repository... so it's not very easy to change-test-merge as I'm doing it tests and compilation throught maven only. I tried to reinstall, with both old version and new version of the guide, with no success.... and I have very few time to spend on installing a dev env for now ;)

@jit06

This comment has been minimized.

Show comment
Hide comment
@jit06

jit06 Mar 8, 2016

Contributor

Hi @teichsta , I added a question following my last comment. Could you tell me your thoughts ?

Contributor

jit06 commented Mar 8, 2016

Hi @teichsta , I added a question following my last comment. Could you tell me your thoughts ?

@BEJP

This comment has been minimized.

Show comment
Hide comment
@BEJP

BEJP Mar 10, 2016

Hi All,

I'm testing the Zibase binding and I was wondering if this binding has been tested with Z-Wave devices connected to the zibase.
I have issues with the state of Z-wave receivers (it works ok with Chacon).
If I set a device to ON, it will stay ON, but internally the state will be back to OFF. I think the problem comes from the fact that the ID in the events are like "ZA8_ON" and not A8_ON. I tried some hacks in the code to remove the Z before processing, and it seems to help to avoid that the function 'extractIdFromZbResponse(string)' returns null:

protected String extractIdFromZbResponse(String zbResponseStr) {
if (zbResponseStr.contains(": Z")) {
zbResponseStr = zbResponseStr.replace(": Z", ": ");
}

But with that change, it seems that when it goes further, the internal state stays on OFF. (And the light is ON). Any ideas about what could be wrong ?

Also, I don't understand how the polling of sensors.xml is called.
Is this parameter really used by some thread ?

The refresh interval in ms for sensors.xml reading (optional, defaults to 60000)
zibase:refresh=15000

Thank you in advance !

BEJP commented Mar 10, 2016

Hi All,

I'm testing the Zibase binding and I was wondering if this binding has been tested with Z-Wave devices connected to the zibase.
I have issues with the state of Z-wave receivers (it works ok with Chacon).
If I set a device to ON, it will stay ON, but internally the state will be back to OFF. I think the problem comes from the fact that the ID in the events are like "ZA8_ON" and not A8_ON. I tried some hacks in the code to remove the Z before processing, and it seems to help to avoid that the function 'extractIdFromZbResponse(string)' returns null:

protected String extractIdFromZbResponse(String zbResponseStr) {
if (zbResponseStr.contains(": Z")) {
zbResponseStr = zbResponseStr.replace(": Z", ": ");
}

But with that change, it seems that when it goes further, the internal state stays on OFF. (And the light is ON). Any ideas about what could be wrong ?

Also, I don't understand how the polling of sensors.xml is called.
Is this parameter really used by some thread ?

The refresh interval in ms for sensors.xml reading (optional, defaults to 60000)
zibase:refresh=15000

Thank you in advance !

@jit06

This comment has been minimized.

Show comment
Hide comment
@jit06

jit06 Mar 10, 2016

Contributor

Hi @BEJP ,

you're right, I don't have any zwave device to test. Nevertheless I think I've found the problem.
Could you try this version of the binding : http://jsbricks.bluemind.org/org.openhab.binding.zibase-1.9.0-SNAPSHOT.jar

Tell me if it works, so I could push the correction to the main repository.

Regarding sensors.xml polling, it is not yet implemented.

Contributor

jit06 commented Mar 10, 2016

Hi @BEJP ,

you're right, I don't have any zwave device to test. Nevertheless I think I've found the problem.
Could you try this version of the binding : http://jsbricks.bluemind.org/org.openhab.binding.zibase-1.9.0-SNAPSHOT.jar

Tell me if it works, so I could push the correction to the main repository.

Regarding sensors.xml polling, it is not yet implemented.

@BEJP

This comment has been minimized.

Show comment
Hide comment
@BEJP

BEJP Mar 10, 2016

Hi @jit06,
Thank you for the quick feedback. I tested but it doesn't seem to work.
Here is an example of zibase message to help:
--> Sent radio(1 Burst(s), Protocols='ZWave n9'): ZA10_ON
I can try to debug if you tell me about your changes.
Without sending an off command, it goes back to the off state (and stays ON in reality).

BEJP commented Mar 10, 2016

Hi @jit06,
Thank you for the quick feedback. I tested but it doesn't seem to work.
Here is an example of zibase message to help:
--> Sent radio(1 Burst(s), Protocols='ZWave n9'): ZA10_ON
I can try to debug if you tell me about your changes.
Without sending an off command, it goes back to the off state (and stays ON in reality).

@jit06

This comment has been minimized.

Show comment
Hide comment
@jit06

jit06 Mar 10, 2016

Contributor

@BEJP, id are extracted from zibase log using regexp defined in ZibaseListener
class.

There are 4 regexp to extract IDs from differents type of log the zibase can
send.

the best way to understand is to launch openhab in debug mod and check the
log. Can you send me that plus a example of how you define items in your .items
file ?

Also, I compiled another version, with the exact same link, could you try this
new version (I updated another regexp following the log entry you sent me) ?

Contributor

jit06 commented Mar 10, 2016

@BEJP, id are extracted from zibase log using regexp defined in ZibaseListener
class.

There are 4 regexp to extract IDs from differents type of log the zibase can
send.

the best way to understand is to launch openhab in debug mod and check the
log. Can you send me that plus a example of how you define items in your .items
file ?

Also, I compiled another version, with the exact same link, could you try this
new version (I updated another regexp following the log entry you sent me) ?

@jit06

This comment has been minimized.

Show comment
Hide comment
@jit06

jit06 Mar 16, 2016

Contributor

@BEJP : any news on your side ? can I commit changes ?

@teichsta: did you see my lastest comment regarding the item cache ?

Contributor

jit06 commented Mar 16, 2016

@BEJP : any news on your side ? can I commit changes ?

@teichsta: did you see my lastest comment regarding the item cache ?

@BEJP

This comment has been minimized.

Show comment
Hide comment
@BEJP

BEJP Mar 17, 2016

Hi @jit06,
Sorry for the delay. I've been busy with other stuff.

It works better, but it is not yet very usable because the state is not correctly maintained.
If I send commands with 'real' switches, or with another application (like the official Zodianet), it do not update the state. I'm wondering if it is not because the state is read immediately after the command is sent. And Z-wave has a feedback, so I guess it waits the ack to update the state.But when you read it, it is not yet ok.
Also, the initial state of the values is not correct, if a light is on, it is shown as off. And the 'toggle' makes it difficult to manage.

I attached a debug log after a clean start, in which some commands are external to OpenHab. (Like the first 2 ones)
logZibase.txt

Here is how I declare some Z-wave devices and one chacon:

Group:Switch:OR(ON, OFF) Lights "All Lights [(%d)]" (All)
Switch Light_Floor_Entrance "Entree Rez" (Lights) {zibase="RCV,A10,ZWAVE"}
Switch Light_Etage_Hall "Hall Etage" (Lights) { zibase="RCV,O11,ZWAVE" }
Switch Light_Chambre_1 "Chambre 2" (Lights) { zibase="RCV,A8,ZWAVE" }
Switch Light_Grenier "Grenier" (Lights) { zibase="RCV,O12,ZWAVE" }
Switch Light_Escalier_Grenier "Escalier Grenier" (Lights) { zibase="RCV,A11,ZWAVE" }
Switch Light_LED_TV "Au dessus TV" (Lights) { zibase="RCV,C2,CHACON" }

As you can see we declare it with 'A10', but it is in fact ZA10 in the listener.
With Chacon, C2 stays C2.

I hope this can help to understand the issue.
Thank you very much for your help.

BEJP commented Mar 17, 2016

Hi @jit06,
Sorry for the delay. I've been busy with other stuff.

It works better, but it is not yet very usable because the state is not correctly maintained.
If I send commands with 'real' switches, or with another application (like the official Zodianet), it do not update the state. I'm wondering if it is not because the state is read immediately after the command is sent. And Z-wave has a feedback, so I guess it waits the ack to update the state.But when you read it, it is not yet ok.
Also, the initial state of the values is not correct, if a light is on, it is shown as off. And the 'toggle' makes it difficult to manage.

I attached a debug log after a clean start, in which some commands are external to OpenHab. (Like the first 2 ones)
logZibase.txt

Here is how I declare some Z-wave devices and one chacon:

Group:Switch:OR(ON, OFF) Lights "All Lights [(%d)]" (All)
Switch Light_Floor_Entrance "Entree Rez" (Lights) {zibase="RCV,A10,ZWAVE"}
Switch Light_Etage_Hall "Hall Etage" (Lights) { zibase="RCV,O11,ZWAVE" }
Switch Light_Chambre_1 "Chambre 2" (Lights) { zibase="RCV,A8,ZWAVE" }
Switch Light_Grenier "Grenier" (Lights) { zibase="RCV,O12,ZWAVE" }
Switch Light_Escalier_Grenier "Escalier Grenier" (Lights) { zibase="RCV,A11,ZWAVE" }
Switch Light_LED_TV "Au dessus TV" (Lights) { zibase="RCV,C2,CHACON" }

As you can see we declare it with 'A10', but it is in fact ZA10 in the listener.
With Chacon, C2 stays C2.

I hope this can help to understand the issue.
Thank you very much for your help.

@jit06

This comment has been minimized.

Show comment
Hide comment
@jit06

jit06 Mar 17, 2016

Contributor

@BEJP , with the lastest version I compiled (7 days ago), you should use the true id for your item.

e.g: you should now use :
Switch Light_Floor_Entrance "Entree Rez" (Lights) {zibase="RCV,ZA10,ZWAVE"}
instead of
Switch Light_Floor_Entrance "Entree Rez" (Lights) {zibase="RCV,A10,ZWAVE"}

Events are read from zibase log, so if any of your action is logged by Zibase, Openhab item will reflect it.

As for initial state, you are right, it's still a todo and will be done with the support of sensors.xml (reading it durint the binding start should do the trick)

Contributor

jit06 commented Mar 17, 2016

@BEJP , with the lastest version I compiled (7 days ago), you should use the true id for your item.

e.g: you should now use :
Switch Light_Floor_Entrance "Entree Rez" (Lights) {zibase="RCV,ZA10,ZWAVE"}
instead of
Switch Light_Floor_Entrance "Entree Rez" (Lights) {zibase="RCV,A10,ZWAVE"}

Events are read from zibase log, so if any of your action is logged by Zibase, Openhab item will reflect it.

As for initial state, you are right, it's still a todo and will be done with the support of sensors.xml (reading it durint the binding start should do the trick)

@BEJP

This comment has been minimized.

Show comment
Hide comment
@BEJP

BEJP Mar 18, 2016

Thank you for the feedback @jit06.
I did try again using the 'Z'? But it generates exceptions. Here is the log :
ZibaseLog2.txt

Here is the item declaration :
Group:Switch:OR(ON, OFF) Lights "All Lights [(%d)]" (All)

Switch Light_Floor_Entrance "Entree Rez" (Lights) {zibase="RCV,ZA10,ZWAVE"}
Switch Light_Etage_Hall "Hall Etage" (Lights) { zibase="RCV,ZO11,ZWAVE" }
Switch Light_Chambre_1 "Chambre 2" (Lights) { zibase="RCV,ZA8,ZWAVE" }
Switch Light_Grenier "Grenier" (Lights) { zibase="RCV,ZO12,ZWAVE" }
Switch Light_Escalier_Grenier "Escalier Grenier" (Lights) { zibase="RCV,ZA11,ZWAVE" }

Switch Light_LED_TV "Au dessus TV" (Lights) { zibase="RCV,C2,CHACON" }

BEJP commented Mar 18, 2016

Thank you for the feedback @jit06.
I did try again using the 'Z'? But it generates exceptions. Here is the log :
ZibaseLog2.txt

Here is the item declaration :
Group:Switch:OR(ON, OFF) Lights "All Lights [(%d)]" (All)

Switch Light_Floor_Entrance "Entree Rez" (Lights) {zibase="RCV,ZA10,ZWAVE"}
Switch Light_Etage_Hall "Hall Etage" (Lights) { zibase="RCV,ZO11,ZWAVE" }
Switch Light_Chambre_1 "Chambre 2" (Lights) { zibase="RCV,ZA8,ZWAVE" }
Switch Light_Grenier "Grenier" (Lights) { zibase="RCV,ZO12,ZWAVE" }
Switch Light_Escalier_Grenier "Escalier Grenier" (Lights) { zibase="RCV,ZA11,ZWAVE" }

Switch Light_LED_TV "Au dessus TV" (Lights) { zibase="RCV,C2,CHACON" }

@jit06

This comment has been minimized.

Show comment
Hide comment
@jit06

jit06 Mar 20, 2016

Contributor

@BEJP I changed the regexp that find IDs to make it more generic. It should now work correctly with things like A12, H8, ZA5, WZA5, etc.

I also find out that getting state of Zwave items was not supported by Jzapi. I compiled a custom modified version to correct this problem.

Finally, I compiled a new version of the binding (same link as above) for you to try.
Could test it and give me the same king of information and log file ?

Contributor

jit06 commented Mar 20, 2016

@BEJP I changed the regexp that find IDs to make it more generic. It should now work correctly with things like A12, H8, ZA5, WZA5, etc.

I also find out that getting state of Zwave items was not supported by Jzapi. I compiled a custom modified version to correct this problem.

Finally, I compiled a new version of the binding (same link as above) for you to try.
Could test it and give me the same king of information and log file ?

@BEJP

This comment has been minimized.

Show comment
Hide comment
@BEJP

BEJP Mar 21, 2016

Hi @jit06. This is good news!
Unfortunately, I just tried and the function getOpenhabStateFromZibaseValue generates exceptions.
Here is the log. It should not be easy for you to debug Z-wave. How could I help?
zibaseLog20160321.txt

BEJP commented Mar 21, 2016

Hi @jit06. This is good news!
Unfortunately, I just tried and the function getOpenhabStateFromZibaseValue generates exceptions.
Here is the log. It should not be easy for you to debug Z-wave. How could I help?
zibaseLog20160321.txt

@jit06

This comment has been minimized.

Show comment
Hide comment
@jit06

jit06 Mar 21, 2016

Contributor

@BEJP thanks for testing ;)
well in fact your log shown that the zwave item has not been detected as such, so the change I've made has not been executed. I may wrote an bad test on ZibaseBindingConfigReceiver.getOpenhabStateFromZibaseValue()

I juste recompiled another version on which only zwave should work (I by passed the test) and I also added a debug message to print the protocol.

I think that the best way to help for now is to test like you do and send me the log. You may try to check / log some other things if you want. The main error is due to jzapi library that crash if the we query state for a Zwave item without setting a specific value in the UDP request... but as I wrote previously, my test did not passed, so the modification I made have been tested yet ;)

Could you try again the new version I juste compiled (same link) ?

Contributor

jit06 commented Mar 21, 2016

@BEJP thanks for testing ;)
well in fact your log shown that the zwave item has not been detected as such, so the change I've made has not been executed. I may wrote an bad test on ZibaseBindingConfigReceiver.getOpenhabStateFromZibaseValue()

I juste recompiled another version on which only zwave should work (I by passed the test) and I also added a debug message to print the protocol.

I think that the best way to help for now is to test like you do and send me the log. You may try to check / log some other things if you want. The main error is due to jzapi library that crash if the we query state for a Zwave item without setting a specific value in the UDP request... but as I wrote previously, my test did not passed, so the modification I made have been tested yet ;)

Could you try again the new version I juste compiled (same link) ?

@BEJP

This comment has been minimized.

Show comment
Hide comment
@BEJP

BEJP Mar 23, 2016

Hello @jit06,
Here is the new log with the updated jar:
zibaseLog20160323.txt

The state doesn't seem to be retrieved --> exception
I sent once ON OFF command with another app.
Than, once ON OFF with OpenHab UI

BEJP commented Mar 23, 2016

Hello @jit06,
Here is the new log with the updated jar:
zibaseLog20160323.txt

The state doesn't seem to be retrieved --> exception
I sent once ON OFF command with another app.
Than, once ON OFF with OpenHab UI

@jit06

This comment has been minimized.

Show comment
Hide comment
@jit06

jit06 Mar 23, 2016

Contributor

Thanks again for testing @BEJP, patience is a definitely a good virtue ;)

You may not have noticed, but we have made some progress right now. The binding seems now safe for Zwave item detection and ID handling.

I think that the last problem is in jzapi : zwave item must be used without the "z" letter in the ID (and of course, it is not documented). So to get State for, e.g, ZA10, we must use A10 in addition to the modification I made on JZapi.

I, again, compiled another version with such ID modification when Zwave is detected. Can you please test again the same thing ?

Contributor

jit06 commented Mar 23, 2016

Thanks again for testing @BEJP, patience is a definitely a good virtue ;)

You may not have noticed, but we have made some progress right now. The binding seems now safe for Zwave item detection and ID handling.

I think that the last problem is in jzapi : zwave item must be used without the "z" letter in the ID (and of course, it is not documented). So to get State for, e.g, ZA10, we must use A10 in addition to the modification I made on JZapi.

I, again, compiled another version with such ID modification when Zwave is detected. Can you please test again the same thing ?

@BEJP

This comment has been minimized.

Show comment
Hide comment
@BEJP

BEJP Mar 24, 2016

Hi @jit06,
This is working much better ! The states are correctly updated in real time when using another app to control it.
Unfortunately, if I use the OpenHab interface, when I set something ON for instance, it does not power ON, and the state go back immediately to off.
Here is the log :
zibaseLog20160324.txt

BEJP commented Mar 24, 2016

Hi @jit06,
This is working much better ! The states are correctly updated in real time when using another app to control it.
Unfortunately, if I use the OpenHab interface, when I set something ON for instance, it does not power ON, and the state go back immediately to off.
Here is the log :
zibaseLog20160324.txt

@jit06

This comment has been minimized.

Show comment
Hide comment
@jit06

jit06 Mar 25, 2016

Contributor

Hello @BEJP

good news !

I think there is the same problem as getState() with sendCommand() : zibase is waiting for the "x10 version" of the item ID instead of the full Zwave Id (eg: A10 instead of ZA10).

I modified the sendCommand() method to reflect this. I also clean up a bit the code, hope I did not inject new silly bugs for ZWave ;)

I compiled a new version, could you try it and tell me if it works ? I also saw that you have Chacon items, could you confirm that theses items still work ?

Contributor

jit06 commented Mar 25, 2016

Hello @BEJP

good news !

I think there is the same problem as getState() with sendCommand() : zibase is waiting for the "x10 version" of the item ID instead of the full Zwave Id (eg: A10 instead of ZA10).

I modified the sendCommand() method to reflect this. I also clean up a bit the code, hope I did not inject new silly bugs for ZWave ;)

I compiled a new version, could you try it and tell me if it works ? I also saw that you have Chacon items, could you confirm that theses items still work ?

@BEJP

This comment has been minimized.

Show comment
Hide comment
@BEJP

BEJP Mar 30, 2016

Hello @jit06,

Sorry for the delay, I was out of my home for some days.
It seems it doesn't work anymore, the states are not retrieved ... and I cannot send command with OpenHab. Here is the log.
zibaseLog20160330.txt

Also I think it would be good to detect if the Zibase is not binding succesfully. My Zibase had another ip after a reboot and I missed that the first time of the debug.

Best regards,
JP

BEJP commented Mar 30, 2016

Hello @jit06,

Sorry for the delay, I was out of my home for some days.
It seems it doesn't work anymore, the states are not retrieved ... and I cannot send command with OpenHab. Here is the log.
zibaseLog20160330.txt

Also I think it would be good to detect if the Zibase is not binding succesfully. My Zibase had another ip after a reboot and I missed that the first time of the debug.

Best regards,
JP

@jit06

This comment has been minimized.

Show comment
Hide comment
@jit06

jit06 Mar 31, 2016

Contributor

hi @BEJP ,

no problem with the delay I was out of my home too.

I think I found the problem and I compiled a new version (same link as previously).

Regarding the Zibase IP / bad connection, there is already messages if the zibase is not found : "Zibase listener thread launched with no associated zibase and/or eventPublisher !"... maybe should I change it by "Zibase no initialised, maybe the IP adress is wrong or empty" ?

Contributor

jit06 commented Mar 31, 2016

hi @BEJP ,

no problem with the delay I was out of my home too.

I think I found the problem and I compiled a new version (same link as previously).

Regarding the Zibase IP / bad connection, there is already messages if the zibase is not found : "Zibase listener thread launched with no associated zibase and/or eventPublisher !"... maybe should I change it by "Zibase no initialised, maybe the IP adress is wrong or empty" ?

@BEJP

This comment has been minimized.

Show comment
Hide comment
@BEJP

BEJP Mar 31, 2016

Hi @jit06,
Thank you for the updated. But, it seems to be the same behavior. Here is the log:
zibaseLog20160331.txt

I missed the message about the association. Maybe adding the 'wrong ip' message would be better.

(Just for information I'm running OpenHab on a Synology NAS and updated yesterday to DSM 6.0. I had to reinstall Openhab and upgrade to 1.8.2. with OpenHAB-1.8.2-DSM6-RC-syno-noarch-0.001.spk this from https://github.com/openhab/openhab-syno-spk/releases )

BEJP commented Mar 31, 2016

Hi @jit06,
Thank you for the updated. But, it seems to be the same behavior. Here is the log:
zibaseLog20160331.txt

I missed the message about the association. Maybe adding the 'wrong ip' message would be better.

(Just for information I'm running OpenHab on a Synology NAS and updated yesterday to DSM 6.0. I had to reinstall Openhab and upgrade to 1.8.2. with OpenHAB-1.8.2-DSM6-RC-syno-noarch-0.001.spk this from https://github.com/openhab/openhab-syno-spk/releases )

@jit06

This comment has been minimized.

Show comment
Hide comment
@jit06

jit06 Mar 31, 2016

Contributor

ok @BEJP , I compiled a new version with more debug log. It's probably a very silly bug.

I also changed the message when zibase is not found.

Contributor

jit06 commented Mar 31, 2016

ok @BEJP , I compiled a new version with more debug log. It's probably a very silly bug.

I also changed the message when zibase is not found.

@BEJP

This comment has been minimized.

Show comment
Hide comment
@BEJP

BEJP Apr 1, 2016

Here is the new log file with your updated jar:
zibaseLog20160401.txt

BEJP commented Apr 1, 2016

Here is the new log file with your updated jar:
zibaseLog20160401.txt

@jit06

This comment has been minimized.

Show comment
Hide comment
@jit06

jit06 Apr 1, 2016

Contributor

thank you @BEJP : my bad, I was using "==" to test string value instead of "equals()"... silly bug !

I compiled a new version, hope it will work correctly this time. If it works correctly, the log file should read "x10id=A10" for zwave item "ZA10" (Z should be removed).

Contributor

jit06 commented Apr 1, 2016

thank you @BEJP : my bad, I was using "==" to test string value instead of "equals()"... silly bug !

I compiled a new version, hope it will work correctly this time. If it works correctly, the log file should read "x10id=A10" for zwave item "ZA10" (Z should be removed).

@BEJP

This comment has been minimized.

Show comment
Hide comment
@BEJP

BEJP Apr 2, 2016

Hi @jit06. Congratulations, you found it, everything looks ok !!!
Here is the log :
zibaseLog20160402.txt

I also tested to keep some lights On and restart openhab and after the refresh, the state is correctly initialized.

This is really good news, thank you for your work !

BEJP commented Apr 2, 2016

Hi @jit06. Congratulations, you found it, everything looks ok !!!
Here is the log :
zibaseLog20160402.txt

I also tested to keep some lights On and restart openhab and after the refresh, the state is correctly initialized.

This is really good news, thank you for your work !

@jit06

This comment has been minimized.

Show comment
Hide comment
@jit06

jit06 Apr 2, 2016

Contributor

hello @BEJP , good news !
Thank you for your help, I can now update the pull request

@teichsta : let me know if you need me to do more corrections.

Contributor

jit06 commented Apr 2, 2016

hello @BEJP , good news !
Thank you for your help, I can now update the pull request

@teichsta : let me know if you need me to do more corrections.

@9037568

Just some minor fixes and I think this will be good to merge. Please make sure to run the eclipse formatter over the source...

// Zibase may not yet be ready, or may be disconnected
if(zibase == null) return;
logger.debug("START Zibase items refresh (interval: " + refreshInterval + ")");

This comment has been minimized.

@9037568

9037568 Nov 25, 2016

Contributor

Use parameterized logging instead of string concatenation.

@9037568

9037568 Nov 25, 2016

Contributor

Use parameterized logging instead of string concatenation.

if (config.getClass() == ZibaseBindingConfigReceiver.class ||
config.getClass() == ZibaseBindingConfigVariable.class) {
logger.debug(" trying to get zibase value for ID : " + config.getId());

This comment has been minimized.

@9037568

9037568 Nov 25, 2016

Contributor

Use parameterized logging instead of string concatenation.

@9037568

9037568 Nov 25, 2016

Contributor

Use parameterized logging instead of string concatenation.

eventPublisher.postUpdate(bindingProvider.getItemNamesById(config.getId()).firstElement(), state);
if(state != null) {
logger.debug(" got value : " + state);

This comment has been minimized.

@9037568

9037568 Nov 25, 2016

Contributor

Use parameterized logging instead of string concatenation.

@9037568

9037568 Nov 25, 2016

Contributor

Use parameterized logging instead of string concatenation.

logger.debug(" got value : " + state);
eventPublisher.postUpdate(bindingProvider.getItemNamesById(config.getId()).firstElement(), state);
} else {
logger.info(" got null value from zibase for ID: " + config.getId());

This comment has been minimized.

@9037568

9037568 Nov 25, 2016

Contributor

Use parameterized logging instead of string concatenation.

@9037568

9037568 Nov 25, 2016

Contributor

Use parameterized logging instead of string concatenation.

@@ -152,6 +152,7 @@ static public ZibaseBindingConfig factory(String[] configParameters) {
public ZibaseBindingConfig(String[] configParameters) {
this.values = configParameters;
logger.debug("Item Constructor - saved valued : " + StringUtils.join(this.values, ","));

This comment has been minimized.

@9037568

9037568 Nov 25, 2016

Contributor

Use parameterized logging instead of string concatenation.

@9037568

9037568 Nov 25, 2016

Contributor

Use parameterized logging instead of string concatenation.

/**
* Regex pattern to extact Radio ID from zibase log
*/
private static final Pattern RADIODIDPATTERM = Pattern.compile(": (<id>)([A-Z]{2}[0-9]*)");
//private static final Pattern CHACONZWAVEPATTERN = Pattern.compile(": (<id>)(Z?[A-Z][0-9]{1,2})");

This comment has been minimized.

@9037568

9037568 Nov 25, 2016

Contributor

Remove commented code.

@9037568

9037568 Nov 25, 2016

Contributor

Remove commented code.

} catch (SocketException ex) {
logger.error("Could not open socket to zibase : " + ex);
} catch (UnknownHostException ex) {
logger.error("Given Zibase host not reachable : " + ex);
} catch (IOException ex) {
logger.error("IO eror reading Zibase soket : " + ex);
logger.error("IO eror reading Zibase socket : " + ex);

This comment has been minimized.

@9037568

9037568 Nov 25, 2016

Contributor

Use parameterized logging instead of string concatenation.

@9037568

9037568 Nov 25, 2016

Contributor

Use parameterized logging instead of string concatenation.

@@ -186,6 +193,12 @@ protected String extractIdFromZbResponse(String zbResponseStr) {
if (matcher.find()) {
return matcher.group(1);
}
/*

This comment has been minimized.

@9037568

9037568 Nov 25, 2016

Contributor

Remove commented code.

@9037568

9037568 Nov 25, 2016

Contributor

Remove commented code.

ZibaseBindingConfig config = ZibaseBinding.getBindingProvider()
.getItemConfigByUniqueId(itemName + "_" + id);
logger.debug("Getting config for " + itemName + " (id = " + id + ") ");

This comment has been minimized.

@9037568

9037568 Nov 25, 2016

Contributor

Use parameterized logging instead of string concatenation.

@9037568

9037568 Nov 25, 2016

Contributor

Use parameterized logging instead of string concatenation.

if (config != null) {
synchronized(item) {
org.openhab.core.types.State value = config.getOpenhabStateFromZibaseValue(zibase, zbResponseStr);
logger.debug("publishing update for " + itemName + " : " + value);

This comment has been minimized.

@9037568

9037568 Nov 25, 2016

Contributor

Use parameterized logging instead of string concatenation.

@9037568

9037568 Nov 25, 2016

Contributor

Use parameterized logging instead of string concatenation.

@bchabrier

This comment has been minimized.

Show comment
Hide comment
@bchabrier

bchabrier Jul 21, 2018

Contributor

Hello, this PR contains important fixes and improvements, for instance the support of ZWAVE. Would it be possible to progress it?

Contributor

bchabrier commented Jul 21, 2018

Hello, this PR contains important fixes and improvements, for instance the support of ZWAVE. Would it be possible to progress it?

@9037568

This comment has been minimized.

Show comment
Hide comment
@9037568

9037568 Jul 21, 2018

Contributor

Given how long this PR has been abandoned, it would be acceptable for a new author to pick it up and push it over the finish line, if someone's interested.

Contributor

9037568 commented Jul 21, 2018

Given how long this PR has been abandoned, it would be acceptable for a new author to pick it up and push it over the finish line, if someone's interested.

@9037568 9037568 changed the title from Update + Bugs correction on Zibase Binding to [Zibase] Update and bug corrections Jul 21, 2018

@jit06

This comment has been minimized.

Show comment
Hide comment
@jit06

jit06 Jul 22, 2018

Contributor

I was not able to rebuild the project. I confirm that I finally more or less abandoned this development because I had no more time for it and I replaced my zibase by a custom rflink box. SO I can't heaven test it now.

Contributor

jit06 commented Jul 22, 2018

I was not able to rebuild the project. I confirm that I finally more or less abandoned this development because I had no more time for it and I replaced my zibase by a custom rflink box. SO I can't heaven test it now.

@bchabrier

This comment has been minimized.

Show comment
Hide comment
@bchabrier

bchabrier Jul 23, 2018

Contributor

OK, I have pulled this PR, made the cosmetic changes as requested in the review, did test, and am now ready to commit and push. However I have no write access to this PR. Should we close this one and create a new one?

Contributor

bchabrier commented Jul 23, 2018

OK, I have pulled this PR, made the cosmetic changes as requested in the review, did test, and am now ready to commit and push. However I have no write access to this PR. Should we close this one and create a new one?

@9037568

This comment has been minimized.

Show comment
Hide comment
@9037568

9037568 Jul 23, 2018

Contributor

Yes, you should create a new PR. Once it's merged I'll close this one.

Contributor

9037568 commented Jul 23, 2018

Yes, you should create a new PR. Once it's merged I'll close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment