Led widget

Hi,

Hope someone can provide some help. I would like to show live feed and use dashboard led widget to show red for emontx feed inactive and green for emontx feed received ok. The reason for led is to provide information whether feed is live or old data.

I've tried creating one new feed with Feed API help and calling it activeLed, then using event Module  to update Led feed based on feed input data from emontx (an event defined to make Led value 0 for inactive) and (second event define to make Led value 1 for updated). This is not working yet but hopeful it should work (event Module doesn't seem to be doing anything).

Maybe there is another option I missed , looking through emoncms.org dashboard there is example Led widget being used for something similar. Event Module isn't an option on emoncms.org yet.

Any guidance or instruction on how this can be done greatly appreciated.

Cheers

Peter

P.S. example http://emoncms.org/trystan/hotwater

Paul Reed's picture

Re: Led widget

See http://openenergymonitor.org/emon/node/2265 re event module status.

Paul

PeterN's picture

Re: Led widget

Hi Paul,

Thanks Paul,  I noticed this post earlier but would also like to know how it can be done without events Module as this Module  isn't used in emoncms.org example by Trystan's (link above).

Thanks

Peter

P.S. I would still like to test using events when it's back working

 

dBC's picture

Re: Led widget

I use the LED widget to indicate the health of my 4-20mA current loops for my rainwater tank levels.  You can see that here:

http://emoncms.org/dBCC/erm

in the "Rainwater" box.

If the current is within spec I light the LED GREEN, if it's less than 4mA I set it BLACK to indicate a probable broken cable, and if it's more than 20mA I set it RED to indicate a probable short in the cable.

I've got a general purpose computer between my front end h/w and emoncms, so that's where I can insert code to inspect raw values and drive LEDs etc.   What would be really neat would be if someone could come up with a general programming input "process"  for emoncms, that lets you write conditional code and post to feeds based on the results.

hmm... I should have looked at Paul's pointer above before I posted.  That event module looks like a great start, depending on what options live in those pull-down menus.

PeterN's picture

Re: Led widget

Hi, my thoughts exactly. However Trystan seems to have done something similar in his emoncms.org example without the event Module. I keen to know if there is another way to use led widget.

Thanks

Peter

PeterN's picture

Re: Led widget

Thanks dBC, you mean some code added to raspberry pi to send led input feed when nothing received from emontx  . Like your dashboard - I notice 50hz are you measuring grid frequency - something on my to do list.

Cheers

Peter

dBC's picture

Re: Led widget

you mean some code added to raspberry pi to send led input feed when nothing received from emontx  .

Yep, or in my case based on the mA reading from my 4-20mA current loops: Black, Green or Red depending on whether it's under, in-spec, or over.

Like your dashboard - I notice 50hz are you measuring grid frequency - something on my to do list.

Thanks.  Yep, my energy monitoring front-end measures that for me.  Actually, it measures the full-cycle period and I convert that into frequency.  Although it's a pretty boring display around these parts... I need to go down to several decimal places before I ever see it anything other than 50.0

Paul Reed's picture

Re: Led widget

dBC - when the LED widget is installed on a desktop, you are only given one option - which feed to allocate to the widget.

How do you designate what the different levels are, ie where are the threshold levels entered to determine when a threshold has been reached?

Paul

dBC's picture

Re: Led widget

I do that externally to emoncms.  When I post my tank data to emoncms, I actually post 4 inputs: two tank readings, and two LED colours:

snprintf(post_message, sizeof(post_message),
     "http://emoncms.org/input/post?node=9&csv=%d,%d,%d,%d&apikey=insert-key-here",
     tank1, tank2, led_colour(tank1), led_colour(tank2));

 

int led_colour (int tank_reading) { 

  if (tank_reading < 3900)        // 4000uA is expected minimum
    return LED_GREY;

  if (tank_reading >= 20100)      // 20000uA is expected max
    return LED_RED;

  return LED_GREEN;
}

Paul Reed's picture

Re: Led widget

Aah, right, it doesn't work out of the box! 
I thought that the widget would be self contained...

Paul

PeterN's picture

Re: Led widget

Hi,

Just to clarify, my question is not related to event Module.

The event Module can do something similar to that outlined above by dBC or at least I hope so. First create one new input with API help e.g. activeLed.

Then use event Module:

  1. First event conditional on feed active defined to set activeLed to 1
  2. Second event conditional on same feed inactive defined to set activeLed input  value to 0

I will test this as soon as event Module is working again. This should constantly update activeLed to 0 or 1 based on feed chosen in conditional events defined.

My question relates to emoncms.org dashboard example by Trystan and not events Module. Tystan has Led widget in his dashboard doing something similar (maybe out of box ?, who knows), however there is no event Module in emoncms.org yet. So I'm curious as to how.

 

Thanks

Peter

 

Comment viewing options

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