Create Feed to control LED widget

I need a simple LED widget on my dashboard to show if I am in a Solar Import or Export situation. 

How do I create a feed that outputs a value of 1 if my grid power is negative and 0 if my grid power is positive. I can then feed that into the LED widget. 

I have a Type 2 Solar installation, so I need the grid power to compute my house consumption. I have all that working fine. 

I can obviously compute this and send down a new input to emoncms, but it seems like a post input processing that I need, that I should be able to do in emoncms. 

pb66's picture

Re: Create Feed to control LED widget

There are probally several ways to tackle what you are asking but if you want to do it in the input processing you could do it with the allow neg and allow pos processes, try

(+feed ?) "grid power"
allow positive
-feed "grid power"                  should take you back to zero
log to feed "exporting"
reset2zero
allow negative  
+1            
-feed "grid power"                 should give you 1
 log to feed  "exporting"

Paul

bruce_miranda's picture

Re: Create Feed to control LED widget

Interestingly on the 3rd step it doesn't take me back to 0. See my results instead. 

 

+ feed Node:20: grid_power (feedvalue:820.00)
Allow positive
- feed Node:20: grid_power (feedvalue:820.00)
Log to feed Node:20: exporting_power (feedvalue:-819.00)
Reset to ZERO
+ 1
- feed Node:20: grid_power (feedvalue:820.00)
Log to feed Node:20: exporting_power (feedvalue:-819.00)

 

Could this be because my grid_power is being logged with PHPFIWA? 

pb66's picture

Re: Create Feed to control LED widget

"Could this be because my grid_power is being logged with PHPFIWA? "

Probably not, as looking at it again I can see the logic isn't right but the math is correct for the processes used. I'll take another look in the morning,

Paul 

bruce_miranda's picture

Re: Create Feed to control LED widget

There was someone who posted a method and then deleted it. That seems to atleast get the LED to Red when importing and Black when exporting. But really wanted to be able to make it Red or Green. 

pb66's picture

Re: Create Feed to control LED widget

I think the trick is to use an "imported_power" feed rather than using just "grid_power" feed.

Starting with 820w (importing)

Allow Positive (=820)

log to feed "import_power"

/ feed  "import_power" (=1)

the same processes starting with -820w (exporting) result in

Allow Positive (=0)

log to feed "import_power"

/ feed  "import_power" (=0)

Paul

bruce_miranda's picture

Re: Create Feed to control LED widget

Thanks pb66. I changed Allow Positive to Allow Negative so that in an Export I would get Green and vice versa.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.