Dear,
it is still possible to use SHT temperature& humidity sensor with latest version EspHome?
I tried to update my old configuration and got such error:
To be honest I don’t change a single line related to sht1x.
Compiling /data/sht1x/.pioenvs/sht1x/src/SHT1x.cpp.o
Compiling /data/sht1x/.pioenvs/sht1x/src/main.cpp.o
Compiling /data/sht1x/.pioenvs/sht1x/src/sht1x.cpp.o
Compiling /data/sht1x/.pioenvs/sht1x/lib975/ESPAsyncTCP-esphome/ESPAsyncTCP.cpp.o
In file included from src/SHT1x.cpp:1:
src/SHT1x.h:25:17: error: 'GPIOPin' has not been declared
25 | void set_data(GPIOPin *pin) { data = pin; }
| ^~~~~~~
src/SHT1x.h:26:18: error: 'GPIOPin' has not been declared
26 | void set_clock(GPIOPin *pin) { clock = pin; }
| ^~~~~~~
src/SHT1x.h:29:3: error: 'GPIOPin' does not name a type
29 | GPIOPin *data;
| ^~~~~~~
src/SHT1x.h:30:3: error: 'GPIOPin' does not name a type
30 | GPIOPin *clock;
| ^~~~~~~
src/SHT1x.h:32:3: error: 'SHT1x' does not name a type
32 | SHT1x *sht1x_;
| ^~~~~
src/SHT1x.h: In constructor 'esphome::sht1x::SHT1XSensor::SHT1XSensor(int, int)':
src/SHT1x.h:15:24: error: expected type-specifier before 'GPIOPin'
15 | this->set_data(new GPIOPin(data, INPUT, false));
| ^~~~~~~
src/SHT1x.h:16:25: error: expected type-specifier before 'GPIOPin'
16 | this->set_clock(new GPIOPin(clock, INPUT, false));
| ^~~~~~~
src/SHT1x.h: In member function 'void esphome::sht1x::SHT1XSensor::set_data(int*)':
src/SHT1x.h:25:33: error: 'data' was not declared in this scope; did you mean 'std::data'?
25 | void set_data(GPIOPin *pin) { data = pin; }
| ^~~~
| std::data
In file included from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/string:54,
from src/esphome/core/component.h:3,
from src/SHT1x.h:3,
from src/SHT1x.cpp:1:
/data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/range_access.h:319:5: note: 'std::data' declared here
319 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
In file included from src/SHT1x.cpp:1:
src/SHT1x.h: In member function 'void esphome::sht1x::SHT1XSensor::set_clock(int*)':
src/SHT1x.h:26:34: error: 'clock' was not declared in this scope; did you mean 'clock_t'?
26 | void set_clock(GPIOPin *pin) { clock = pin; }
| ^~~~~
| clock_t
In file included from src/esphome/components/sensor/sensor.h:3,
from src/SHT1x.h:4,
from src/SHT1x.cpp:1:
src/SHT1x.cpp: In member function 'virtual void esphome::sht1x::SHT1XSensor::setup()':
src/SHT1x.cpp:13:51: error: 'class esphome::sht1x::SHT1XSensor' has no member named 'data'
13 | ESP_LOGCONFIG(TAG, "Data pin is '%d'...", this->data->get_pin());
| ^~~~
src/esphome/core/log.h:94:90: note: in definition of macro 'esph_log_config'
94 | esp_log_printf_(ESPHOME_LOG_LEVEL_CONFIG, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
| ^~~~~~~~~~~
src/SHT1x.cpp:13:3: note: in expansion of macro 'ESP_LOGCONFIG'
13 | ESP_LOGCONFIG(TAG, "Data pin is '%d'...", this->data->get_pin());
| ^~~~~~~~~~~~~
src/SHT1x.cpp:14:52: error: 'class esphome::sht1x::SHT1XSensor' has no member named 'clock'
14 | ESP_LOGCONFIG(TAG, "Clock pin is '%d'...", this->clock->get_pin());
| ^~~~~
src/esphome/core/log.h:94:90: note: in definition of macro 'esph_log_config'
94 | esp_log_printf_(ESPHOME_LOG_LEVEL_CONFIG, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
| ^~~~~~~~~~~
src/SHT1x.cpp:14:3: note: in expansion of macro 'ESP_LOGCONFIG'
14 | ESP_LOGCONFIG(TAG, "Clock pin is '%d'...", this->clock->get_pin());
| ^~~~~~~~~~~~~
src/SHT1x.cpp:15:9: error: 'class esphome::sht1x::SHT1XSensor' has no member named 'sht1x_'
15 | this->sht1x_ = new SHT1x(this->data->get_pin(), this->clock->get_pin());
| ^~~~~~
src/SHT1x.cpp:15:22: error: expected type-specifier before 'SHT1x'
15 | this->sht1x_ = new SHT1x(this->data->get_pin(), this->clock->get_pin());
| ^~~~~
src/SHT1x.cpp: In member function 'virtual void esphome::sht1x::SHT1XSensor::update()':
src/SHT1x.cpp:20:22: error: 'class esphome::sht1x::SHT1XSensor' has no member named 'sht1x_'
20 | float temp = this->sht1x_->readTemperatureC();
| ^~~~~~
src/SHT1x.cpp:24:26: error: 'class esphome::sht1x::SHT1XSensor' has no member named 'sht1x_'
24 | float humidity = this->sht1x_->readHumidity();
| ^~~~~~
*** [/data/sht1x/.pioenvs/sht1x/src/SHT1x.cpp.o] Error 1
In file included from src/sht1x.h:5,
from src/sht1x.cpp:1:
src/SHT1x.h:25:17: error: 'GPIOPin' has not been declared
25 | void set_data(GPIOPin *pin) { data = pin; }
| ^~~~~~~
src/SHT1x.h:26:18: error: 'GPIOPin' has not been declared
26 | void set_clock(GPIOPin *pin) { clock = pin; }
| ^~~~~~~
src/SHT1x.h:29:3: error: 'GPIOPin' does not name a type
29 | GPIOPin *data;
| ^~~~~~~
src/SHT1x.h:30:3: error: 'GPIOPin' does not name a type
30 | GPIOPin *clock;
| ^~~~~~~
src/SHT1x.h:32:3: error: 'SHT1x' does not name a type
32 | SHT1x *sht1x_;
| ^~~~~
src/SHT1x.h: In constructor 'esphome::sht1x::SHT1XSensor::SHT1XSensor(int, int)':
src/SHT1x.h:15:24: error: expected type-specifier before 'GPIOPin'
15 | this->set_data(new GPIOPin(data, INPUT, false));
| ^~~~~~~
src/SHT1x.h:16:25: error: expected type-specifier before 'GPIOPin'
16 | this->set_clock(new GPIOPin(clock, INPUT, false));
| ^~~~~~~
src/SHT1x.h: In member function 'void esphome::sht1x::SHT1XSensor::set_data(int*)':
src/SHT1x.h:25:33: error: 'data' was not declared in this scope; did you mean 'std::data'?
25 | void set_data(GPIOPin *pin) { data = pin; }
| ^~~~
| std::data
In file included from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/string:54,
from src/esphome/core/component.h:3,
from src/sht1x.h:3,
from src/sht1x.cpp:1:
/data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/range_access.h:319:5: note: 'std::data' declared here
319 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
In file included from src/sht1x.h:5,
from src/sht1x.cpp:1:
src/SHT1x.h: In member function 'void esphome::sht1x::SHT1XSensor::set_clock(int*)':
src/SHT1x.h:26:34: error: 'clock' was not declared in this scope; did you mean 'clock_t'?
26 | void set_clock(GPIOPin *pin) { clock = pin; }
| ^~~~~
| clock_t
In file included from src/sht1x.cpp:1:
src/sht1x.h: At global scope:
src/sht1x.h:11:7: error: redefinition of 'class esphome::sht1x::SHT1XSensor'
11 | class SHT1XSensor : public sensor::Sensor, public PollingComponent {
| ^~~~~~~~~~~
In file included from src/sht1x.h:5,
from src/sht1x.cpp:1:
src/SHT1x.h:11:7: note: previous definition of 'class esphome::sht1x::SHT1XSensor'
11 | class SHT1XSensor : public sensor::Sensor, public PollingComponent {
| ^~~~~~~~~~~
In file included from src/esphome/components/sensor/sensor.h:3,
from src/sht1x.h:4,
from src/sht1x.cpp:1:
src/sht1x.cpp: In member function 'virtual void esphome::sht1x::SHT1XSensor::setup()':
src/sht1x.cpp:13:51: error: 'class esphome::sht1x::SHT1XSensor' has no member named 'data'
13 | ESP_LOGCONFIG(TAG, "Data pin is '%d'...", this->data->get_pin());
| ^~~~
src/esphome/core/log.h:94:90: note: in definition of macro 'esph_log_config'
94 | esp_log_printf_(ESPHOME_LOG_LEVEL_CONFIG, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
| ^~~~~~~~~~~
src/sht1x.cpp:13:3: note: in expansion of macro 'ESP_LOGCONFIG'
13 | ESP_LOGCONFIG(TAG, "Data pin is '%d'...", this->data->get_pin());
| ^~~~~~~~~~~~~
src/sht1x.cpp:14:52: error: 'class esphome::sht1x::SHT1XSensor' has no member named 'clock'
14 | ESP_LOGCONFIG(TAG, "Clock pin is '%d'...", this->clock->get_pin());
| ^~~~~
src/esphome/core/log.h:94:90: note: in definition of macro 'esph_log_config'
94 | esp_log_printf_(ESPHOME_LOG_LEVEL_CONFIG, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
| ^~~~~~~~~~~
src/sht1x.cpp:14:3: note: in expansion of macro 'ESP_LOGCONFIG'
14 | ESP_LOGCONFIG(TAG, "Clock pin is '%d'...", this->clock->get_pin());
| ^~~~~~~~~~~~~
src/sht1x.cpp:15:9: error: 'class esphome::sht1x::SHT1XSensor' has no member named 'sht1x_'
15 | this->sht1x_ = new SHT1x(this->data->get_pin(), this->clock->get_pin());
| ^~~~~~
src/sht1x.cpp:15:22: error: expected type-specifier before 'SHT1x'
15 | this->sht1x_ = new SHT1x(this->data->get_pin(), this->clock->get_pin());
| ^~~~~
src/sht1x.cpp: In member function 'virtual void esphome::sht1x::SHT1XSensor::update()':
src/sht1x.cpp:20:22: error: 'class esphome::sht1x::SHT1XSensor' has no member named 'sht1x_'
20 | float temp = this->sht1x_->readTemperatureC();
| ^~~~~~
src/sht1x.cpp:24:26: error: 'class esphome::sht1x::SHT1XSensor' has no member named 'sht1x_'
24 | float humidity = this->sht1x_->readHumidity();
| ^~~~~~
*** [/data/sht1x/.pioenvs/sht1x/src/sht1x.cpp.o] Error 1
In file included from src/main.cpp:25:
src/SHT1x.h:32:3: error: 'SHT1x' does not name a type
32 | SHT1x *sht1x_;
| ^~~~~
src/SHT1x.h: In constructor 'esphome::sht1x::SHT1XSensor::SHT1XSensor(int, int)':
src/SHT1x.h:15:50: error: invalid new-expression of abstract class type 'esphome::GPIOPin'
15 | this->set_data(new GPIOPin(data, INPUT, false));
| ^
In file included from src/esphome/core/hal.h:4,
from src/esphome/core/application.h:8,
from src/esphome/components/api/api_connection.h:4,
from src/esphome.h:3,
from src/main.cpp:3:
src/esphome/core/gpio.h:50:7: note: because the following virtual functions are pure within 'esphome::GPIOPin':
50 | class GPIOPin {
| ^~~~~~~
src/esphome/core/gpio.h:52:16: note: 'virtual void esphome::GPIOPin::setup()'
52 | virtual void setup() = 0;
| ^~~~~
src/esphome/core/gpio.h:54:16: note: 'virtual void esphome::GPIOPin::pin_mode(esphome::gpio::Flags)'
54 | virtual void pin_mode(gpio::Flags flags) = 0;
| ^~~~~~~~
src/esphome/core/gpio.h:56:16: note: 'virtual bool esphome::GPIOPin::digital_read()'
56 | virtual bool digital_read() = 0;
| ^~~~~~~~~~~~
src/esphome/core/gpio.h:58:16: note: 'virtual void esphome::GPIOPin::digital_write(bool)'
58 | virtual void digital_write(bool value) = 0;
| ^~~~~~~~~~~~~
src/esphome/core/gpio.h:60:23: note: 'virtual std::string esphome::GPIOPin::dump_summary() const'
60 | virtual std::string dump_summary() const = 0;
| ^~~~~~~~~~~~
In file included from src/main.cpp:25:
src/SHT1x.h:16:52: error: invalid new-expression of abstract class type 'esphome::GPIOPin'
16 | this->set_clock(new GPIOPin(clock, INPUT, false));
| ^
*** [/data/sht1x/.pioenvs/sht1x/src/main.cpp.o] Error 1
========================= [FAILED] Took 10.45 seconds =========================
thanks in advance
greetings
woojtekk