Over the last couple of months I’ve started to use @nchaveiro’s device module introduced originally in emoncms v9 and now available as an optional module. I’ve made a couple of modifications to make it possible to create and initialise a device from a device template by sending a ‘describe’ property alongside other node input data, and in the last week I’ve made a start on integrating device configuration into the emoncms input user interface itself.
I’ve been wondering for sometime if the grouping of inputs and feeds and the relation between them can be improved with a better definition of nodes or devices. I like the idea that when an emontx or emonth posts to emoncms it appears more like the detection of a new device rather than a loosely grouped set of inputs or feeds - at the same time the flexibility of the current implementation is I think a good thing and so any changes need to be implemented carefully.
Backing up a bit. Inputs, input processing and Feeds are key parts of emoncms allowing a degree of pre-processing and providing the option to record only what you wish to record.
At present inputs can be grouped by nodeid which may be a number such (e.g 10) or an alphanumeric name (e.g emontx).
Feeds can be grouped by ‘tag’ which may or may not be associated with the input node grouping.
@nchaveiro introduced the device module for defining ‘devices’ in emoncms v9. Devices are associated with an input ‘nodeid’. The device module can be used to automatically configure emoncms inputs and create emoncms feeds according to a device template definition. The device module also provides device or input node level authentication keys.
Devices:
- Linked to input ‘nodeid’
- Has seperate device name
- Configures inputs and creates feeds from a template definition
Inputs:
- Grouped by ‘nodeid’
- nodeid/inputname must be unique
Feeds:
- Grouped by ‘tag’
- feedname only must be unique
- Feeds are created from Inputs.
Does emoncms have too many different grouping types?, feed ‘tag’, input ‘nodeid’, device ‘name’, device ‘nodeid’. We could have all of these refer to the same thing. Feeds could belong to a device identified by ‘devicename’, inputs to a device identified by ‘devicename’, a device would then just be a device rather than having a name and then a seperate association with a nodeid.
A start on integrating the device module in the input interface
I’ve attached some initial screenshots of the new inputs UI I’ve been working on that integrates the device module more closely, with the ability to select and initialise a device template from the input interface.
Input list with new look that emphasises ‘node’ or ‘device’ grouping + multiselect for deleting multiple inputs at once and perhaps other multi-input operations:
Clicking on the spanner icon for the node/device brings up the device configure dialog, where the Location and device template can be set:
Clicking on initialise, initialises the device, building the input processing and creating feeds according to the selected device template:
My other thought is that you could almost call the inputs interface ‘My Devices’ and the interface could even provide the ability to toggle between device inputs and device feeds within the same device list interface… That would be a big step, Im not 100% sure if its the right way forward.
If anyone has any thoughts on it Id be glad to hear them.
The code for the above so far is in the device-integration branch of emoncms here:
https://github.com/emoncms/emoncms/tree/device-integration
This development topic builds on the ‘emoncms UI improvement’ item outlined in the emoncms development outline - 14th of April 2017: