#
-# https://www.aliexpress.com/item/1005004099215436.html
+# https://shop.m5stack.com/products/atoms3-lite-esp32s3-dev-kit
#
-# GPIO23: Onboard blue LED (used to show MQTT connectivity)
-# GPIO16: Onboard relay (bathroom fan)
-# GPIO13: DHT22
+# GPIO41: Pushbutton
+# GPIO35: W2812 LED
+# GPIO1: HX711 SCK
+# GPIO2: HX711 DOUT
esphome:
name: softener
+ name_add_mac_suffix: false
+ on_boot:
+ then:
+ - light.turn_on:
+ id: led
+ red: 100%
+ green: 0%
+ blue: 0%
esp32:
- board: esp32-gateway
+ board: esp32-s3-devkitc-1
+ variant: esp32s3
framework:
- type: arduino
+ type: esp-idf
+ version: 5.0.2
+ platform_version: 6.3.2
# Enable logging
logger:
level: DEBUG
ota:
+ platform: esphome
password: !secret ota_upgrade_pw
external_components:
components: [syslog]
wifi:
- ssid: !secret wifi_ssid
- password: !secret wifi_pw
+ power_save_mode: none
+ networks:
+ - ssid: !secret wifi_ssid
+ password: !secret wifi_pw
+ bssid: !secret wndr3800_bssid
+ priority: 1
+ - ssid: !secret wifi_ssid
+ password: !secret wifi_pw
script:
# Publish a value to Domoticz as an nvalue
#captive_portal:
syslog:
- ip_address: !secret syslog_ip
+ ip_address: !secret syslog_ipv6
time:
- platform: sntp
id: sntp_time
servers: !secret ntp_servers
-#network:
-# enable_ipv6: true
+
+network:
+ enable_ipv6: true
mqtt:
broker: !secret mqtt_server
id: mqtt_client
on_connect:
then:
- - light.turn_on: blue_led
-
+ - light.turn_on:
+ id: led
+ blue: 100%
+ red: 0%
+ green: 0%
on_disconnect:
then:
- - light.turn_off: blue_led
+ - light.turn_on:
+ id: led
+ blue: 0%
+ red: 100%
+ green: 0%
+
+ on_json_message:
+ - topic: domoticz/out
+ then:
+ - lambda: |-
+ int idx = x["idx"];
+ int nvalue = x["nvalue"].as<int>();
-light:
- - platform: binary
- name: "Blue LED"
- id: blue_led
- output: led_output
+ // ESP_LOGD("on_json_message", x["name"]);
-output:
- - id: led_output
- platform: gpio
- pin: GPIO23
-switch:
+light:
+#G35=RGB WS2812C-2020
+ - platform: esp32_rmt_led_strip
+ name: Led
+ id: led
+ rgb_order: GRB
+ pin: 35
+ num_leds: 4
+ # RMT 0 channels will be occupied by IR
+ rmt_channel: 1
+ chipset: ws2812
+ restore_mode: ALWAYS_OFF
+
+#G41=Button
+binary_sensor:
- platform: gpio
- name: "Fan"
- id: fan_relay
- pin: GPIO16
+ name: Buttonw
+ id: g41button
+ pin:
+ number: GPIO41
+ inverted: true
+ mode:
+ input: true
+ pullup: true
+ filters:
+ - delayed_off: 10ms
+ # Toggle the switch when the pushbutton is pressed
+ on_press:
+ then:
+ - lambda: |-
+ ESP_LOGD("Button", "pressed");
+
sensor:
- platform: hx711
- dout_pin: GPIO13
- clk_pin: GPIO14
+ dout_pin:
+ number: GPIO2 # Orange
+ mode:
+ input: true
+ pullup: true
+ clk_pin: GPIO1 # Yellow
gain: 128
update_interval: 30s
name: "HX711 value"