Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Peacefair PZEM-004T AC energy meter. More...

Files

file  pzem004t.h
 Header file for extended sensor API of PZEM-004T sensor.

Enumerations

enum  sensor_channel_pzem004t {
  SENSOR_CHAN_PZEM004T_ENERGY = SENSOR_CHAN_PRIV_START , SENSOR_CHAN_PZEM004T_POWER_FACTOR , SENSOR_CHAN_PZEM004T_ALARM_STATUS , SENSOR_CHAN_PZEM004T_POWER_ALARM_THRESHOLD ,
  SENSOR_CHAN_PZEM004T_MODBUS_RTU_ADDRESS , SENSOR_CHAN_PZEM004T_ADDRESS_INST_SET , SENSOR_CHAN_PZEM004T_RESET_ENERGY
}
 Custom sensor channels for PZEM-004T. More...
enum  sensor_attribute_pzem004t { SENSOR_ATTR_PZEM004T_POWER_ALARM_THRESHOLD = SENSOR_ATTR_PRIV_START , SENSOR_ATTR_PZEM004T_MODBUS_RTU_ADDRESS , SENSOR_ATTR_PZEM004T_ADDRESS_INST_SET , SENSOR_ATTR_PZEM004T_RESET_ENERGY }
 Custom sensor attributes for PZEM-004T. More...

Detailed Description

Peacefair PZEM-004T AC energy meter.

Enumeration Type Documentation

◆ sensor_attribute_pzem004t

#include <zephyr/drivers/sensor/pzem004t.h>

Custom sensor attributes for PZEM-004T.

Enumerator
SENSOR_ATTR_PZEM004T_POWER_ALARM_THRESHOLD 

Active power alarm threshold, in W.

SENSOR_ATTR_PZEM004T_MODBUS_RTU_ADDRESS 

Modbus address of the device.

Only set it with a single device connected to the bus.

SENSOR_ATTR_PZEM004T_ADDRESS_INST_SET 

Modbus address the driver instance uses to reach the device.

This does not change the address of the device itself.

SENSOR_ATTR_PZEM004T_RESET_ENERGY 

Reset the energy counter of the device.

Requires CONFIG_PZEM004T_ENABLE_RESET_ENERGY.

◆ sensor_channel_pzem004t

#include <zephyr/drivers/sensor/pzem004t.h>

Custom sensor channels for PZEM-004T.

Enumerator
SENSOR_CHAN_PZEM004T_ENERGY 

Active energy accumulated over time, in Wh.

SENSOR_CHAN_PZEM004T_POWER_FACTOR 

Power factor, the ratio of real power to apparent power, with 0.01 resolution.

SENSOR_CHAN_PZEM004T_ALARM_STATUS 

Alarm status: 0xFF when the active power is above the power alarm threshold, 0x00 otherwise.

SENSOR_CHAN_PZEM004T_POWER_ALARM_THRESHOLD 

Active power alarm threshold, in W.

SENSOR_CHAN_PZEM004T_MODBUS_RTU_ADDRESS 

Modbus address of the device.

Only set it with a single device connected to the bus.

SENSOR_CHAN_PZEM004T_ADDRESS_INST_SET 

Modbus address the driver instance uses to reach the device.

This does not change the address of the device itself.

SENSOR_CHAN_PZEM004T_RESET_ENERGY 

Reset the energy counter of the device.

Requires CONFIG_PZEM004T_ENABLE_RESET_ENERGY.