ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
ufire_ise.h
Go to the documentation of this file.
1#pragma once
2
4#include "esphome/core/hal.h"
7
8namespace esphome::ufire_ise {
9
10static const float PROBE_MV_TO_PH = 59.2;
11static const float PROBE_TMP_CORRECTION = 0.03;
12
13static const uint8_t CONFIG_TEMP_COMPENSATION = 0x02;
14
15static const uint8_t REGISTER_VERSION = 0;
16static const uint8_t REGISTER_MV = 1;
17static const uint8_t REGISTER_TEMP = 5;
18static const uint8_t REGISTER_REFHIGH = 13;
19static const uint8_t REGISTER_REFLOW = 17;
20static const uint8_t REGISTER_READHIGH = 21;
21static const uint8_t REGISTER_READLOW = 25;
22static const uint8_t REGISTER_SOLUTION = 29;
23static const uint8_t REGISTER_CONFIG = 38;
24static const uint8_t REGISTER_TASK = 39;
25
26static const uint8_t COMMAND_CALIBRATE_HIGH = 8;
27static const uint8_t COMMAND_CALIBRATE_LOW = 10;
28static const uint8_t COMMAND_MEASURE_TEMP = 40;
29static const uint8_t COMMAND_MEASURE_MV = 80;
30
32 public:
33 void setup() override;
34 void update() override;
35 void dump_config() override;
36
37 void set_temperature_sensor(sensor::Sensor *temperature_sensor) { this->temperature_sensor_ = temperature_sensor; }
39 this->temperature_sensor_external_ = temperature_sensor;
40 }
41 void set_ph_sensor(sensor::Sensor *ph_sensor) { this->ph_sensor_ = ph_sensor; }
42 void calibrate_probe_low(float solution);
43 void calibrate_probe_high(float solution);
44 void reset_board();
45
46 protected:
48 float measure_mv_();
49 float measure_ph_(float temperature);
50 void set_solution_(float solution);
51 float read_data_(uint8_t reg);
52 void write_data_(uint8_t reg, float data);
53 void update_internal_();
54
58};
59
60} // namespace esphome::ufire_ise
This class simplifies creating components that periodically check a state.
Definition component.h:519
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:144
I2CRegister reg(uint8_t a_register)
calls the I2CRegister constructor
Definition i2c.h:164
Base-class for all sensors.
Definition sensor.h:47
void set_temperature_sensor_external(sensor::Sensor *temperature_sensor)
Definition ufire_ise.h:38
void write_data_(uint8_t reg, float data)
sensor::Sensor * temperature_sensor_external_
Definition ufire_ise.h:56
void set_ph_sensor(sensor::Sensor *ph_sensor)
Definition ufire_ise.h:41
void calibrate_probe_low(float solution)
float measure_ph_(float temperature)
Definition ufire_ise.cpp:68
void calibrate_probe_high(float solution)
void set_temperature_sensor(sensor::Sensor *temperature_sensor)
Definition ufire_ise.h:37
uint16_t temperature
Definition sun_gtil2.cpp:12