Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ESPHOME config for MOES 2 Gang WiFi Dimmer
substitutions:
device_name: 2-gang-dimmer
device_description: MOES 2 Gang WiFi Dimmer
friendly_name: Living Room Dimmer
esphome:
name: ${device_name}
comment: ${device_description}
esp8266:
board: esp01_1m
restore_from_flash: true
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: true
#use_address: "x.x.x.x"
ap: #AP mode if no WiFi connection could be made
ssid: ${friendly_name} AP
password: !secret ap_password
captive_portal:
web_server:
port: 80
auth:
username: !secret web_server_username
password: !secret web_server_password
# Make sure logging is not using the serial port
logger:
baud_rate: 0
uart:
rx_pin: GPIO3
tx_pin: GPIO1
baud_rate: 9600
time:
- platform: homeassistant
id: homeassistant_time
# Register the Tuya MCU connection
tuya:
time_id: homeassistant_time
api:
password: !secret api_password
ota:
password: !secret ota_password
#[14:58:28][C][tuya:041]: Datapoint 6: int value (value: 0)
#[14:58:28][C][tuya:041]: Datapoint 12: int value (value: 0)
#[14:58:54][D][tuya:255]: Datapoint 1 update to OFF
#[14:58:54][D][tuya:263]: Datapoint 2 update to 1000
#[14:59:26][D][tuya:255]: Datapoint 7 update to OFF
#[14:59:26][D][tuya:263]: Datapoint 8 update to 1000
light:
- platform: "tuya"
id: light_switch1
name: ${friendly_name} 1
dimmer_datapoint: 2
#min_value_datapoint: 2
switch_datapoint: 1
min_value: 0
max_value: 1000
- platform: "tuya"
id: light_switch2
name: ${friendly_name} 2
dimmer_datapoint: 8
min_value: 0
max_value: 1000
#min_value_datapoint: 2
switch_datapoint: 7
binary_sensor:
- platform: status
name: ${device_name} HA connection status
- platform: gpio
pin: GPIO04
id: button
internal: true
filters:
- delayed_on_off: 50ms
on_state:
- light.toggle: light_switch1
- platform: gpio
pin: GPIO05
id: switch_input
internal: true
filters:
- delayed_on_off: 50ms
on_state:
- light.toggle: light_switch2
substitutions:
device_name: 2-gang-dimmer
device_description: MOES 2 Gang WiFi Dimmer
friendly_name: Living Room Dimmer
esphome:
name: ${device_name}
comment: ${device_description}
esp8266:
board: esp01_1m
restore_from_flash: true
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: true
#use_address: "x.x.x.x"
ap: #AP mode if no WiFi connection could be made
ssid: ${friendly_name} AP
password: !secret ap_password
captive_portal:
web_server:
port: 80
auth:
username: !secret web_server_username
password: !secret web_server_password
# Make sure logging is not using the serial port
logger:
baud_rate: 0
uart:
rx_pin: GPIO3
tx_pin: GPIO1
baud_rate: 9600
time:
- platform: homeassistant
id: homeassistant_time
# Register the Tuya MCU connection
tuya:
time_id: homeassistant_time
api:
password: !secret api_password
ota:
password: !secret ota_password
#[14:58:28][C][tuya:041]: Datapoint 6: int value (value: 0)
#[14:58:28][C][tuya:041]: Datapoint 12: int value (value: 0)
#[14:58:54][D][tuya:255]: Datapoint 1 update to OFF
#[14:58:54][D][tuya:263]: Datapoint 2 update to 1000
#[14:59:26][D][tuya:255]: Datapoint 7 update to OFF
#[14:59:26][D][tuya:263]: Datapoint 8 update to 1000
light:
- platform: "tuya"
name: ${friendly_name} 1
dimmer_datapoint: 2
#min_value_datapoint: 2
switch_datapoint: 1
min_value: 0
max_value: 1000
- platform: "tuya"
name: ${friendly_name} 2
dimmer_datapoint: 8
min_value: 0
max_value: 1000
#min_value_datapoint: 2
switch_datapoint: 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment