Reactor 112 on openLuup registers itself on bridged Vera

Hi Rigpapa,

I am running Reactor 112 on openLuup and I found that if you have a Vera bridged that also has ALTUI installed, Reactor will add it self to the ALTUI Config on the Vera. Previously this what then preventing the ALTUI interface to load as Reactor is in the config, but the files are not on those bridged Veras. Maybe it is usefull the otherway around (from Bridged Vera to openLuup) but not this direction. See a snippet of my log file on openLuup.

2018-12-24 15:12:31.354   luup.call_action:: 3.urn:upnp-org:serviceId:altui1.RegisterPlugin 
2018-12-24 15:12:31.354   luup.call_action:: 3.urn:upnp-org:serviceId:altui1.RegisterPlugin 
2018-12-24 15:12:31.355   luup.call_action:: 20225.urn:upnp-org:serviceId:altui1.RegisterPlugin 
2018-12-24 15:12:31.355   luup.call_action:: action will be handled by parent: 7
2018-12-24 15:12:31.356   luup_log:7: http://192.168.142.249/port_3480/data_request?id=action&newDeviceType=urn%3aschemas%2dtoggledbits%2dcom%3adevice%3aReactorSensor%3a1&action=RegisterPlugin&serviceId=urn:upnp-org:serviceId:altui1&DeviceNum=225&newScriptFile=J_ReactorSensor_ALTUI%2ejs&newDeviceDrawFunc=ReactorSensor_ALTUI%2edeviceDraw&newStyleFunc=ReactorSensor_ALTUI%2egetStyle
2018-12-24 15:12:31.373   luup.call_action:: 20225.urn:upnp-org:serviceId:altui1.RegisterPlugin 
2018-12-24 15:12:31.373   luup.call_action:: action will be handled by parent: 7
2018-12-24 15:12:31.374   luup_log:7: http://192.168.142.249/port_3480/data_request?id=action&newDeviceType=urn%3aschemas%2dtoggledbits%2dcom%3adevice%3aReactor%3a1&action=RegisterPlugin&serviceId=urn:upnp-org:serviceId:altui1&DeviceNum=225&newScriptFile=J_Reactor_ALTUI%2ejs&newDeviceDrawFunc=Reactor_ALTUI%2edeviceDraw&newStyleFunc=Reactor_ALTUI%2egetStyle
2018-12-24 15:12:31.397   luup.call_action:: 18017.urn:upnp-org:serviceId:altui1.RegisterPlugin 
2018-12-24 15:12:31.397   luup.call_action:: action will be handled by parent: 6
2018-12-24 15:12:31.398   luup_log:6: http://192.168.142.251/port_3480/data_request?id=action&newDeviceType=urn%3aschemas%2dtoggledbits%2dcom%3adevice%3aReactorSensor%3a1&action=RegisterPlugin&serviceId=urn:upnp-org:serviceId:altui1&DeviceNum=8017&newScriptFile=J_ReactorSensor_ALTUI%2ejs&newDeviceDrawFunc=ReactorSensor_ALTUI%2edeviceDraw&newStyleFunc=ReactorSensor_ALTUI%2egetStyle
2018-12-24 15:12:31.423   luup.call_action:: 18017.urn:upnp-org:serviceId:altui1.RegisterPlugin 
2018-12-24 15:12:31.423   luup.call_action:: action will be handled by parent: 6
2018-12-24 15:12:31.424   luup_log:6: http://192.168.142.251/port_3480/data_request?id=action&newDeviceType=urn%3aschemas%2dtoggledbits%2dcom%3adevice%3aReactor%3a1&action=RegisterPlugin&serviceId=urn:upnp-org:serviceId:altui1&DeviceNum=8017&newScriptFile=J_Reactor_ALTUI%2ejs&newDeviceDrawFunc=Reactor_ALTUI%2edeviceDraw&newStyleFunc=Reactor_ALTUI%2egetStyle

I have not seen this with other plugins, so not sure it is Reactor or ALTUI. If the latter, let me know and I’ll ask amg0.

Cheers Rene

Reactor (and many of my other plugins) have interface extensions for ALTUI, and it needs to register those extensions. It does this when ALTUI is detected in the installation (on the Luup/Lua side). I’m not familiar with the configuration you are using, but I can see how and why what it’s doing causes trouble for you. Would you happen to have a notion as to how I might detect that the ALTUI device is seen across the bridge as opposed to being seen as a local “device”?

Hi Rigpapa,

If all you are doing is call the RegisterPlugin action on the ALTUI main device once that is fine. What may happen in your loop is that it registers it to all occurrences of ALTUI including the bridged ones. The device ID you register to should be less than 10000 as that is the number a bridged device starts at. I know that amg0’s example does not account for this explicitly, but having the break in the loop should avoid hitting any of the bridged devices as on openLuup ALTUI’s device number is 3 normally. In this one there is an extra test on the device number.

	for k, v in pairs(luup.devices) do
		if (v.device_type == "urn:schemas-upnp-org:device:altui:1") and (tonumber(k) < 10000) then
 			if luup.is_ready(k) then
				log("Found ALTUI device "..k.." registering devices.")
				local arguments = {}
				-- Main device
				luup.call_action(HData.ALTUI_SID, "RegisterPlugin", arguments, k)
			else
				log("ALTUI plugin is not yet ready, retry in a bit..")
				luup.call_delay("registerWithAltUI", 10, "", false)
			end
			break  -- Exit loop as we have registered to main instance.
		end
	end

Cheers Rene

That’s the bit I needed to know. Thank you!

This will do, but, specifically, the local AltUI instance has parent device number zero, remote ones don’t.

Sweet music to my ears. Thanks @akbooer. That’s more like it. I’ll do what needs to be done, but “magic” device number foo is a bit “how ya doin’'” as Dave Jones would say. Testing the parent seems much cleaner.

+1 to @akbooer and @rigpapa — excellent example of the spirit of cooperation on this forum that benefits everyone!