Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] LED Function
Discuss what the LED can do
According to my opinion, it would be nice to change the color of the led according to the air quality (green = ok, orange = slighty bad, red = bad), more or less like the Original V1 air quality monitor.
Got same idea   as erwin describe.

But on my device the led is not very shiny, i must have the nose on sensor to see it .
there is an additional light sensor on the device, that i haven't yet activated, and my idea was - once i implement it - the led would shine as much as it needs, depending on the ambient light.. but i haven't yet tested if this works and how much light the boxes let through.
currently by default it is on the dimmest setting
i finally managed to fix this
some details are here
Got the light sensor in my CO₂ monitor working. Note, though, that the placeholder for it is “%LDR%” (as listed when you scan sensors), not “%LUX%” as listed on the placeholders page:

Also amusing myself by logging garbage like %RSSI% (received WiFi signal strength, I assume). Could be a doors-open sensor?  Smile
yeah.. config tool is laggin a bit with all the features
i need to implement something so that the config tool knows what placeholders are there available and display accoridngly
the problem is that the code is in HTML/JS, which i mostly write via stackoverflow Smile so i tend to keep it to a minimum
I configured the LED function to "CO2". So I assume he LED changes from green to yellow to red according to CO² values. To see the current value to color mapping I pressed the "Sweep Color Ranges" and got this output:
Value: 338 / 3500
Value: 400 / 3500
Value: 462 / 3500
Value: 524 / 3500
Value: 586 / 3500
Value: 648 / 3500
Value: 710 / 3500
Value: 772 / 3500
Value: 834 / 3500
Value: 896 / 3500
Value: 958 / 3500
Value: 1020 / 3500
Value: 1082 / 3500
Value: 1144 / 3500
Value: 1206 / 3500
Value: 1268 / 3500
Value: 1330 / 3500
Value: 1392 / 3500
Value: 1454 / 3500
Value: 1516 / 3500
Value: 1578 / 3500
Value: 1640 / 3500
Value: 1702 / 3500
Value: 1764 / 3500
Value: 1826 / 3500
Value: 1888 / 3500
Value: 1950 / 3500
Value: 2012 / 3500
Value: 2074 / 3500
Value: 2136 / 3500
Value: 2198 / 3500
Value: 2260 / 3500
Value: 2322 / 3500
Value: 2384 / 3500
Value: 2446 / 3500
Value: 2508 / 3500
Value: 2570 / 3500
Value: 2632 / 3500
Value: 2694 / 3500
Value: 2756 / 3500
Value: 2818 / 3500
Value: 2880 / 3500
Value: 2942 / 3500
Value: 3004 / 3500
Value: 3066 / 3500
Value: 3128 / 3500
Value: 3190 / 3500
Value: 3]
[252 / 3500
Value: 3314 / 3500
Value: 3376 / 3500
Value: 3438 / 3500
Value: 3500 / 3500
ready >]
But I don't understand how to read it. How can I see the thresholds when it will switch to yellow or red? Can the threshold be configured?

Also I noticed that after some time the LED gets completely turned off. Is this the expected behavior? If yes, is it possible to keep the LED to
 show permanently the CO² status?

I have entered "help" into the command prompt and got a list of all comands (like "ledcolor" and "ledbgr"). Is there somewhere documentation about the command parameters and especially how to send them on my own (for example by HTTP/Websocket)?
well this is all stil la bit experimental
for the sweep
just watch how the led changes and then what numbers are displayed, this was the idea
though with the communication over websockets it is not working as there are some caches

in general it switches between
green, yellow, red, lila
and range is 400-3500
so roughly

400 is green
1500 yellow
2500 is red
3500 is lila

ther is no documentation yet Sad
but what you can do for the led:

ledcolor seq([brg]color)+
where brg is 50-99 - how strong should be the light - 99 is dimmest
1 is auto
if it is missing - the previously set one is used
color is a letter like this
case 'r': return Cred;
case 'v': return Cviolet;
case 'b': return Cmblue;
case 'u': return Cgreen2;
case 'g': return Cgreen;
case 'y': return Cyellow;
case 'w': return Cwhite;
case 'l': return Clila;
case 'c': return Ccyan;
case 'm': return Cmblue;
default: return Cblack;

so for example
ledcolor seq1m
will make autobrightness blue color
ledcolor seq1rbrbrn
will flash red blue few times, each letter is 333 ms
at the end it will kill the light
if you put

ledcolor seqbd

will flash blue for 333 ms and then revert to the olD color

and once you start the webserver (from vESPrino tab)
you can send the command to it simply by calling
<host>/?cmd=ledcolor seqr

for example
also you can send commands over mqtt
Well, I guess I am starting to get a bit annoying, sorry for that Smile

The LED is the last topic on my list, I promise Wink

- The LED  is only active for some minutes and then it turns off again. Then after some time it turns on again. Is this intended? Would it be possible to have it constantly on?

- Is it possible to adjust the brightness the LED is using when it is indicating CO² values? I guess it is using auto-brightness but in normal daylight it is still not using full brightness and it should be brighter then in my opinion

- it would be awesome if it would be possible to configure the thresholds the LED uses to switch colors when indicating CO² values. For example going to yellow at 1400 ppm is a bit late maybe. I used two other CO² sensors before and they go to yellow already at 900-1000 ppm.

Thanks alot!

Forum Jump:

Users browsing this thread: 1 Guest(s)