ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
pzem004t.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome::pzem004t {
8
9class PZEM004T final : public PollingComponent, public uart::UARTDevice {
10 SUB_SENSOR(voltage)
11 SUB_SENSOR(current)
12 SUB_SENSOR(power)
13 SUB_SENSOR(energy)
14
15 public:
16 void setup() override;
17
18 void loop() override;
19
20 void update() override;
21
22 void dump_config() override;
23
24 protected:
29 READ_POWER = 0xB2,
31 DONE = 0x00,
32 } read_state_{DONE};
33
35
37};
38
39} // namespace esphome::pzem004t
virtual void setup()
Where the component's initialization should happen.
Definition component.cpp:84
This class simplifies creating components that periodically check a state.
Definition component.h:532
enum esphome::pzem004t::PZEM004T::PZEM004TReadState DONE
void write_state_(PZEM004TReadState state)
Definition pzem004t.cpp:94
bool state
Definition fan.h:2
static void uint32_t