I have a config object that is used to store/select a list of different types of IoT devices. I also have a set of specific nodes for each type of IoT device
I would like to know, is it possible to filter the devices dropdown to only shows the devices that have a productId that is specific to the node that use it. This is to prevent the user selecting the wrong device type within the configuration of a particular node type.
e.g: openThings-pir.html contains:
<script type="text/javascript">
RED.nodes.registerType('openThings-pir', {
category: 'Energenie 314RT',
color: '#de348c',
defaults: {
name: { value: "Motion Sensor" },
device: { type: "openThings-device", required: true },
...
And openThings-device.html contains:
<script type="text/javascript">
RED.nodes.registerType('openThings-device', {
category: 'config',
defaults: {
name: { value: "MiHome Device" },
productId: { required: true },
product: { value: "Select device from dropdown", required: false },
deviceId: { required: true },
control: { value: "Unknown", required: false }
},
e.g. in my pir node I want to do is only display PIR devices in the dropdown (ie. ones that have a node-config-input-device-productId == 12 ). In my switch socket node i only want switch sockets, etc...