ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
honeywellabp2.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
7#include "esphome/core/hal.h"
9
11
13
15 SUB_SENSOR(pressure)
16 SUB_SENSOR(temperature)
17
18 public:
19 void loop() override;
20 void update() override;
21 void dump_config() override;
22
23 void read_sensor_data();
24 void start_measurement();
25 bool is_measurement_ready();
26 void measurement_timeout();
27
28 float get_pressure();
29 float get_temperature();
30
31 void set_min_pressure(float min_pressure) { this->min_pressure_ = min_pressure; };
32 void set_max_pressure(float max_pressure) { this->max_pressure_ = max_pressure; };
33 void set_transfer_function(ABP2TRANFERFUNCTION transfer_function);
34
35 protected:
36 float min_pressure_ = 0.0;
37 float max_pressure_ = 0.0;
39
40 const float max_count_a_ = 15099494.4; // (90% of 2^24 counts or 0xE66666)
41 const float min_count_a_ = 1677721.6; // (10% of 2^24 counts or 0x19999A)
42 const float max_count_b_ = 11744051.2; // (70% of 2^24 counts or 0xB33333)
43 const float min_count_b_ = 5033164.8; // (30% of 2^24 counts or 0x4CCCCC)
44
48
49 uint8_t raw_data_[7]; // holds output data
50 uint8_t i2c_cmd_[3] = {0xAA, 0x00, 0x00}; // command to be sent
53};
54
55} // namespace esphome::honeywellabp2_i2c
virtual void loop()
This method will be called repeatedly.
Definition component.cpp:86
This class simplifies creating components that periodically check a state.
Definition component.h:532
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:144
uint16_t temperature
Definition sun_gtil2.cpp:12
uint8_t pressure
Definition tt21100.cpp:7