Community
OpenEnergyMonitor

Community

When setting up apps the list of feeds to choose from is incomplete

Tags: #<Tag:0x00007f56b4a059a8>

Hi,

When I try to configure My Solar app, or any other for that matter, the list of feeds in the dropdowns is incomplete.

I have about 240 feeds - but the drop down lists only show just less than 100 of them.

For example here are my feeds for Node emonpi:

The app config dropdowns only show these 6 feeds for that node:

<option value="17>Node emonpi:Geyser KWh</option>
<option value="5">Node emonpi:Geyser Watts</option>
<option value="28>Node emonpi:Grid kWh wo geyser</option>
<option value="1>Node emonpi:Grid Volts</option>
<option value="21>Node emonpi:Grid watts wo geyser</option>
<option value="2>Node emonpi:Kitchen temp</option>

This means I can’t use the apps since the feeds I need aren’t shown as options.

Can anyone shed any light as to why?

Thanks

@emrys, is there a limit on number of feeds?

@Elbow, you can go into the FeedAPI and there is an API call that will return the metadata for every feed.

Indeed it does, unfortunately a decision was made many moons ago to only service phpfina (fixed interval) feeds in the emoncms apps!

Only 8 of the feeds you list are phpfina, the others are not expected to be listed.

You can hack the app module code to show other feed types, but that will then block future updates to the apps module via git.

As to why only 6 of the expected 8 are displayed, I suspect you may have some duplicate feed names, this is widely acceptable across emoncms, most of the code uses a combination of group (tag) and feed name combined to determine if it’s unique or not. However, the app module is somewhat behind in that respect as it cannot handle duplicate feed names and it only displays the last found of each name (in feed id order) so only the most recently created of each name phpfina feeds display.

Do you have any other feeds named “Grid Watts” and “Grid kWh” ?

You must therefore use unique feed names to make full use of the app module, this is in conflict with the device module and emonhub as they are designed to use consistent naming.

See Apps feedlist issues and Does emoncms expects data to be send reguarly?

1 Like

My feeds do not have unique names overall.

For instance I have two Lithium batteries and they (obviously?) have the same feed names but different node names.

Ideally I would want to use VIRTUAL feeds since to get total house load requires a calculation between my essentials board and main board etc.

Thanks for clearing it up though.

I guess my best option is to modify the code to show the virtual feeds as well as the PHPFINA feeds, and then to create special virtual feeds specifically intended to feed the apps.

Does that sound like a reasonable plan; I’ll keep a patch around so if the app module gets updated it makes it easier to re-apply the change.

That’s exactly as I would expect, it’s a shortfall of the app module that has not been updated to keep up with the recommended practice in the rest of emoncms.

duplicate feed names are not an issue (in the apps module) as long as you only want to use the latest created feeds in the app. You could easily (for example) have a single emontx set up and working no problem for a time and then set up a second emonTx with the same feed names and the original ones disappear from the apps list, if then you were to delete and recreate any of the original feeds in an attempt to “bring them back” you would then only get the “originals” (latest created), things can get very confusing when you have many feeds of the same name, created and recreated (or even renamed) at various instances.

That’s fine, it sounds like you are familiar with git so it shouldn’t present an issue. You can simply “git stash” the local changes and reset the branch, either before running an update or after the update fails, either way it’s a PITA having to check either if there is an update to the apps module prior to clicking update to know whether to “stash changes” or having to check the update was successful or if you need to reapply the patch, But being experianced with git helps a great deal.

Just a note that there is a github issue for this ongoing issue here https://github.com/emoncms/app/issues/100. @Adminde has implemented a fix but there are a large number of other changes in the same pull request that still need reviewing. I’m taking a look at these now.

1 Like

I’ve copied over just the feed selection fix from @Adminde’s pull request as a starting point. This fixes the issue where feed names needed to be unique.

This change is now available in the apps module master branch. Here are the steps to pull this in:

cd /var/www/emoncms/Modules/app
git checkout master
git pull origin master

I will merge this to stable and make it available via standard emoncms update after a bit more testing.


The feed engine restriction remains. I have only tested the apps with the engines that are listed as supported so dont want to change this and cause a lot of issues with engine incompatibilities that I haven’t tested - perhaps it will all be fine? If anyone would like to test unrestricted feed selection try changing the following lines: https://github.com/emoncms/app/blob/master/Lib/config.js#L381

engine_check: function(feed,conf)
{
    if (typeof conf.engine === 'undefined') {
        return true;
    }

to

engine_check: function(feed,conf)
{
    return true;
    if (typeof conf.engine === 'undefined') {
        return true;
    }

I’d be interested to hear what works and what doesn’t. Thanks.

Its also possible to enable all engines by removing the engine property from the specific app config e.g in mysolarpv.php:

change:

config.app = {
    "use":{"type":"feed", "autoname":"use", "engine":"5", "description":_("House or building use in watts")},

to (remove “engine”:“5”) :

config.app = {
    "use":{"type":"feed", "autoname":"use", "description":_("House or building use in watts")},