Device types and IDs?


(Shreddin Pb) #1

Hey guys, I got my X10 smart things shield working, but there is a small problem.

The system works with a custom device type that has preferences, the preferences are used to set the Alpha and Numeric values of the X10 devices.
The arduino sketch then receives that information, and sends the on/off command to the corresponding address.

All of this works just fine. The problem comes in when I add multiple device types with the same network ID. This is needed due to the way it works… since there is only one thing shield receiver.

When I try to add a second device type with the same network ID I get this error…

Oh No! Something Went Wrong! Error 500: Internal Server Error URI /device/save Reference Id a3f97aae-72ce-42c8-bd34-0e6360ea3d4c Date Mon Jan 13 04:01:21 UTC 2014 Class grails.validation.ValidationException Message Validation Error(s) occurred during save(): - Field error in object 'physicalgraph.device.Device' on field 'deviceNetworkId': rejected value [DFA1]; codes [physicalgraph.device.Device.deviceNetworkId.unique.error.physicalgraph.device.Device.deviceNetworkId,physicalgraph.device.Device.deviceNetworkId.unique.error.deviceNetworkId,physicalgraph.device.Device.deviceNetworkId.unique.error.java.lang.String,physicalgraph.device.Device.deviceNetworkId.unique.error,device.deviceNetworkId.unique.error.physicalgraph.device.Device.deviceNetworkId,device.deviceNetworkId.unique.error.deviceNetworkId,device.deviceNetworkId.unique.error.java.lang.String,device.deviceNetworkId.unique.error,physicalgraph.device.Device.deviceNetworkId.unique.physicalgraph.device.Device.deviceNetworkId,physicalgraph.device.Device.deviceNetworkId.unique.deviceNetworkId,physicalgraph.device.Device.deviceNetworkId.unique.java.lang.String,physicalgraph.device.Device.deviceNetworkId.unique,device.deviceNetworkId.unique.physicalgraph.device.Device.deviceNetworkId,device.deviceNetworkId.unique.deviceNetworkId,device.deviceNetworkId.unique.java.lang.String,device.deviceNetworkId.unique,unique.physicalgraph.device.Device.deviceNetworkId,unique.deviceNetworkId,unique.java.lang.String,unique]; arguments [deviceNetworkId,class physicalgraph.device.Device,DFA1]; default message [{0} must be unique]

This appears to be in smart things and is nothing I can do about it?


(Shreddin Pb) #2

No ideas?
Should I send this to technical support?


(Todd Wackford) #3

You could code your sub-devices more like attributes and drive them through setting them as device states.

HTH,
Todd


(Shreddin Pb) #4

Im a little confused… so you are saying to have multiple sub devices… like only one main button, but then when you click the gear to go full screen with the button, you will have many smaller buttons that can do the individual ones?

I think that might work as a good work around…
but would like to be able to have individual devices.

But I will try that!


(Todd Wackford) #5

As a work around built on a work around, you could then build virtual device tiles that subscribe to the main devices’ subs’ attribute states. Kinda round-a-bout, but it should work. Actually might be a better solution under certain use cases. It’s how I have my garage door working. I have two relays on one Arduino/ST Shield, I have one virtual device/tile commanding/listening to one relay and another virtual device/tile for the other relay. I hide the original device in a “holder” group that keeps it off my main screen.


(Shreddin Pb) #6

That is what I am attempting to do right now :slight_smile:
Is your code somewhere online where I can view it?

thanks!