Using the new emoncms device module integration

Following on from the Development: Devices, Inputs and Feeds in emoncms development thread, this post details how to use the new features now present in the emoncms and device module master branch (not yet merged into stable).

What is the device module?
The device module adds the ability to auto-configure inputs and feeds from pre-defined device templates, there are templates for all the standard OpenEnergyMonitor hardware units and configurations e.g: EmonPi > Solar PV Type 1, using these templates simplifies the setup procedure for these common applications. The Device module also adds device level access keys . The device module was originally developed by @nchaveiro and has been developed more recently, including some really nice interface design work by @Adminde! :slight_smile:

Device integration in emoncms
In order to provide a more integrated user experience the device module has been integrated into the new emoncms input interface. Devices are automatically created when new input node groups are created. You can then auto configure the node/device by selecting a device template. Thanks to @emrys for his help over the last month bringing the last pieces of the new emoncms inputs & feeds interfaces together.

Thanks also to @pb66 @centurionsolar @dave @bramco @kanflo @Andreas_Messerli @Paul @stuart for your input and help testing in the development thread!

Getting started

You will need:

  1. The latest emoncms master branch installed:
    GitHub - emoncms/emoncms: Web-app for processing, logging and visualising energy, temperature and other environmental data
  2. The latest device module master branch installed in your emoncms Modules folder:
    GitHub - emoncms/device: Emoncms device module

These will both be available via an automated update for EmonPi users once we merge emoncms master into stable. This will also be available on at a similar time.

1) Turn on Beta Features:

Given that the new input and feeds interfaces are such large changes on the previous interfaces we have made it possible to switch between the old and new interfaces via a user preference on the emoncms My Account page:

Click ‘On’ to enable the new inputs and feeds user interfaces:

2) The new Inputs page

Navigate to Setup > Inputs. The new inputs interface contains clearer grouping of inputs to their respective nodes. Its possible to select and delete multiple inputs at one time with the new checkbox feature on the left hand side. Inputs can be configured individually as normal using the spanner icon in-line with each input.

Device configuration: Click on the spanner icon in-line with the node name to bring up the device configuration modal.

3) Device configuration

Navigate through the left hand menu device template selector to select a relevant template for your application, e.g Solar PV Type 1 or 2 matches the Solar PV guide here: Solar PV - Guide | OpenEnergyMonitor

The selected template will then show below the ‘Configuration’ title:

Click Save to bring up the device initialization view:

The device initialization view provides an opportunity to review the changes proposed by the device template, you can at this point cancel or unselect any of the items if you notice potential conflicts with existing configuration.

4) The Result

The inputs page will now show the newly configured inputs:

The feeds page will show the newly created feeds:

The Solar PV type 1 and type 2 device templates use the same naming convention as the emoncms My Solar PV app, to require no further configuration beyond adding the app to the apps list:


Create your own device templates: See existing device templates for examples, e.g home energy monitoring: device/emonpi-HEM.json at master · emoncms/device · GitHub. Further templates can be added by adding template files to the emoncms/Modules/device/data folder.

Next steps

  • Merge emoncms master branch into stable after a period of further testing
  • Enable new interface selection on, this includes a large shift in the code base to use the input processing code used in the core emoncms branch.
  • @emrys is updating the new inputs interface to include the expand/contract feature available on the feeds page, alongside node summary.
  • Update OpenEnergyMonitor Guide to use the device module for the standard EmonTx & EmonPi HomeEnergyMonitor & SolarPV application setup procedures.
  • Update the OpenEVSE Guide with the same.
  • Copy above guide to be part of the general emoncms guide.

Thankyou to all involved in getting this development this far! I welcome suggestions for improvements to the above guide, I will keep editing this post with improvements.


9 posts were split to a new topic: Testing new device module integration

This is now live for testing on To turn on the new interface goto: Setup > My Account, turn Device Module Beta On

I think maybe too many changes have been rolled into one here. The bulk of the changes seem to revise the input and feed pages, these changes can be seen and used without the device module even being installed.

IMO this button should be labelled “New Input and Feed interfaces Beta (with Device Module integration)

I like the “Beta Features” way of doing things, it’s much better than switching git branches and more likely to attract early adopters if there is a easy way to switch to and if necessary, back out of new features. Although I wonder how long things will remain in beta with this feature, perhaps it should be called “Feature selection” and used long term to switch between options, some of which can be marked “beta” until such time as they are merged into the core, dropped or just no longer beta but remain optional.

Since my initial observations do not relate directly to the “device integration” but are more about the new input and feed interfaces, I will start another thread and possibly come back here when I’ve tested the actual device integration side.

[EDIT - See Thoughts on the new Input and Feed page layouts]

1 Like

One thing I really dislike about these types of ‘switches’ is that it is not absolutely clear as to whether it is on or off. I’d also prefer the use of the words ‘enabled’ or ‘disabled’ (as in I have enabled beta features).

It’s only a little thing, but instinctively, I do not know the state - I need to look and think. I’d prefer a single word stating the mode which changes when pressed (perhaps with a secondary warning).

One other thing, with this feature available (to turn modules on or off) could more modules be included by default with an enable/disable toggle?

1 Like

I have discovered (the hard way) that the input/clean api doesn’t function so well now due to the device module integration, it will delete all inputs without processes as expected, but since “inputs” are no longer just a collection of individual inputids with a common group (ie input node name) but actually now a “device” with it’s own entry in the device table, the “device” also needs manually deleting too, otherwise you end up with what appears to be “lingering phantom inputs” (See Thoughts on the new Input and Feed page layouts - #18 by pb66)