homeassistant-config/esphome/geigercounter.yaml

83 lines
2.1 KiB
YAML
Raw Normal View History

esphome:
name: geigercounter
platform: ESP32
board: nodemcu-32s
wifi:
ssid: "Voltage-legacy"
password: !secret voltage_legacy_psk
use_address: geigercounter.home
power_save_mode: high
fast_connect: on
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Geigercounter Fallback Hotspot"
password: !secret fallback_psk
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
password: !secret api
encryption:
key: !secret apikey
ota:
password: !secret ota
spi:
clk_pin: 18
mosi_pin: 21
display:
- platform: max7219
cs_pin: 16
num_chips: 1
lambda: |-
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:
- platform: pulse_counter
pin: 19
unit_of_measurement: "µSv/h"
name: "Radioaktive Strahlungsleistung"
icon: "mdi:radioactive"
count_mode:
rising_edge: DISABLE
falling_edge: INCREMENT
update_interval: 60s
accuracy_decimals: 3
id: dose_meter
filters:
- 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 µSv/Hour
- platform: integration
name: "Gesamte Strahlungsdosis"
unit_of_measurement: "µSv"
sensor: dose_meter # link entity id to the pulse_counter values above
icon: "mdi:radioactive"
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, µSv.
text_sensor:
- platform: homeassistant
entity_id: sun.sun
id: sun_state