We have moved at community.getvera.com

Author Topic: significance of device attribute "status"  (Read 182 times)

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
significance of device attribute "status"
« on: January 21, 2019, 05:33:50 pm »
Couple of questions if anybody knows.

I noticed that ALTUI displays a device attribute called status. A quick search on the forum lead me to this thread:
http://forum.micasaverde.com/index.php?topic=78151.0

To this I wanted to ask:
1. It seems like UI7 sometimes displays this attribute on the UI and sometimes not depending on the device. How does it determine whether or not to display it? Luckily ALTUI always shows it.
2. It seems like the default value for this attribute should be -1. I noticed that when the device is in error state (example, if the node failed to execute a command because it was busy) then the value becomes 2. This is one of the absurdities of the vera since it should be queuing that command and do a retry and wipeout that error instead of setting the device in error state. This error state apparently can't be changed even if the device later on is actuated and responded correctly. It requires a dreadful luup reload to be removed. Anyone knows what significance other values have for this attribute? Now for ALTUI, whenever I tried to change the value of this attribute, I get a luup reload as well. I don't believe it is a behavior built into ALTUI but I want to ask anyway if one could change it without causing a luup reload?

Edit: Related question/suggestion to amg0, could we get a list of devices in ALTUI for which this attribute is not -1 shown in a shortcut with a red color if it is not -1? The idea would be to mimick the vera UI failed device list.
« Last Edit: January 21, 2019, 05:38:24 pm by rafale77 »
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: significance of device attribute "status"
« Reply #1 on: January 22, 2019, 06:46:43 am »
AFAIK, status is best controlled by the luup.set_failure() function.

http://wiki.micasaverde.com/index.php/Luup_Lua_extensions#function:_set_failure

Quote
Luup maintains a 'failure' flag for every device to indicate if it is not functioning. You can set the flag to 1 if the device is failing, 0 if it's working, and 2 if the device is reachable but there's an authentication error. If device is a string it is interpreted as a udn, if it's a number, as a device id. The lu_status URL will show for the device: <tooltip display="1" tag2="Lua Failure"/> and Lua Failure is shown in red in UI5 for the device.

In the openLuup implementation, the flag values 0,1,2 are mapped to status values -1,2,2.

See also this discussion on other variables modified by set_failure()

openLuup : set_failure
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: significance of device attribute "status"
« Reply #2 on: January 22, 2019, 11:02:44 am »
Thanks AK. Unfortunately I have tried this function for this error without success. When the device has responded that it is busy, the luup.set_failure(false,devid) doesn't remove the error. I have had it work on other errors before.
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.