Skip to content

Instantly share code, notes, and snippets.

View vladyspavlov's full-sized avatar

Vladyslav Pavlov vladyspavlov

View GitHub Profile
@vladyspavlov
vladyspavlov / dingtian-4ch.yaml
Last active November 11, 2024 20:43
ESPHome config for Dingtian 4CH Relay (dtwonder DT-R004) + Modbus NPN IO extender module
esphome:
name: dingtian-4ch
friendly_name: Dingtian 4CH
comment: "ESP32-D0WD v1.0"
# Change NPN module modbus speed to 19200
# Baud rate corresponds to the number: 0: 1200 1: 2400 2: 4800 3: 9600 4: 19200
#on_boot:
# ## configure controller settings at setup
# ## make sure priority is lower than setup_priority of modbus_controller
# priority: -100
@vladyspavlov
vladyspavlov / battery-bms-invertor.yaml
Created October 8, 2023 21:24
SRNE/Easun SMX-II ESPHome configuration
substitutions:
name: "Bms"
invertor_id: "invertor"
invertor_name: "Invertor"
battery_coefficient: '2' # battery voltage / 12
multiply_10: '5' # 10 / battery_coefficient
updates: 5s
esphome:
name: battery-bms-invertor
@vladyspavlov
vladyspavlov / inverter-monitor.yaml
Last active November 9, 2024 21:00
Must inverter ESPHome configuration for ESP32
substitutions:
inverter_id: inverter
updates: 5s
api_key: xxx
ota_password: xxx
esphome:
name: inverter-monitor
comment: "Inverter monitor"
@vladyspavlov
vladyspavlov / telegram.yaml
Created November 2, 2023 21:37
ESPHome Telegram bot send message example
substitutions:
TELEGRAM_BOT_TOKEN: !secret telegram_bot_token
api_key: !secret api_key
ota_password: !secret ota_password
chat_id: xxxxxxxxx
esphome:
name: wemos
friendly_name: wemos
@vladyspavlov
vladyspavlov / timedelta.yaml
Created November 25, 2023 15:13
Home Assistant. Example of dividing time between entity last changes and converting to human readable
{% set td = trigger.to_state.last_changed - trigger.from_state.last_changed %}
{% set ts = td.total_seconds() | int %}
{% set hours, remainder = (ts // 3600, ts % 3600) %}
{% set minutes, seconds = (remainder // 60, remainder % 60) %}
Days: {{ td.days }}, hours: {{ hours }}, minutes: {{ minutes }}, seconds: {{ seconds }}
@vladyspavlov
vladyspavlov / 1ch-relay.yaml
Last active August 29, 2024 10:56
ESPHome configuration for 1-channel ESP32 relay from AliExpress with a 90-250VAC power supply. SZHJW ESP32_Relay_AC X1_V1.1 (303E32AC111)
# https://www.aliexpress.com/item/1005005848983315.html
# Pinout:
# GPIO0 - Button
# GPIO16 - Relay
# GPIO23 - LED
# ESP: ESP32-WROOM-32E (ESP32-D0WD V3, rev. 3.1)
substitutions:
name: 1ch-relay
friendly_name: 1CH Relay
@vladyspavlov
vladyspavlov / ld2410c.yaml
Created December 30, 2023 16:43
ESPHome configuration, LD2410C and Wemos D1 Mini Pro (ESP8266)
esphome:
name: ld2410c
friendly_name: ld2410c
esp8266:
board: d1_mini_pro
# Enable logging
logger: