define device type

i wrote a plugin which “simulates” a binary switch … everything works perfect
BUTthe device is not populated as a BinaryLight
it uses the name of my plugin instead.

can someone maybe hint me how i can hard-set this so the rest of the world wil regornice it as a Switch and not as a “other device”

Hi nullx8,

You will need to do the following :

  • add “1” in your plugin device file;
  • create the “virtual” binary light like this :
luup.chdev.append(DEVICE_ID, APPEND_POINTER, ALT_ID, DEVICE_NAME, "urn:schemas-upnp-org:device:BinaryLight:1", "D_BinaryLight1.xml", nil, <nil or any variable you want to set>, false)
  • into implementation file define the following action :
			-- add your custom implementation here or define a function that do it like this : setTarget( lul_settings.newTargetValue, lul_device ) 
  • handle “Status” variable in order to display the state for your device;

Similar, you can create and use all our default devices.

Here you can find information regarding the actions, variables and services for the default devices :

All the Bests,

  • Andrei -

i do have the action set as described
here the original:

			local newTarget = lul_settings.newTargetValue or ""
			if (newTarget == '1') and (newActivityID ~= '') then 
			return 4,nil

but handleChildren is at 0 in the Device file

where is the “luup.chdev.append” supposed to go, since the plugin itself does create a “switch” already … or is the append action creating something invisible ?