Giter Site home page Giter Site logo

gosund-sw2's Introduction

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

gosund-sw2's People

Contributors

a-lost-shadow avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.