For a custom sensor that is triggered by a remote machine i am creating a sensor. Everything is working and triggering fine when i do it through Lua. My problem is in the UI
It creates the motion sensor just fine and creates the sensor in an armed state. However if i try to hit bypass button or arm button it gives and error No implementation
What would be the most efficient way to handle this? Would i just create an Implementation file for the functions? Also If i manually changed the Armed Var to 0 it goes to the bypass state.
First, decide if the parent device’s Implementation file is where you want to put the code, or if you want to create a separate Implementation file for the children. Both are valid, but I think most developers go for the former. If you do this then you will need to put a “HandleChildren” directive somewhere in the parent’s implementation file. See the usual example.
Then you need to ensure that your Implementation file contains an action for urn:micasaverde-com:serviceId:SecuritySensor1/SetArmed. That code will be pretty short: all it will do is likely set the child device’s Armed variable.
Thanks futzle that was exactly what i needed! ;D In case anyone else needs to do this here is how i implemented it
Added this just before in the Implementation file
<handleChildren>1</handleChildren>
Added an action in the , your job code would be different but this will get the motionsensorid var from my parent device if greater than 0 and turn the child device to whatever state is requested.
<job>
MotionSID = tonumber(luup.variable_get(CMD_SID, "MotionSensorID", parentDevice) , 10) or 0
if( MotionSID > 0 ) then
luup.variable_set("urn:micasaverde-com:serviceId:SecuritySensor1", "Armed", lul_settings.newArmedValue, tonumber(MotionSID) )
return 4
else
return 2
end
</job>