View difference between Paste ID: 1jcSXzEK and TNMiXtiu
SHOW: | | - or go back to the newest paste.
1-
esphome:
1+
  esphome:
2
  name: sensore-pzem004t
3
  platform: ESP8266
4-
  board: esp12e
4+
  board: nodemcuv2
5
6
# Enable logging
7
logger:
8
  baud_rate: 0
9
10
# Enable Home Assistant API
11
api:
12
13
ota:
14
  password: "dfb05d7b978556e896ace8ba2810321b"
15
16
wifi:
17
  ssid: "FRITZ!Box 7530 YX 2.4G"
18-
  password: "25162964755408347082"
18+
  password: "XXXXXXXXXXXXXXXXXXXX"
19
20
  # Enable fallback hotspot (captive portal) in case wifi connection fails
21
  ap:
22
    ssid: "Sensore-Pzem004T"
23-
    password: "RmKpc5DpwmXT"
23+
    password: "XXXXXXXXXXXXXX"
24
25
captive_portal:
26
uart:
27
  rx_pin: 3 #GPIO03
28
  tx_pin: 1 #GPIO01
29
  baud_rate: 9600
30
31
modbus:
32
33
sensor:
34
  - platform: pzemac
35
    current:
36
      name: "PZEM-004T V3 Current"
37
      unit_of_measurement: "A"
38
      id: Current
39
      internal: true
40
      accuracy_decimals: 3
41
      force_update: True
42
    voltage:
43
      name: "PZEM-004T V3 Voltage"
44
      unit_of_measurement: "V"
45
      id: Voltage
46
      internal: true
47
      accuracy_decimals: 1
48
      force_update: True  
49
    energy:
50
      name: "PZEM-004T V3 Energy"
51-
      unit_of_measurement: "Wh"   # "watt*hour"
51+
      unit_of_measurement: "Wh"
52
      id: Energy
53
      internal: true
54
      accuracy_decimals: 2
55
      force_update: True
56
#      state_class: "measurement"
57
    power:
58
      name: "PZEM-004T V3 Power"
59-
      unit_of_measurement: "W"	# "watt"
59+
      unit_of_measurement: "W"
60
      id: Power
61
      internal: true
62
      accuracy_decimals: 2
63
      force_update: True
64
#      state_class: "measurement"
65
    frequency:
66
      name: "PZEM-004T V3 Frequency"
67
      unit_of_measurement: "Hz"
68
      id: Frequency
69
      internal: true
70
      accuracy_decimals: 1
71
      force_update: True  
72
    power_factor:
73
      name: "PZEM-004T V3 Power Factor"
74
      unit_of_measurement: "cos𝝋"
75
      id: CosPhi
76
      internal: true
77
      accuracy_decimals: 2
78
      force_update: True  
79
#      filters:
80
#       - lambda: return acos(Power/ (Voltage * Current ));  # phi
81
#       - lambda: return sqrt((Power * Power) - (Voltage * Current ));    # Reactive Energy u.m. VAreactive
82
    update_interval: 60s
83
    
84
#  - platform: total_daily_energy
85
#    name: "PZEM-016 Daily Energy"
86
#    power_id: Power 
87
#    filters:
88
        # Multiplication factor from W to kW is 0.001
89
#      - multiply: 0.001
90
#    unit_of_measurement: kWh
91
#    icon: mdi:counter
92
#    accuracy_decimals: 1   
93
94
#time:
95
#  - platform: sntp
96
#    timezone: Europe/Rome
97
#    id: my_time   
98
#    update_interval:
99
##    on_time:
100
#      seconds: 59
101
#      minutes: 59
102
#      hours: 23
103
##       then:
104
##        - 
105