Dear all,
I plan to read my smart meter via SML. Therefore, I bought an M5stack ATOM Lite (specs see here and pin assignment here) and implemented a first program (below) to test the device.
The code allows me to change the LED lights on GPIO 27 via the HA overview and this works fine, but for some reason I do not understand, the button on GPIO 39 does not respond to a press. When I press it, neither the state on the HA overview screen changes, no do I see any response in the log.
Note, I copied the relevant code from here and I assume it should work well from this tested example.
Did I do a stupid mistake below, or may I assume that the button is simply defective?
I use the following code
esphome:
name: smart-meter
compile_process_limit: 2
esp32:
board: m5stack-atom
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "xxxxxxxxxxxxxxxxxxxxx"
ota:
password: "xxxxxxxxxxxxxxxxxxxxxxxx"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Smart-Meter Fallback Hotspot"
password: "xxxxxxxxxxxxxxxxxxxx"
captive_portal:
## Device-specific
light:
- platform: neopixelbus
type: GRB
variant: WS2812
pin: 27
num_leds: 1
name: "Status LED"
id: status_led
effects:
- random:
- flicker:
- addressable_rainbow:
binary_sensor:
- platform: gpio
pin:
number: 39
inverted: false
name: Button
on_press:
then:
- light.toggle: status_led
uart:
id: uart_bus
rx_pin: 26
tx_pin: 32
baud_rate: 9600
data_bits: 8
parity: NONE
stop_bits: 1
#debug:
sml:
id: mysml
uart_id: uart_bus
sensor:
- platform: sml
name: "Zählwerk positive Wirkenergie, tariflos"
sml_id: mysml
obis_code: "1-0:1.8.0"
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
- platform: esp32_hall
name: "ESP32 Hall Sensor"
update_interval: 30sec
- platform: wifi_signal
name: "WiFi Signal Sensor"
update_interval: 2min
- platform: uptime
name: "Uptime"
text_sensor:
- platform: sml
name: "Hersteller-Kennung"
sml_id: mysml
obis_code: "129-129:199.130.3"
format: text
switch:
- platform: restart
name: "MCU Restart"
Thanks a lot for your assistance!