ESPHome
2026.11.0b6
Loading...
Searching...
No Matches
esphome
components
honeywellabp
honeywellabp.h
Go to the documentation of this file.
1
// for Honeywell ABP sensor
2
// adapting code from https://github.com/vwls/Honeywell_pressure_sensors
3
#pragma once
4
5
#include "
esphome/components/sensor/sensor.h
"
6
#include "
esphome/components/spi/spi.h
"
7
#include "
esphome/core/component.h
"
8
9
namespace
esphome::honeywellabp
{
10
11
class
HONEYWELLABPSensor
final :
public
PollingComponent
,
12
public
spi::SPIDevice
<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW,
13
spi::CLOCK_PHASE_LEADING, spi::DATA_RATE_200KHZ> {
14
SUB_SENSOR(
pressure
)
15
SUB_SENSOR(
temperature
)
16
17
public
:
18
void
setup
()
override
;
19
void
update()
override
;
20
float
get_setup_priority()
const override
;
21
void
dump_config()
override
;
22
void
set_honeywellabp_min_pressure(
float
min_pressure);
23
void
set_honeywellabp_max_pressure(
float
max_pressure);
24
25
protected
:
26
float
honeywellabp_min_pressure_
= 0.0;
27
float
honeywellabp_max_pressure_
= 0.0;
28
uint8_t
buf_
[4];
// buffer to hold sensor data
29
uint8_t
status_
= 0;
// byte to hold status information.
30
int
pressure_count_
= 0;
// hold raw pressure data (14 - bit, 0 - 16384)
31
int
temperature_count_
= 0;
// hold raw temperature data (11 - bit, 0 - 2048)
32
uint8_t
readsensor_
();
33
uint8_t
readstatus_
();
34
int
rawpressure_
();
35
int
rawtemperature_
();
36
float
countstopressure_
(
int
counts,
float
min_pressure,
float
max_pressure);
37
float
countstotemperatures_
(
int
counts);
38
float
read_pressure_
();
39
float
read_temperature_
();
40
};
41
42
}
// namespace esphome::honeywellabp
esphome::Component::setup
virtual void setup()
Where the component's initialization should happen.
Definition
component.cpp:84
esphome::PollingComponent
This class simplifies creating components that periodically check a state.
Definition
component.h:532
esphome::honeywellabp::HONEYWELLABPSensor
Definition
honeywellabp.h:13
esphome::honeywellabp::HONEYWELLABPSensor::countstopressure_
float countstopressure_(int counts, float min_pressure, float max_pressure)
Definition
honeywellabp.cpp:52
esphome::honeywellabp::HONEYWELLABPSensor::readsensor_
uint8_t readsensor_()
Definition
honeywellabp.cpp:13
esphome::honeywellabp::HONEYWELLABPSensor::temperature_count_
int temperature_count_
Definition
honeywellabp.h:31
esphome::honeywellabp::HONEYWELLABPSensor::status_
uint8_t status_
Definition
honeywellabp.h:29
esphome::honeywellabp::HONEYWELLABPSensor::rawtemperature_
int rawtemperature_()
Definition
honeywellabp.cpp:49
esphome::honeywellabp::HONEYWELLABPSensor::honeywellabp_min_pressure_
float honeywellabp_min_pressure_
Definition
honeywellabp.h:26
esphome::honeywellabp::HONEYWELLABPSensor::read_temperature_
float read_temperature_()
Definition
honeywellabp.cpp:68
esphome::honeywellabp::HONEYWELLABPSensor::honeywellabp_max_pressure_
float honeywellabp_max_pressure_
Definition
honeywellabp.h:27
esphome::honeywellabp::HONEYWELLABPSensor::pressure_count_
int pressure_count_
Definition
honeywellabp.h:30
esphome::honeywellabp::HONEYWELLABPSensor::read_pressure_
float read_pressure_()
Definition
honeywellabp.cpp:63
esphome::honeywellabp::HONEYWELLABPSensor::buf_
uint8_t buf_[4]
Definition
honeywellabp.h:28
esphome::honeywellabp::HONEYWELLABPSensor::countstotemperatures_
float countstotemperatures_(int counts)
Definition
honeywellabp.cpp:58
esphome::honeywellabp::HONEYWELLABPSensor::readstatus_
uint8_t readstatus_()
Definition
honeywellabp.cpp:43
esphome::honeywellabp::HONEYWELLABPSensor::rawpressure_
int rawpressure_()
Definition
honeywellabp.cpp:46
esphome::spi::SPIDevice
The SPIDevice is what components using the SPI will create.
Definition
spi.h:456
component.h
esphome::honeywellabp
Definition
honeywellabp.cpp:4
sensor.h
spi.h
temperature
uint16_t temperature
Definition
sun_gtil2.cpp:12
pressure
uint8_t pressure
Definition
tt21100.cpp:7
Generated by
1.12.0