Septillion schreef op maandag 9 januari 2023 @ 08:32:
@
Obelixxx Ondertussen nu hier wel een aantal keer langs gekomen. Anders gewoon je code eens posten.
Maar als je verbruik hebt met de kranen dicht lijkt me de sensor nog niet optimaal te zitten.
offtopic:
* Septillion moment wat over een ESPhome topic maar doet op het moment geen ESP projectjes
De code die ik nu in ESP geladen heb is deze:
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
| 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.51
000 m³ with
0 decimals of accuracy
[
08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.518
00 m³ with
0 decimals of accuracy
[
08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.525
00 m³ with
0 decimals of accuracy
[
08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.53
000 m³ with
0 decimals of accuracy
[
08:43:11][D][pulse_counter:174]: 'water pulse': Retrieved counter: 2999.5
0 pulses/min
[
08:43:11][D][sensor:127]: 'water pulse': Sending state 2999.5
0000 pulses/min with 2 decimals of accuracy
[
08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.538
00 m³ with
0 decimals of accuracy
[
08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.543
00 m³ with
0 decimals of accuracy
[
08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.548
00 m³ with
0 decimals of accuracy
[
08:43:11][D][sensor:127]: 'Water Pulse Meter': Sending state 6
000.
00000 liter/min with 2 decimals of accuracy
[
08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.551
00 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.562
00 m³ with
0 decimals of accuracy
[
08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.569
00 m³ with
0 decimals of accuracy
[
08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.575
00 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.581
00 m³ with
0 decimals of accuracy
[
08:43:11][D][sensor:127]: 'Water Total m3': Sending state 2.588
00 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