-
Notifications
You must be signed in to change notification settings - Fork 2
/
esp32-ggreg20-v3.yaml
75 lines (63 loc) · 2.28 KB
/
esp32-ggreg20-v3.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# License record: IoT-devices, LLC : EO/zaD7NcdSfHLgB/OlzLx/6De/N5thMJ1PCZSsxhxqd3J4OoHK84QQgNlKVSh5X1lrEp0a0/8fRyTThM649FZNcQPydSrHadjHNH3pMPb6q4sDRHzsmt4vE18M3cfG+Rd7cMNqqlTl2IUu5J7mLiclji8di0FSBIB7UOnf14JxJ71oruGPkEiqK9yLAw4or
esphome:
name: "esp32-ggreg20-v3"
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esphome-GGreg20-V3-ESP32"
password: "vgcSNevqmK33"
captive_portal:
# Here we calc and include to the firmware a power and dose values of ionizing radiation as sensor outputs
sensor:
- platform: pulse_counter
pin:
number: 23
inverted: True
mode:
input: True
# No pullup or pulldown on ESP32 side because of internal pullup set in hardware at GGreg20_V3 pulse output side
pullup: False
pulldown: False
unit_of_measurement: 'CPM'
name: 'Ionizing Radiation Power CPM'
count_mode:
rising_edge: DISABLE
falling_edge: INCREMENT # GGreg20_V3 uses Active-Low logic
use_pcnt: False
internal_filter: 190us # for SBM20 tube, for J305 tube use 180us
update_interval: 60s
accuracy_decimals: 0
id: my_cpm_meter
- platform: copy
source_id: my_cpm_meter
unit_of_measurement: 'uSv/Hour'
name: 'Ionizing Radiation Power'
accuracy_decimals: 3
id: my_dose_meter
filters:
- sliding_window_moving_average: # 5-minutes moving average (MA5) here
window_size: 5
send_every: 1
- multiply: 0.0057 # or 0.00332 for J305 by IoT-devices tube conversion factor of pulses into uSv/Hour
- platform: integration
name: "Total Ionizing Radiation Dose"
unit_of_measurement: "uSv"
sensor: my_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:
# obtained dose. Converting from uSv/hour into uSv/minute: [uSv/h / 60] OR [uSv/h * 0.0166666667].
# if my_dose_meter in CPM, then [0.0057 / 60 minutes] = 0.000095; so CPM * 0.000095 = dose every next minute, uSv.
- multiply: 0.0166666667