[quote=“RexBeckett, post:7, topic:174530”]
I think I got it figured out, but the bottom line is it wasn’t VERA. The it was a child device controlled by the “MIMOlite Plugin”. I have went into the “I_MimoSensor.xml” file and changed out the
“urn:schemas-micasaverde-com:device:MotionSensor:1”
That makes sense. The plugin would set the device type on every restart. You may need to change the device file as well as the device type. It may not matter on UI5 but apparently it does on UI7.[/quote]
I had changed both from the get go so I’m not sure if UI5 needed to or not but all is working good.
I think my next step is to play around with the same file and delete the other devices it creates. MIMOLite Plugin creates like 3 child devices (sensors), But I only need the on/off relay (parent device) and the tripped not tripped door sensor (security sensor or 1 child device). The other 2 children are useless to me right now and I end up just hiding them with lua start up code. But with 4 garage doors and an electronic driveway gate it alot of hidden devices that still show on phone and clutter things up.
Here’s my modified version I’m using with door vs. running man if anyone wants it and can you see what I should remove to get rid of the “Current Level” and “Pulse” child devices Could also be called “GenericSensor1” and “EnergyMetering1”
[code]<?xml version="1.0"?>
local g_mimoDevices = {}
local g_parentDevice
local g_childDevices = {
– { door_sensor = x1, generic_sensor = y1, power_meter = z1 },
– { door_sensor = x2, generic_sensor = y2, power_meter = z2 },
– …
– { door_sensor = xn, generic_sensor = yn, power_meter = zn }
}
local SID_MIMO = “urn:micasaverde-com:serviceId:MimoSensor1”
local SID_SECURITY = “urn:micasaverde-com:serviceId:SecuritySensor1”
local SID_GENERIC = “urn:micasaverde-com:serviceId:GenericSensor1”
local SID_ENERGY = “urn:micasaverde-com:serviceId:EnergyMetering1”
local DEV_TYPE_DOOR_SENSOR = “urn:schemas-micasaverde-com:device:DoorSensor:1”
local DEV_TYPE_GENERIC_SENSOR = “urn:schemas-micasaverde-com:device:GenericSensor:1”
local DEV_TYPE_POWER_METER = “urn:schemas-micasaverde-com:device:PowerMeter:1”
local function CreateChildDevices()
local ptr = luup.chdev.start( g_parentDevice )
for , mimoDev in pairs( g_mimoDevices ) do
– Create the security sensor.
luup.chdev.append( g_parentDevice, ptr, "mimo"… mimoDev …“_bs”, “Mimo #”… mimoDev …" binary sensor",
DEV_TYPE_DOOR_SENSOR, “D_DoorSensor1.xml”, “I_SecuritySensor1.xml”,
SID_SECURITY …“,Tripped=0\n”… SID_SECURITY …“,Armed=0”, false )
-- Create the generic sensor.
luup.chdev.append( g_parentDevice, ptr, "mimo_".. mimoDev .."_gs", "Mimo #".. mimoDev .." generic sensor",
DEV_TYPE_GENERIC_SENSOR, "D_GenericSensor1.xml", "",
SID_GENERIC ..",CurrentLevel=0", false )
-- Create the generic sensor.
luup.chdev.append( g_parentDevice, ptr, "mimo_".. mimoDev .."_pm", "Mimo #".. mimoDev .." pulse meter",
DEV_TYPE_POWER_METER, "D_PowerMeter1.xml", "",
SID_ENERGY ..",Pulse=0", false )
end
luup.chdev.sync( g_parentDevice, ptr )
end
local function GetChildDevices()
for devNum, devAttr in pairs( luup.devices ) do
if devAttr.id:find(“^mimo”) then
– We found a child device. Get its “virtual” parent.
local vParent = devAttr.id:match(“mimo_(%d+)”)
vParent = tonumber( vParent, 10 )
if not g_childDevices[vParent] then
g_childDevices[vParent] = {}
end
if devAttr.device_type == DEV_TYPE_DOOR_SENSOR then
g_childDevices[vParent].door_sensor = devNum
elseif devAttr.device_type == DEV_TYPE_GENERIC_SENSOR then
g_childDevices[vParent].generic_sensor = devNum
else
g_childDevices[vParent].power_meter = devNum
end
end
end
end
function UpdateTripped (lul_device, lul_service, lul_variable, lul_value_old, lul_value_new)
luup.variable_set( SID_SECURITY, “Tripped”, lul_value_new, g_childDevices[lul_device].door_sensor )
end
function UpdateLevel (lul_device, lul_service, lul_variable, lul_value_old, lul_value_new)
luup.variable_set( SID_GENERIC, “CurrentLevel”, lul_value_new, g_childDevices[lul_device].generic_sensor )
end
function UpdatePulse (lul_device, lul_service, lul_variable, lul_value_old, lul_value_new)
luup.variable_set( SID_ENERGY, “Pulse”, lul_value_new, g_childDevices[lul_device].power_meter )
end
function Startup (lul_device)
-- Comma separated list of MIMO device IDs.
local mimoDevices = luup.variable_get( SID_MIMO, "MIMO_Devices", lul_device ) or ""
if mimoDevices == "" then
luup.variable_set( SID_MIMO, "MIMO_Devices", "", lul_device)
luup.log( "(MimoPlugin::Startup) No MIMO devices to monitor. Quit" )
return
end
for devNum in mimoDevices:gmatch( "%d+" ) do
table.insert( g_mimoDevices, tonumber( devNum, 10 ) )
end
g_parentDevice = lul_device
CreateChildDevices()
GetChildDevices()
for i,devNum in pairs(g_mimoDevices) do
luup.variable_watch( "UpdateTripped", SID_SECURITY, "Tripped", devNum )
luup.variable_watch( "UpdateLevel", SID_GENERIC, "CurrentLevel", devNum )
luup.variable_watch( "UpdatePulse", SID_ENERGY, "Pulse", devNum )
end
end
Startup
[/code]