Added actual sensor display to 7-segment display. Dims at night.

This commit is contained in:
Marcus Scholz 2022-11-07 23:58:48 +01:00
parent b0aa7991f9
commit acc3e5c9c8
1 changed files with 16 additions and 3 deletions

View File

@ -38,7 +38,16 @@ display:
cs_pin: 5
num_chips: 1
lambda: |-
it.print("01234567");
if(id(sun_state).has_state()) {
// dim 7 segment's LED brighness at nighttime
if (id(sun_state).state == "below_horizon") {
it.set_intensity(2);
} else {
it.set_intensity(12);
}
}
it.print(" ");
it.printf("%2.2f uSh", id(dose_meter).state);
# Here we calc and include to the firmware a power and doze values of ionizing radiation as sensor outputs
sensor:
@ -57,7 +66,7 @@ sensor:
- sliding_window_moving_average: # 5-minutes moving average (MA5) here
window_size: 5
send_every: 1
- multiply: 0.0054 # SBM20 tube conversion factor of pulses into mkSv/Hour
- multiply: 0.0054 # SBM20 tube conversion factor of pulses into µSv/Hour
- platform: integration
name: "Gesamte Strahlungsdosis"
unit_of_measurement: "µSv"
@ -66,4 +75,8 @@ sensor:
accuracy_decimals: 5
time_unit: min # integrate values every next minute
filters:
- multiply: 0.00009 # obtained doze (from mkSv/hour into mkSv/minute) conversion factor: 0.0054 / 60 minutes = 0.00009; so pulses * 0.00009 = doze every next minute, mkSv.
- multiply: 0.00009 # obtained doze (from mkSv/hour into mkSv/minute) conversion factor: 0.0054 / 60 minutes = 0.00009; so pulses * 0.00009 = doze every next minute, µSv.
text_sensor:
- platform: homeassistant
entity_id: sun.sun
id: sun_state