ZWave Status
You can see the status of the Z-Wave network and all devices with the data request zwave_status. See: Data_Provider_Catalog_Plugin and Data_Provider_Catalog_Plugin_Requests
http://192.168.81.1:3451/data_request?id=zwave_status returns something like this (note: add output_format=json to the URL to get the same data in JSON format):
1 2 Waiting for controller
11 0 0 5 1 0
12 0 0 5 1 0
13 FAILED 0 1 5 5 0
14 0 1 5 5 Job ending in error: Failed with TXStatus: 1 0
15 FAILED 0 1 5 5 Job ending in error: Failed with TXStatus: 1 0
16 FAILED 0 1 5 5 Job ending in error: Failed with TXStatus: 1 0
17 0 0 5 1 0
The format is like this. The first line has:
ZWaveNetworkStatus [tab] JobStatus_TransferJobs [tab] Text description for transfer jobs.
The network status is this:
enum ZWaveStatus // Make the enumerator public
{
zws_NotSet=0,
zws_OK=1,
zws_Quiting=2
, zws_WaitingToQuit=3,
zws_NoDongle=4,
zws_Configuring=5, // Still running init/configure scripts
zws_Failure=6
};
The the network status is 1 (OK) then you don't need to warn the usr to wait. If it is anything other than 1, you can display a 'wait' icon and some text like:
ZWaveStatus[0]="Please wait for the Z-Wave network"; #zws_NotSet
ZWaveStatus[2]="The Z-Wave network is being reset";
ZWaveStatus[3]="Waiting to reset the Z-Wave network"
ZWaveStatus[4]="The Z-Wave dongle has been removed"
ZWaveStatus[5]="Configuring Z-Wave devices"
ZWaveStatus[6]="The Z-Wave network is not functioning"
- NOTE*: If you do not get a response to the data request (ie if the poll fails), then that means the ZWave software module is busy resetting itself, which happens periodically when devices change. Just try the request again.
The rest of the lines in the result look like this:
5 FAILED 0 1 5 5 Job ending in error: Failed with TXStatus: 1 0
and have this format:
PK_Device State Status Configured(0/1) LastContactFailed(0/1) ConfigStatus DescriptionOfConfigStatus PollStatus DescriptionOfPollStatus NumOfActiveJobs Job#1 Job#2 Job#3 etc.
all are separated by tabs. The ConfigStatus and PollStatus have this:
enum ZWaveJobStatus
{
ejs_NoJob=1,
ejs_WaitingToStart=2,
ejs_Running=3,
ejs_JobSuccessful=4,
ejs_JobFailed=5
};
The Job#1/2/3/etc. have this format:
icon_name,JobStatus,DescriptionOfJobStatus
so a job could look like this:
ON,3,Waiting for reply
In our UI, ConfigStatus, PollStatus, and each of the JobStatus's will be an icon in the 'device info box'. If the status is ejs_NoJob=1, then that means don't show an icon. If it is>1, then you will show the icon. Here are the icons:
CONFIG, POLL, ON, OFF, LEVEL, MISC
The first 2 correspond to ConfigStatus and POllStatus. The other 4 are possible icon_name's in JobStatus. Each job can have 4 possible states
ejs_WaitingToStart=2, (gray)
ejs_Running=3, (blue)
ejs_JobSuccessful=4, (green)
ejs_JobFailed=5 (red)
So, you've got 20 different icons: 5 types (CONFIG, POLL, ON, OFF, LEVEL, MISC) and each one has the 4 states. Daniel will do the icons. For now, just create 20 solid squares with the gray/blue/green/red. i propose icon names of:
CONFIG_3.gif (config icon, blue)
LEVEL_2.gif (level icon, gray)
etc.