missing light status

I’m brand new to micasaverde but I’ve got my engine working, currently paired with only a single dimmable light switch. The switch works great and I’m able to use, for example, the Home Buddy app for Android to control it correctly. Now I would like to begin writing my own app.

Per the docs I’ve read, the data I receive with id=lu_sdata should be enough to tell me if my light is currently on or off, and since it’s a dimmer, what percentage of “on” – through the ‘status’ and ‘level’ fields. However, when I pull my data, neither of those fields are present. The data I receive is shown below; the URL I used to obtain it is http://:3480/data_request?id=lu_sdata

Any idea how I determine the status of a specific device? In this case I could partially rely on the two scenes being active/not active, but that’s not really a useful method once my scenes are more complex.

{
“full”: 1,
“version”: “1.1.1362”,
“model”: “SERCOMM NA401”,
“zwave_heal”: 0,
“temperature”: “F”,
“serial_number”: “\n”,
“fwd1”: “fwd2.mios.com”,
“fwd2”: “fwd1.mios.com”,
“sections”: [
{
“name”: “Home”,
“id”: 1
}
],
“rooms”: [
{
“name”: “Kitchen”,
“id”: 1,
“section”: 1
}
],
“scenes”: [
{
“name”: “Kitchen Light Off”,
“id”: 2,
“room”: 1,
“active”: 0,
“state”: -1,
“comment”: “”
},
{
“name”: “Kitchen Light On”,
“id”: 1,
“room”: 1,
“active”: 1,
“state”: -1,
“comment”: “”
}
],
“devices”: [
{
“name”: “Kitchen Light”,
“altid”: “2”,
“id”: 3,
“category”: 2,
“subcategory”: 0,
“room”: 1,
“parent”: 1,
“state”: -1,
“comment”: “”
}
],
“categories”: [
{
“name”: “Dimmable Light”,
“id”: 2
}
],
“loadtime”: 1323241208,
“dataversion”: 241208102,
“state”: -1,
“comment”: “”
}

In the device section your dimmable light should look similar to this:

{
“name”:“Living Room Light”,
“altid”:“2”,
“id”:3,
“category”:2,
“subcategory”:0,
“room”:2,
“parent”:1,
“status”:“0”,
“level”:“0”,
“watts”:“0”,
“state”:-1,
“comment”:“”
}

Here is what some of the values mean:

status = 0 for off, 1 for on
level = 0-100 of the light level

Not sure why your data is not showing all of the data.

  • Garrett

Turn the light on, then off, refresh the sdata and see if those values show up. It works for status, it could work for sdata.

Cycling the light power didn’t help; I’m still only receiving the same output as originally posted.

I believe my unit and dimmer must be working correctly, because Home Buddy is able to correctly indicate if the light is on or not. Is it possible that Home Buddy is using some different URL than I am to get the additional information? I’m just using “/data_request?id=lu_sdata” (I’ve tried with both the local network IP/port, and also with the fwd2.mios.com/username/password/serialnumber proxy). I’m not specifying either the loadtime nor dataversion parameters.

Home Buddy is using userdata e.g. http://ipaddress:3480/data_request?id=user_data2&output_format=json. However, this gives you a large amount of data. Can you try a test. Can you remove the dimmer from Vera e.g. exclude it and than re-include the dimmer again. See if this populates the proper data. Also what firmware are you running?

  • Garrett

My firmware version is 1.1.1362; current according to the mios dashboard.

I’m not sure how to exclude the dimmer (I’m very new to home automation) but if you think it would help after this next item I found, I’ll give it a shot.

You told me that Home Buddy is using the user_data2 request, which is different than what I was using – the UI Simple page on the wiki didn’t mention that, only lu_sdata. When I pull data with user_data2 and compare the difference with the light on vs. off, I can see some status buried within the haystack of data… Among the few thousand lines, I find these when the light is on:

                "value": "1"
            },
            {
                "service": "urn:upnp-org:serviceId:Dimming1",
                "variable": "LoadLevelStatus",
                "id": 12,
                "value": "100"
            },
            {
                "service": "urn:micasaverde-com:serviceId:ZWaveDevice1",
                "variable": "PollOk",
                "id": 13,
                "value": "1892"
            },

which differ from these when the light is off:
“value”: “0”
},
{
“service”: “urn:upnp-org:serviceId:Dimming1”,
“variable”: “LoadLevelStatus”,
“id”: 12,
“value”: “0”
},
{
“service”: “urn:micasaverde-com:serviceId:ZWaveDevice1”,
“variable”: “PollOk”,
“id”: 13,
“value”: “1897”
},

The “variable”: “Status” has a “value” 1 vs. 0, so clear enough to differentiate those (even if it’s far less convenient than what the wiki suggests lu_sdata should provide), and the LoadLevelStatus value is, I assume, the power-on percentage of the dimmer. I presume the PollOK value is unimportant but perhaps based on the time of the data retrieval.

So from that, it seems my switch is able to provide the correct data (but if you still think it’d be helpful for me to remove and re-pair the switch I’ll try that). Is it possible that this version of firmware has a bug with the id=lu_sdata request? Also, is there a document describing the full set of URL parameters?

Thanks very much for your time and help!

I don’t think so, it works fine for me.

Here is the list with all the HTTP requests:
http://wiki.micasaverde.com/index.php/Luup_Requests

lu_sdata is just a subset of data from user_data2. This is the preferred way to get data when developing 3rd party apps that want to get information or control.

user_data2 contains everything about the vera unit. There will be data that is not required (e.g. 75% of it will not be needed). The firmware should not be an issue.

Here are a few links that describe how to include/exclude:

http://docs2.mios.com/doc.php?language=1&manual=1&platform=0&page=include_mode

http://docs2.mios.com/doc.php?language=1&manual=1&platform=0&page=full_power_inclusion

  • Garrett

Thank you to both of you!