{"id":13414413,"url":"https://github.com/mongoose-os-apps/sonoff-basic-openhab","last_synced_at":"2025-09-06T16:45:31.823Z","repository":{"id":70133059,"uuid":"99323584","full_name":"mongoose-os-apps/sonoff-basic-openhab","owner":"mongoose-os-apps","description":"A Sonoff Basic firmware to work with openHAB","archived":false,"fork":false,"pushed_at":"2020-08-20T19:03:22.000Z","size":460,"stargazers_count":22,"open_issues_count":1,"forks_count":8,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-18T06:51:18.992Z","etag":null,"topics":["esp32","esp8266","iot","mongoose-os","openhab","sonoff"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mongoose-os-apps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-08-04T08:48:32.000Z","updated_at":"2022-12-29T11:13:29.000Z","dependencies_parsed_at":"2023-02-23T10:31:14.824Z","dependency_job_id":null,"html_url":"https://github.com/mongoose-os-apps/sonoff-basic-openhab","commit_stats":null,"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongoose-os-apps%2Fsonoff-basic-openhab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongoose-os-apps%2Fsonoff-basic-openhab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongoose-os-apps%2Fsonoff-basic-openhab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongoose-os-apps%2Fsonoff-basic-openhab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mongoose-os-apps","download_url":"https://codeload.github.com/mongoose-os-apps/sonoff-basic-openhab/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250522291,"owners_count":21444509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esp32","esp8266","iot","mongoose-os","openhab","sonoff"],"created_at":"2024-07-30T21:00:20.824Z","updated_at":"2025-04-23T21:44:31.488Z","avatar_url":"https://github.com/mongoose-os-apps.png","language":"JavaScript","funding_links":[],"categories":["Awesome Mongoose OS [![Awesome](https://awesome.re/badge.svg)](https://awesome.re)"],"sub_categories":["Official Examples"],"readme":"## A Sonoff Basic firmware to work with openHAB\n\nThis firmware drives Sonoff Basic from [iTead Studio](https://www.itead.cc/),\nand powered by [Mongoose OS](https://mongoose-os.com/).\nIt targets to work with openHAB 2.4 or newer using the MQTT binding.\n\n### Features\n\n* LED blink pattern to indicate connectivity\n* On board button to toggle the switch manually in case of no connectivity\n* Bounce protection\n* Device local schedule timer\n* Countdown timer to toggle the switch\n* Switch ON duration counter for energy consumption analysis\n* Night Mode to turn off status LED\n* Web interface for setting up WiFi SSID and password\n* Reset to firmware defaults by holding the on board button for over 5 seconds\n\n### Configuration options\n\nYou have 2 options to implement this firmware:\n\n1. automatic configuration by Homie Convention\n\n[Homie Convention](https://homieiot.github.io/) enables auto-discovery of the device by openHAB.\nThings, Channels and Items will be automatically setup.\n\n2. manual configuration with text files\n\n### openHAB UI\n\n![openHAB UI](images/openhab-ui.jpg)\n\n![energy consumption chart](images/energy-chart.png \"energy consumption chart\")\n\n### Build for Homie support\n\nBuild using default cloud service:\n\n```\ncat mos-homie.yml \u003e mos.yml\nmos build --platform esp8266 \\\n  --build-var FLASH_SIZE=1048576 --build-var BOARD=esp8266-1M\n```\n\n### Build for manual configuration\n\nBuild using default cloud service:\n\n```\ncat mos-manual.yml \u003e mos.yml\nmos build --platform esp8266 \\\n  --build-var FLASH_SIZE=1048576 --build-var BOARD=esp8266-1M\n```\n\n### Flash\n\nSonoff Basic has only 1Mbytes flash.\n\n\tmos flash --esp-flash-params \"dout,8m,40m\"\n\n### WiFi Setup\n\n1. Switch your PC or smartphone to the device's WiFi network. The SSID is named like **Sonoff_??????**,\nand the password is `SonoffBasic`.\n\n2. Use your browser to open http://192.168.4.1/\n\n### openHAB Configuration\n\nIf you choose the manual configration option, please check the `manual` folder.\n\n### Local schedule timer\n\nBefore using the local timer, make sure to set correct time zone via `timer.tz`.\n\nFor Example, a Hong Kong user:\n\n    mos config-set timer.tz=+0800\n\nAnd a user in California (DST):\n\n    mos config-set timer.tz=-0700\n\nThen, create a JSON file `schedules.json` and upload to the filesystem. Please reference the\nsupplied sample for syntax.\n\n### Countdown timer\n\nWhen the countdown timer reached zero, the switch will be toggled.\n\nThe local schedule timer will be disabled until the countdown is completed.\n\nThis timer is not persisted across reboots.\n\n### Night Mode\n\nExample: set night mode from 23:00 to 6:30:\n    \n\tmos config-set nm.enable=true nm.bh=23 nm.bm=0 nm.eh=6 nm.em=30\n\n### Reset to firmware defaults\n\nPress and hold the on board button for over 5 seconds.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmongoose-os-apps%2Fsonoff-basic-openhab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmongoose-os-apps%2Fsonoff-basic-openhab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmongoose-os-apps%2Fsonoff-basic-openhab/lists"}