This question came up in my CM11A thread, but I haven’t gotten a good answer, so I’m going to generalize the question here so maybe more eyes will see it since it’s not specific to any X10 stuff.
Let’s say I’m using some new great technology to control items in my house that’s not z-wave. Let’s call it y-wave for this example. I’ve created a plugin to talk to my y-wave controller and now I want to configure devices for it. The y-wave devices all do the same kinds of things as our normal devices. We have binary switches, dimmers, etc.
The only real difference is that I need to have my y-wave devices talk to the y-wave controller and the controller needs to call actions on the devices to update the status.
So, let’s take a binary switch as an example. I want to have the same device type as the normal binary switch (urn:schemas-upnp-org:device:BinaryLight:1) so that I don’t have to go around to all the remote developers and beg them to add my new device types to their apps. And since my binary switch device acts the same, it seems logical to use the same device type. But my device needs to do it’s own implementation to handle the requests and send them to the controller.
Ok, so now I can easily create a device in the UI that uses the same D_BinaryLight1.xml and specify a custom implementation file (I_YWaveBinaryLight1.xml). Garrett has already pointed out that if I create my own D_YWaveBinaryLight1.xml that uses the same device type, it will probably cause conflicts.
Here is my dilemma. The custom action interface between the y-wave devices and controller are put into S_YWaveDevice1.xml and S_YWaveController1.xml. I want people to be able to write their own custom implementations for their y-wave devices but they will all use the same service contract files to communicate with the controller and allow the controller to communicate with the devices.
Now without creating my own D_YWaveBinaryLight1.xml, it appears I cannot specify these S_YWave*.xml files for inclusion. Is that a problem? If in my I_YWaveBinaryLight1.xml, I have this:
<actionList>
<action>
<serviceId>urn:upnp-org:serviceId:SwitchPower1</serviceId>
<name>SetTarget</name>
<run>
switch_set_target(lul_device, lul_settings)
</run>
</action>
<action>
<serviceId>urn:foo.org:serviceId:YWaveDevice1</serviceId>
<name>UpdateStatus</name>
<run>
update_status(lul_device, lul_settings)
</run>
</action>
</actionList>
But I haven’t included the S_YWaveDevice1.xml which defines this:
<?xml version="1.0"?>
<scpd xmlns="urn:schemas-upnp-org:service-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<serviceStateTable>
<stateVariable>
<name>ReceivedStatusFunction</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable>
<name>ReceivedStatusData</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable>
<name>ControllerDeviceNum</name>
<dataType>string</dataType>
</stateVariable>
</serviceStateTable>
<actionList>
<action>
<name>UpdateStatus</name>
<direction>in</direction>
<argumentList>
<argument>
<name>function</name>
<relatedStateVariable>ReceivedStatusFunction</relatedStateVariable>
</argument>
<argument>
<name>functionData</name>
<relatedStateVariable>ReceivedStatusData</relatedStateVariable>
</argument>
</argumentList>
</action>
</actionList>
</scpd>
Will it still work? And if not, then what are my options?
Bruce