Git Product home page Git Product logo

sonoff-homie's Introduction

Homie based firmware for Sonoff Basic, Sonoff S20 wifi relay or any ESP8266 based relay.

Features:

  • ON/OFF relay
  • Timer based relay
  • Configurable default (on boot) relay state - (MQTT independent)
  • Local button on/off
  • Keepalive feature - device will reboot if not receive keepalive message in given time
  • Reverse mode - ON command means relay off, OFF command means relay on (configurable on Homie level)
  • Watchdog timer
  • All Homie buildin features (OTA,configuration)

Build and upload

  • Attache module via USB-RS232 adapter
  • Set proper serial port number in plantformio.ini file (upload_port variable)
  • reboot module into program mode
  • Flash module:
    • execute pio run --target upload --environment sonoff for SONOFF, pio run --target upload --environment sonoffs20 for SONOFF S20 or pio run --target upload --environment generic for generic ESP8266
    • In Atom editor with PlatformIO prees F7 enter environment name (sonoff or generic) and choose PIO uload option from the list

MQTT messages

Property Message format Direction Description
_HOMIE_PREFIX_/_node-id_/relay01/relayState (ON|OFF) Device → Controller Current state of relay
_HOMIE_PREFIX_/_node-id_/relay01/relayState/set (ON|OFF) Controller → Device Change relay state
_HOMIE_PREFIX_/_node-id_/relay01/relayTimer/set \d+ Controller → Device Turn on relay for specific no. of seconds
_HOMIE_PREFIX_/_node-id_/watchdog/timeOut/set \d+ Controller → Device Time after witch watchdog disable/enable output fo 10s
_HOMIE_PREFIX_/_node-id_/watchdog/tick/set \d+ Controller → Device Tick for watchdog - renew timeout of reset
_HOMIE_PREFIX_/_node-id_/keepalive/timeOut \d+ Device → Controller Report of keepalive timeout value (seconds), 0 - keep alive feature is not active
_HOMIE_PREFIX_/_node-id_/keepalive/timeOut/set \d+ Controller → Device Set Report of keepalive timeout in seconds, 0 - keep alive feature is not active
_HOMIE_PREFIX_/_node-id_/keepalive/tick/set .* Controller → Device Keepalive message from controller to gateway - if device will not receive during keepAliveTimeOut time slot, it will reboot, keepalive is not active when keepAliveTimeOut is equal 0
_HOMIE_PREFIX_/_node-id_/$online (true|false) Device → Controller /true when the device is online, false when the device is offline (through LWT)

sonoff-homie's People

Contributors

piotrc4 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.