Device Module selecting wrong input

I’m probably doing something wrong, but just tried the device module for adding a emonTH following this post and it seems to create an additional 2 inputs at the bottom of the input list, instead of using input #1 & #3

Below are screenshots of the process I followed;

1

2

3

4

…also, shouldn’t the inputs include a process - x 0.1 to scale the correct values.

You haven’t done anything wrong, it’s because of the age old conflict between input indexes and input names both occupying the “key” field…

The templates have been written to suit named inputs and therefore posting to emoncms from emonhub via the bulk input api will not work without changes, either you need to post using key:value pairs (not CSV) or edit the template “inputs” from

to use numeric names (index) for the “name” (“key” on inputs page) eg

    "inputs": [
        {
            "name": "1",
            "description": "Temperature C",
            "processList": [
                {
                    "process": "log_to_feed",
                    "arguments": {"type": "ProcessArg::FEEDID", "value": "emonth_temperature" }
                }
            ]
        },
        {
            "name": "3",
            "description": "Humidity Rh%",
            "processList": [
                {
                    "process": "log_to_feed",
                    "arguments": {"type": "ProcessArg::FEEDID", "value": "emonth_humidity" }
                }
            ]
        }

You will also probably want to edit the “processList” section to include your scaling too. something like this should do


                {
                    "process":"2",
                    "arguments":{"type":"ProcessArg::VALUE","value":"0.1"}
                },
                {
                    "process": "log_to_feed",
                    "arguments": {"type": "ProcessArg::FEEDID", "value": "emonth_temperature" }
                },

You can create your own folder in device/data to put your own templates in rather than fight with git when updating etc.

1 Like

Yes, but not if you are using the “emonpi” variant of emonhub that does the scaling before sending.

There are many potential variations of any given template, many uses will want to track battery voltage, others will be interested in rssi, or have more than one temp sensor. Many of us also like to use the min and max daily processes too, I think the chargeable aspect of emoncms.org may have impacted the number of feeds included by default. IMO it’s easier to delete what you don’t want rather than having to add all the additional inputs, processes and feeds manually.

@trystanlea has said (back in Feb) he will look into allowing both indexed and named inputs to be used in emoncms simultaneously as the current code seriously divides users into one camp or the other, mixing is really quite difficult.

15 posts were split to a new topic: Staff discussion of Device Module continued

Hopefully this will be resolved soon, so self-builders will be able make full use of the device module.

Paul

8 posts were split to a new topic: Development: Indexed Inputs