[quote=“akbooer, post:11, topic:191163”]It’s not that it’s not necessary, it would certainly improve Vera compatibility. I’m just pointing out that it’s a lot of work with very little payoff.
The ‘state’ variable is derived from the job state which is more fully described by these values:
local state = {
NoJob=-1,
WaitingToStart=0, -- If you return this value, 'job' runs again in 'timeout' seconds
InProgress=1,
Error=2,
Aborted=3,
Done=4,
WaitingForCallback=5, -- This means the job is running and you're waiting for return data
Requeue=6,
InProgressPendingData=7,
}
…but I’m totally unsure of the meaning of ‘status’.
Job states are already used in openLuup (devices and scenes run as jobs), although due to lack of documentation, I struggle to make a complete implementation of the luup API for jobs.
What’s your understanding of ‘status’ vs. ‘state’ ?[/quote]
State shows what happened to the last command sent to a particular device:
NONE: state value is -1. This means there’s nothing to report to the user.
PENDING: state value is 0, 1, 5 or 6.
ERROR: state value is 2 or 3.
SUCCESS: state value is 4
Status shows the particular properties of the different devices:
SCENE: There is simply a ‘Run’ button for the control. (Active could be conside the status of the scene)
CATEGORY #2 - Dimmable Light: ‘status’ is 0 or 1 for off or on, and if status is 1, ‘level’ is a value from 0-100 to indicate the brightness.
CATEGORY #3 - Switch: Like dimmable light, but it only has ‘status’
CATEGORY #4 - Security Sensor: ‘tripped’ is 0 or 1 to indicate if the sensor is tripped or not (1=tripped). ‘armed’ is 0 or 1 to indicate if it’s in an armed state.
CATEGORY #5 - Thermostat: fanmode: “Auto”, hvacstate: “Cooling”,mode: “CoolOn”,temperature: “73.0”,setpoint: “72”, heat: “55”,cool: “72”,
CATEGORY #6 - Camera: These don’t have a status.
CATEGORY #7 - Door lock: ‘status’ is 1 for locked or 0 for unlocked.
CATEGORY #8 - Window covering: same as Dimmable Light.
CATEGORY #16 - Humidity sensor: ‘humidity’ is the relative humidity from 0-100. Just display the ‘humidity’,
CATEGORY #17 - Temperature sensor: ‘temperature’ same as with a thermostat.
CATEGORY #18 - Light sensor: ‘light’ is a measurement of the ambient light in the room.
CATEGORY #21 - Power meter: ‘watts’ is the current consumption in watts.