Hi, I am using the LED with colour gradients on EmonCMS dashboard. Does anyone know what feed value produces Red colour? I can set green and most other colours but not Red which would be good as I am using as a trip indication.
Hello @bazscuba1, I think it might be 0, here’s the code for the colour selection:
Just a thought looking at the code, would it be possible for Red to be swapped with black in the code, if creating a band for Red would be more difficult?
There already is a “band” for red, namely
Can you explain how your suggestion would be of benefit?
From the code:
status = 0 : red
status = 1 : green
status = 2 : gray
status = 3 : blue
status = 4 : purple
status = 5 : yellow
status = (anything else) : black
Rephrasing your post back to you, you’re requesting that status = 0 should be black and status = (anything else) should be red? If so, how does that improve the behavior?
Hi the problem is all the other colours will display from a band value e.g. ( 0.001 - 0.9 for green etc ) but red will only display if the feed is exactly 0 ( won’t display if value is -0.001 or +0.001 this is not a reliable option and my feed will never be exactly 0 as it’s using very high resolution ( 4096 ). At the moment I have to use another colour for indication which works but not ideal.
You seem to have a very specific use case and I’m still not clear on what your problem with red specifically is.
Perhaps if you describe in detail exactly what you’re doing the community might be able to suggest an alternate approach which doesn’t require changing the dashboard code?
Just as an example, you could perform some pre-processing on your feed data so that in the “error state” the indicator value really is zero… but since you’ve provided no details that example may or may not be of any use to you.
Pre processing might be an option and I have tried this but have been unsuccessful. Basically I am using Dan’s emonDC, which the voltage input channel reads around 0.43 for 0v but fluctuates 0.4-0.45. Then reads 4096 for 5vdc. I have configured an output from my control system to change status from 0-5v when tripped, this then changes the colour of the LED from green to ideally red. I have used the calibration + & x to trigger the LED but even if I adjust the feed to show 0 with the calibration it still shows green. The only way I have been able to get the LED to show red is by setting the input feed to an input which is 0.
Can you describe in more detail how things are physically connected? You set an output of your control system from 0 to 5V, are you saying you want this 5V “trigger” to be red and it should be green when it is at 0? Can it be any other value?
You have an emonDC, where does that fit in? Is that reading the voltage output of your control system mentioned above? If so, is it essentially the “connection” between your control system output and EmonCMS?
Perhaps show a screenshot of your Inputs and Feeds in the cases where you want the dashboard LED to be green and red?
The output of the control system is 0v for red and a calibrated 5v reduced to 0.3 ( approx mid band of green ) I can configure green to change status to any other colour no problem at all by reversing the control output logic. The first time I calibrated the input for a feed value of 0 it still showed green this time its shown black, probably because if you look at the input list the feed value in brackets shows -0.00. Even though the feed shows 0 it’s obviously is not exactly 0 in the value processing behind it, how you reliably calibrate out a value below 0.00 when you can’t even see it I am not sure?
Yes the emonDC is the link between the control system and emoncms.
Its still not clear (to me at least) how you have your inputs and feeds setup to process this value - can you please post a screenshot of them both?
I can think of a few ways you can make this work but they’re dependent on assumptions I’ve had to make about how you have it working.
Where is it reduced to 0.3V? In EmonCMS or in your control system?
My first suggestion is to not try and fix it in your control system but rather feed the correct raw value straight through to EmonCMS and use the input processing to do the manipulation to get your “red” and “green” values.
Here’s an example Input process that I put together which will probably do what you need.
NOTE: I have NOT tested this!
What it should do is this:
If the input value is > 0.5 the end value will be 1
If the input value is <= 0.5 the end value will be 0
log that to a feed and use the feed in your dashboard.
Thanks, I like your thinking. In theory that should work, I didn’t know those processes were possible. I have used those processes in node red but have not seen them in EmonCMS. Those processes are not on the normal process list how did you create them?
Hi you asked where it is reduced to 0.3 value and it’s in emoncms.
Input values shown below first with 0v input on emonDC and second with 5v input on emonDC. Your example input process will still work fine if used after the recalibration of the input values.
Volts_B is the input used.
Please use a web browser to upload the image to this website (that’s the “uparrow” icon immediately above the box you type in - or drag and drop the image, not a link to the image, into the box you type in).
You appear to have copied a local (to you) link to the picture, so the rest of us can’t see it.
Sorry Robert I didn’t realise, these hopefully are displaying the Volts_B 0/5v input I was describing.
Doesn’t look like it will allow me for some reason, says app does not have access to photos but it’s not an app so can’t enable access?
Nope - still the same, just the “Alt” text: “image1.PNG” etc.
What you’re posting is:
<img src=“cid:17730503-59CC-4A6C-8C24-AE4601521FD4” alt=“image1.png” id=“17730503-59CC-4A6C-8C24-AE4601521FD4”>
which is nothing like a URL on the Discourse server, which is normally like:
Looks like Barry is sending the images via email…
@bazscuba1, can you sign into the website version of the forums and upload them from there?
They were all in the normal drop-down for Input processing.