Hi, after one of the latest update, November 2022, one of my project doesn’t compile/validate anymore.
I’m reading an ADC value from 0 to 2V from an analogue sensor. I’m using a Heltek wifi kit 32 v2:
esphome:
name: livello-pozzo
esp32:
board: heltec_wifi_kit_32_v2
framework:
type: arduino
web_server:
port: 80
ota:
password: "xxxxxxxxxxxxxxxxxxxxxx"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "Livello-Pozzo Fallback Hotspot"
captive_portal:
sensor:
- platform: adc
id: cj_ybt_analog
name: "Ingresso analogico CJ-YBT"
unit_of_measurement: "V"
pin: GPIO32
update_interval: 60s
accuracy_decimals: 2
attenuation: auto
- platform: template
id: livello_pozzo
name: Livello pozzo
unit_of_measurement: "L"
accuracy_decimals: 0
lambda: 'return ((id(cj_ybt_analog).state ) * 6500)-400;'
filters:
- median:
window_size: 20
send_every: 10
send_first_at: 5
- platform: homeassistant
id: livello_pozzo_ha
entity_id: sensor.livello_pozzo
unit_of_measurement: "L"
internal: true
i2c:
sda: GPIO4
scl: GPIO15
scan: false
frequency: 700khz
font:
- file: 'arialblk.ttf'
id: font1
size: 20
- file: 'arial.ttf'
id: font2
size: 12
- file: 'arial.ttf'
id: font3
size: 8
image:
- file: "icona-pozzo.png"
id: icona_pozzo
resize: 100x100
- file: "wifi.png"
id: icona_wifi
interval:
- interval: 10s
then:
- component.update: my_display
display:
- platform: ssd1306_i2c
model: "SSD1306 128x64"
reset_pin: GPIO16
address: 0x3C
id: my_display
lambda: |-
it.rectangle(2, 2, 125, 61);
it.printf(84, 5, id(font2), TextAlign::TOP_CENTER, "Livello Pozzo");
it.image(8, 17, id(icona_pozzo));
it.printf(115, 50, id(font1), TextAlign::BASELINE_RIGHT , "%.f", id(livello_pozzo).state);
condition:
api.connected:
then:
- it.image(1, 1, id(icona_wifi));
Whatever I change in the captive portal I got this error:
INFO Reading configuration /config/esphome/livello-pozzo.yaml...
ERROR Unexpected exception while reading configuration:
Traceback (most recent call last):
File "/usr/local/bin/esphome", line 33, in <module>
sys.exit(load_entry_point('esphome', 'console_scripts', 'esphome')())
File "/esphome/esphome/__main__.py", line 955, in main
return run_esphome(sys.argv)
File "/esphome/esphome/__main__.py", line 933, in run_esphome
config = read_config(dict(args.substitution) if args.substitution else {})
File "/esphome/esphome/config.py", line 977, in read_config
res = load_config(command_line_substitutions)
File "/esphome/esphome/config.py", line 831, in load_config
return _load_config(command_line_substitutions)
File "/esphome/esphome/config.py", line 819, in _load_config
result = validate_config(config, command_line_substitutions)
File "/esphome/esphome/config.py", line 747, in validate_config
result.run_validation_steps()
File "/esphome/esphome/config.py", line 123, in run_validation_steps
task.step.run(self)
File "/esphome/esphome/config.py", line 489, in run
validated = schema(input_conf)
File "/esphome/esphome/voluptuous_schema.py", line 34, in __call__
res = super().__call__(data)
File "/usr/local/lib/python3.9/dist-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
File "/usr/local/lib/python3.9/dist-packages/voluptuous/validators.py", line 229, in _run
return self._exec(self._compiled, value, path)
File "/usr/local/lib/python3.9/dist-packages/voluptuous/validators.py", line 353, in _exec
v = func(path, v)
File "/usr/local/lib/python3.9/dist-packages/voluptuous/schema_builder.py", line 818, in validate_callable
return schema(data)
File "/esphome/esphome/voluptuous_schema.py", line 34, in __call__
res = super().__call__(data)
File "/usr/local/lib/python3.9/dist-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
File "/usr/local/lib/python3.9/dist-packages/voluptuous/schema_builder.py", line 595, in validate_dict
return base_validate(path, iteritems(data), out)
File "/esphome/esphome/voluptuous_schema.py", line 148, in validate_mapping
cval = cvalue(key_path, value)
File "/usr/local/lib/python3.9/dist-packages/voluptuous/schema_builder.py", line 818, in validate_callable
return schema(data)
File "/esphome/esphome/components/adc/sensor.py", line 101, in validate_adc_pin
value = pins.internal_gpio_input_pin_number(value)
File "/esphome/esphome/pins.py", line 76, in validator
return PIN_SCHEMA_REGISTRY[CORE.target_platform][1](value_d)[CONF_NUMBER]
File "/usr/local/lib/python3.9/dist-packages/voluptuous/validators.py", line 232, in __call__
return self._exec((Schema(val) for val in self.validators), v)
File "/usr/local/lib/python3.9/dist-packages/voluptuous/validators.py", line 351, in _exec
v = func(v)
File "/usr/local/lib/python3.9/dist-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
File "/usr/local/lib/python3.9/dist-packages/voluptuous/schema_builder.py", line 595, in validate_dict
return base_validate(path, iteritems(data), out)
File "/usr/local/lib/python3.9/dist-packages/voluptuous/schema_builder.py", line 387, in validate_mapping
cval = cvalue(key_path, value)
File "/usr/local/lib/python3.9/dist-packages/voluptuous/schema_builder.py", line 818, in validate_callable
return schema(data)
File "/esphome/esphome/components/esp32/gpio.py", line 111, in validate_gpio_pin
if value in board_pins.values():
AttributeError: 'str' object has no attribute 'values'
I have found anything in the release notes that could be related…
Someone had a similar problem?