Obelixxx schreef op maandag 9 januari 2023 @ 09:27:
[...]
De code die ik nu in ESP geladen heb is deze:
code:
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
| esphome:
name: watermeter-test
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: ""
ota:
password: ""
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Watermeter-Test Fallback Hotspot"
password: ""
captive_portal:
sensor:
- platform: pulse_counter
pin: GPIO12
update_interval : 6s
name: "water pulse"
id: water_pulse
- platform: pulse_meter
pin: GPIO12
name: "Water Pulse Meter"
unit_of_measurement: "liter/min"
icon: "mdi:water"
total:
name: "Water Total Ltr"
unit_of_measurement: "L"
id: water_meter_total_ltr
device_class: water
state_class: total_increasing
- platform: pulse_meter
pin: GPIO12
name: "Water Pulse Meter"
unit_of_measurement: "liter/min"
icon: "mdi:water"
total:
name: "Water Total m3"
unit_of_measurement: "m³"
id: water_meter_total_m3
device_class: water
state_class: total_increasing
filters:
- multiply: 0.001
- platform: template
name: "Water Usage Liter"
id: water_flow_rate
accuracy_decimals: 1
unit_of_measurement: "l/min"
icon: "mdi:water"
lambda: return (id(water_pulse).state * 10);
update_interval: 6s |
Wat ik zie in de logging is dat ie verbruik blijft geven:
[log]
[08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.51000 m³ with 0 decimals of accuracy
[08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.51800 m³ with 0 decimals of accuracy
[08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.52500 m³ with 0 decimals of accuracy
[08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.53000 m³ with 0 decimals of accuracy
[08:43:11][D][pulse_counter:174]: 'water pulse': Retrieved counter: 2999.50 pulses/min
[08:43:11][D][sensor:127]: 'water pulse': Sending state 2999.50000 pulses/min with 2 decimals of accuracy
[08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.53800 m³ with 0 decimals of accuracy
[08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.54300 m³ with 0 decimals of accuracy
[08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.54800 m³ with 0 decimals of accuracy
[08:43:11][D][sensor:127]: 'Water Pulse Meter': Sending state 6000.00000 liter/min with 2 decimals of accuracy
[08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.55100 m³ with 0 decimals of accuracy
[08:43:11][D][sensor:127]: 'Water Pulse Meter': Sending state 0.00000 liter/min with 2 decimals of accuracy
[08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.56200 m³ with 0 decimals of accuracy
[08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.56900 m³ with 0 decimals of accuracy
[08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.57500 m³ with 0 decimals of accuracy
[08:43:11][D][sensor:127]: 'Water Usage Liter': Sending state 29995.00000 l/min with 1 decimals of accuracy
[08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.58100 m³ with 0 decimals of accuracy
[08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.58800 m³ with 0 decimals of accuracy
[
[/log]
Bij het bouwen krijg ik ook de melding dat GPIO12 niet ideaal zou zijn.
Welke pin gebruiken jullie?
Ik heb een ESP32 Wroom development V1 board gebruikt nu