C Api - zway_device_guess function

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
lluzak
Posts: 7
Joined: 09 Jul 2014 00:41

C Api - zway_device_guess function

Post by lluzak »

Hey

I'm writing a GO bindings for zway library, and i encountered a problem. While calling zway_device_guess function from C level the result are different from those which i'm getting at Expert UI. The orders and the scores are completely different. What can be a cause of that ? Should i call some additional method before it ?
pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: C Api - zway_device_guess function

Post by pofs »

Expert UI uses /ZWaveAPI/Run/devices[x].GuessXML(), which internally calls zway_device_guess() and returns data without altering scores and order.
Expert UI for somewhat reason sorts returned data on the client side (which is a bit pointless, because results of zway_device_guess are already sorted). It might change the order, but it never changes scores.

Just use scores as they are returned by zway_guess_xml().
lluzak
Posts: 7
Joined: 09 Jul 2014 00:41

Re: C Api - zway_device_guess function

Post by lluzak »

Yes, i'm using zway_device_guess function, the problem is that the results different from /ZWaveAPI/Run/devices[x].GuessXML(). The scores and device given by zway_device_guess doesn't match the device, but Expert UI method returns very accurate. Is there a need to run maybe some additional function for device to make it recognizable, like zway_device_interview_force ?
pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: C Api - zway_device_guess function

Post by pofs »

How (and when) are you calling zway_device_guess()?

Results are depending on multiple device parameters (manufacturer id, generic and specific type, etc.), which are loaded from config/zddx/xxxxxxxx-Devices.xml (where "xxxxxxxx" is your home id) on startup. Make sure you have provided correct config folder path when initializing zway library.

Device config block is added to config file on inclusion, and updated multiple times during interview process, so if you want to make it completely independent from z-way-server, make sure to do all the inclusion/exclusion and interview calls yourself.
Post Reply