Skip to content

ESP Home Integration for Gosund SW2 Dimmer

License

Notifications You must be signed in to change notification settings

josemh/gosund-sw2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gosund SW2 Implementation for ESP Home

Features

  • Reading of the touch sensor
  • Integration via both ESP Home Native API & MQTT
  • Additional MQTT topic for setting the brightness without changing the state of the light
  • White LED turns on when the light is on
  • Green LED flashes when first powered until wifi connects

To use

  • Update devices/secrets.yaml
  • Update example_sw2.yaml with the id and friendly name for your switch. The id will be used as the hostname and id in Home Assistant.
  • Rename example_sw2.yaml
  • Consider disabling the web interface in devices/gosund_sw2_light.yaml
  • Compile with esphome
  • Flash

MQTT

The MQTT implementation uses the ESP Home's pattern for auto discovery. The topics for status and control of the light will be under {app}/light/{id}. Where {app} is the name of the yaml file without the extension, and {id} is the device_id inside the yaml file.

StateTopic: {app}/light/{id}/state

  • Payload is json formatted: {"state":"ON","brightness":255}

Command Topic: {app}/light/{id}/command

  • Same JSON formatting as the state topic
  • state is required and is either ON or OFF
  • brightness is optional with a range of 0-255

Brightness Command Topic: {app}/light/id/command/brightness_pct

  • Changes the brightness without changing the state of the light
  • Payload is an integer in the range of 1-100

About

ESP Home Integration for Gosund SW2 Dimmer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%