final?
This commit is contained in:
parent
937fd99148
commit
badb30ae73
1 changed files with 35 additions and 38 deletions
73
poempl.yaml
73
poempl.yaml
|
@ -8,12 +8,8 @@ esphome:
|
||||||
- light.turn_on:
|
- light.turn_on:
|
||||||
id: bar
|
id: bar
|
||||||
brightness: 20%
|
brightness: 20%
|
||||||
red: 0
|
effect: meter
|
||||||
green: 0
|
|
||||||
blue: 20%
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Enable logging
|
# Enable logging
|
||||||
logger:
|
logger:
|
||||||
|
|
||||||
|
@ -50,23 +46,39 @@ light:
|
||||||
rgb_order: GRB
|
rgb_order: GRB
|
||||||
name: Bar
|
name: Bar
|
||||||
effects:
|
effects:
|
||||||
- strobe
|
- addressable_lambda:
|
||||||
- platform: partition
|
name: "meter"
|
||||||
name: bar00
|
update_interval: 100ms
|
||||||
segments:
|
lambda: |-
|
||||||
- id: bar
|
int val = ((id(bme280_pressure).state - 900) * 0.08) - 4;
|
||||||
from: 0
|
|
||||||
to: 0
|
Color red = Color((uint8_t)255, (uint8_t)0, (uint8_t)0, (uint8_t)51);
|
||||||
effects:
|
Color yellow = Color((uint8_t)255, (uint8_t)255, (uint8_t)0, (uint8_t)51);
|
||||||
- strobe
|
Color green = Color((uint8_t)0, (uint8_t)255, (uint8_t)0, (uint8_t)51);
|
||||||
- platform: partition
|
|
||||||
name: bar01
|
it.range(0, 9) = Color::BLACK;
|
||||||
segments:
|
|
||||||
- id: bar
|
if (val < 3) {
|
||||||
from: 1
|
it.range(0, val+1) = red;
|
||||||
to: 1
|
} else {
|
||||||
effects:
|
it.range(0, 3) = red;
|
||||||
- strobe
|
}
|
||||||
|
|
||||||
|
if (val >= 3) {
|
||||||
|
if ( val < 6) {
|
||||||
|
it.range(3, val+1) = yellow;
|
||||||
|
} else {
|
||||||
|
it.range(3, 6) = yellow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (val >= 6) {
|
||||||
|
if ( val < 9) {
|
||||||
|
it.range(6, val+1) = green;
|
||||||
|
} else {
|
||||||
|
it.range(6, 9) = green;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sensor:
|
sensor:
|
||||||
- platform: bme280
|
- platform: bme280
|
||||||
|
@ -76,23 +88,8 @@ sensor:
|
||||||
pressure:
|
pressure:
|
||||||
name: "BME280 Pressure"
|
name: "BME280 Pressure"
|
||||||
id: bme280_pressure
|
id: bme280_pressure
|
||||||
on_value:
|
|
||||||
- then:
|
|
||||||
- light.addressable_set:
|
|
||||||
id: bar
|
|
||||||
red: 20%
|
|
||||||
green: 0
|
|
||||||
blue: 0
|
|
||||||
white: 20%
|
|
||||||
range_from: 0
|
|
||||||
range_to: !lambda |
|
|
||||||
int val = (id(bme280_pressure).state - 900) * 0.08;
|
|
||||||
ESP_LOGD("main", "value %d", val);
|
|
||||||
return val - 3;
|
|
||||||
|
|
||||||
|
|
||||||
humidity:
|
humidity:
|
||||||
name: "BME280 Relative Humidity"
|
name: "BME280 Relative Humidity"
|
||||||
id: bme280_humidity
|
id: bme280_humidity
|
||||||
address: 0x76
|
address: 0x76
|
||||||
update_interval: 0.5s
|
update_interval: 5s
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue