ESPHome 2025.9.0-dev
Loading...
Searching...
No Matches
airthings_wave_plus.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef USE_ESP32
4
6
7namespace esphome {
8namespace airthings_wave_plus {
9
11
12enum WaveDeviceType : uint8_t { WAVE_PLUS = 0, WAVE_GEN2 = 1 };
13
14static const char *const SERVICE_UUID = "b42e1c08-ade7-11e4-89d3-123b93f75cba";
15static const char *const CHARACTERISTIC_UUID = "b42e2a68-ade7-11e4-89d3-123b93f75cba";
16static const char *const ACCESS_CONTROL_POINT_CHARACTERISTIC_UUID = "b42e2d06-ade7-11e4-89d3-123b93f75cba";
17
18static const char *const SERVICE_UUID_WAVE_RADON_GEN2 = "b42e4a8e-ade7-11e4-89d3-123b93f75cba";
19static const char *const CHARACTERISTIC_UUID_WAVE_RADON_GEN2 = "b42e4dcc-ade7-11e4-89d3-123b93f75cba";
20static const char *const ACCESS_CONTROL_POINT_CHARACTERISTIC_UUID_WAVE_RADON_GEN2 =
21 "b42e50d8-ade7-11e4-89d3-123b93f75cba";
22
24 public:
25 void setup() override;
26
27 void dump_config() override;
28
29 void set_radon(sensor::Sensor *radon) { radon_sensor_ = radon; }
30 void set_radon_long_term(sensor::Sensor *radon_long_term) { radon_long_term_sensor_ = radon_long_term; }
31 void set_co2(sensor::Sensor *co2) { co2_sensor_ = co2; }
32 void set_illuminance(sensor::Sensor *illuminance) { illuminance_sensor_ = illuminance; }
33 void set_device_type(WaveDeviceType wave_device_type) { wave_device_type_ = wave_device_type; }
34
35 protected:
36 bool is_valid_radon_value_(uint16_t radon);
37 bool is_valid_co2_value_(uint16_t co2);
38
39 void read_sensors(uint8_t *raw_value, uint16_t value_len) override;
41
46
48 uint8_t version;
49 uint8_t humidity;
50 uint8_t ambientLight;
51 uint8_t unused01;
52 uint16_t radon;
53 uint16_t radon_lt;
54 uint16_t temperature;
55 uint16_t pressure;
56 uint16_t co2;
57 uint16_t voc;
58 };
59};
60
61} // namespace airthings_wave_plus
62} // namespace esphome
63
64#endif // USE_ESP32
void read_sensors(uint8_t *raw_value, uint16_t value_len) override
void set_radon_long_term(sensor::Sensor *radon_long_term)
void set_device_type(WaveDeviceType wave_device_type)
void set_illuminance(sensor::Sensor *illuminance)
Base-class for all sensors.
Definition sensor.h:59
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7