diff --git a/waveshare-esp32-s3-relay-6ch.yaml b/waveshare-esp32-s3-relay-6ch.yaml new file mode 100644 index 0000000..7fe630f --- /dev/null +++ b/waveshare-esp32-s3-relay-6ch.yaml @@ -0,0 +1,169 @@ +substitutions: + name: waveshare-esp32-s3-relay-6ch + friendly_name: Waveshare Relay Board + area: "" + +esphome: + name: ${name} + friendly_name: ${friendly_name} + area: ${area} + name_add_mac_suffix: true + project: + name: waveshare.esp32-s3-relay-6ch + version: 1.0.0 + +esp32: + board: esp32-s3-devkitc-1 + framework: + type: arduino + +# Enable logging +logger: + +# Enable Home Assistant API +api: + services: + - service: play_rtttl + variables: + song_str: string + then: + - rtttl.play: + rtttl: !lambda "return song_str;" + +ota: + - platform: esphome + id: waveshare-esp32-s3-relay-6ch_ota + +wifi: + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: {} + +captive_portal: + +web_server: + port: 80 + +dashboard_import: + package_import_url: github://ryansch/esphome-config/waveshare-esp32-s3-relay-6ch.yaml + +time: + - platform: homeassistant + id: homeassistant_time + +binary_sensor: + - platform: status + name: "Status" + + - platform: gpio + name: "Boot Button" + pin: + number: 0 + ignore_strapping_warning: true + mode: + input: true + inverted: true + disabled_by_default: true + on_press: + then: + - button.press: restart_button + +text_sensor: + - platform: version + name: "Firmware Version" + - platform: wifi_info + ip_address: + name: "IP Address" + entity_category: diagnostic + ssid: + name: "Connected SSID" + entity_category: diagnostic + mac_address: + name: "Mac Address" + entity_category: diagnostic + +switch: + - platform: gpio + pin: GPIO1 + id: relay1 + name: Relay 1 + - platform: gpio + pin: GPIO2 + id: relay2 + name: Relay 2 + - platform: gpio + pin: GPIO41 + id: relay3 + name: Relay 3 + - platform: gpio + pin: GPIO42 + id: relay4 + name: Relay 4 + - platform: gpio + pin: + number: GPIO45 + ignore_strapping_warning: true + id: relay5 + name: Relay 5 + - platform: gpio + pin: + number: GPIO46 + ignore_strapping_warning: true + id: relay6 + name: Relay 6 + +uart: + tx_pin: GPIO17 + rx_pin: GPIO18 + baud_rate: 115200 + +# buzzer +output: + - platform: ledc + pin: GPIO21 + id: buzzer + +rtttl: + output: buzzer + id: rtttl_buzzer + gain: 30% + +light: + - platform: neopixelbus + type: RGB + variant: 800KBPS + pin: GPIO38 + num_leds: 1 + name: "RGB LED" + id: rgb_led + +button: + - platform: restart + name: "Restart" + id: restart_button + entity_category: config + + - platform: factory_reset + name: "Factory Reset" + id: reset + entity_category: config + + - platform: safe_mode + name: "Safe Mode" + internal: false + entity_category: config + +sensor: + - platform: wifi_signal + name: "WiFi Signal" + id: wifi_signal_db + update_interval: 60s + entity_category: diagnostic + + # Reports the WiFi signal strength in % + - platform: copy + source_id: wifi_signal_db + name: "WiFi Strength" + filters: + - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0); + unit_of_measurement: "%" + entity_category: diagnostic