Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual Feed Shortcomings #1853

Open
XtremeOwnageDotCom opened this issue Apr 6, 2023 · 6 comments
Open

Virtual Feed Shortcomings #1853

XtremeOwnageDotCom opened this issue Apr 6, 2023 · 6 comments

Comments

@XtremeOwnageDotCom
Copy link

Migrated from #1660

I was working on creating a feed to display the amount of "self-produced" energy used at my house per day. The formula is pretty simple.

x = grid_energy_in_d: 9.4
y = load_energy_d: 31.1

p = 100 - ((x * 100) / y)

But, while trying to implement-

image

It became pretty apparent the ability to subtract the value from 100, doesn't appear to be easily possible. As well, you cannot use a virtual feed, inside of another virtual feed.

Originally posted by @XtremeOwnageDotCom in #1660 (comment)

A few potential solutions:

  1. Allowing virtual feeds to reference other virtual feeds.
  2. Allowing math operations to be reordered.

ie, instead of X - 1, allowing 1 - X.

@TrystanLea
Copy link
Member

Thanks @XtremeOwnageDotCom

Reorganising the equation gives us a solution that can work with the existing implementation:

p = (((x*100)/y)-100)*-1

image

Not to say that we shouldn't explore the other solutions as I can see benefits to both.

@XtremeOwnageDotCom
Copy link
Author

I personally think both solutions have other differing use-cases which may benefit others as well.

I can see lots of intricate capabilities being introduced by allowing nested virtual feeds.

For my example solution, I did previously resolve it in the way you described- But- still wanted to make sure to give a useful idea for future development.

@TrystanLea
Copy link
Member

Ok sure, I will take a look at nesting, ideally need something in the interface to detect recursion, that shouldn't be too difficult.

@lo92fr
Copy link

lo92fr commented Sep 14, 2023

Hello,

I take a look at point 1: "Allowing virtual feeds to reference other virtual feeds.".
It seems that it is already supported out of the box.

Just comment the following lines :
/*
if (parseInt(this.feedlist[z].engine) == 7) { //input context and virtual feed and process writes to feed?
continue; // Dont list virtual feed
}
*/
in function 'showfeedoptions':function(processid){ in file process_ui.js do the trick.

I test basic behaviors like adding/substrating virtual feeds together, and it seems okay.
Perhaps just to verify as TrystanLea said if we need to add some recursion test to prevent loops.

Best regards,
Laurent.

@chaveiro
Copy link
Contributor

chaveiro commented Sep 14, 2023

Recursion is supervised, any feed missbehaving is disabled for editing.

@lo92fr
Copy link

lo92fr commented Sep 14, 2023

OK, perfect.
So is there something against the removal of these three lines so we can activate nexted feeds?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants