You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# internal_filter: 190us # for SBM20 tube, for J305 tube use 180us ### disabled on 30/12/2024
52
-
update_interval: 60s
53
70
accuracy_decimals: 0
54
-
id: my_cpm_meter
55
-
71
+
update_interval: 1s
72
+
filters:
73
+
delta: 1
74
+
on_raw_value:
75
+
then:
76
+
- lambda: |-
77
+
x=round(x/60); // esphome calculating based on pulses per minute. round required to avoid problem when esphome calc value less than 60 pulses per minute (for example 59.7)
78
+
id(pulse_sum) -= id(pulse_history)[id(pulse_index)]; // remove old value from overall sum
79
+
id(pulse_history)[id(pulse_index)] = x; // 'x' is the raw pulse count
80
+
id(pulse_sum) += x; // add new value to overall sum
81
+
82
+
id(pulse_index)++; // change array index where next value will be stores
83
+
if (id(pulse_index) >= 60) id(pulse_index) = 0; // Reset at 60
84
+
on_value:
85
+
then:
86
+
component.update: geiger_cpm
87
+
88
+
- platform: template
89
+
id: geiger_cpm
90
+
unit_of_measurement: 'CPM'
91
+
name: 'Ionizing Radiation Power CPM'
92
+
accuracy_decimals: 0
93
+
update_interval: 1s
94
+
state_class: measurement
95
+
lambda: return id(pulse_sum);
96
+
filters:
97
+
delta: 1
98
+
56
99
- platform: copy
57
-
source_id: my_cpm_meter
58
-
unit_of_measurement: 'uSv/Hour'
100
+
source_id: geiger_cpm
101
+
id: ionizing_radiaton_power
102
+
unit_of_measurement: 'µSv/h'
59
103
name: 'Ionizing Radiation Power'
104
+
state_class: measurement
105
+
icon: mdi:radioactive
60
106
accuracy_decimals: 3
61
-
id: my_dose_meter
62
107
filters:
63
-
- sliding_window_moving_average: # 5-minutes moving average (MA5) here
64
-
window_size: 5
65
-
send_every: 1
66
-
- multiply: 0.0057# or 0.00332 for J305 by IoT-devices tube conversion factor of pulses into uSv/Hour
108
+
- skip_initial: 15
109
+
- sliding_window_moving_average: # 15 measurements moving average (MA5) here
110
+
window_size: 15
111
+
send_every: 1
112
+
- multiply: 0.0057# 0.0057 original value or 0.00332 for J305 by IoT-devices tube conversion factor of pulses into uSv/Hour
67
113
68
114
- platform: integration
69
115
name: "Total Ionizing Radiation Dose"
70
116
unit_of_measurement: "uSv"
71
-
sensor: my_dose_meter# link entity id to the pulse_counter values above
117
+
sensor: ionizing_radiaton_power# link entity id to the pulse_counter values above
72
118
icon: "mdi:radioactive"
73
119
accuracy_decimals: 5
74
120
time_unit: min # integrate values every next minute
75
121
filters:
76
-
# obtained dose. Converting from uSv/hour into uSv/minute: [uSv/h / 60] OR [uSv/h * 0.0166666667].
122
+
# obtained dose. Converting from uSv/hour into uSv/minute: [uSv/h / 60] OR [uSv/h * 0.0166666667].
77
123
# if my_dose_meter in CPM, then [0.0057 / 60 minutes] = 0.000095; so CPM * 0.000095 = dose every next minute, uSv.
0 commit comments