{"id":20445137,"url":"https://github.com/philrw/ecosmart-remote","last_synced_at":"2025-04-13T00:41:19.206Z","repository":{"id":92265479,"uuid":"135472661","full_name":"PhilRW/ecosmart-remote","owner":"PhilRW","description":"Remote control for EcoSmart tankless water heaters","archived":false,"fork":false,"pushed_at":"2022-10-20T16:45:17.000Z","size":21,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-26T18:43:44.288Z","etag":null,"topics":["ecosmart"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PhilRW.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-05-30T16:53:45.000Z","updated_at":"2024-01-05T00:46:02.000Z","dependencies_parsed_at":"2023-06-08T05:15:14.681Z","dependency_job_id":null,"html_url":"https://github.com/PhilRW/ecosmart-remote","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilRW%2Fecosmart-remote","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilRW%2Fecosmart-remote/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilRW%2Fecosmart-remote/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilRW%2Fecosmart-remote/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PhilRW","download_url":"https://codeload.github.com/PhilRW/ecosmart-remote/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650414,"owners_count":21139672,"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":["ecosmart"],"created_at":"2024-11-15T10:11:07.603Z","updated_at":"2025-04-13T00:41:19.186Z","avatar_url":"https://github.com/PhilRW.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ecosmart-remote\n\nThis project is based largely on the work performed by [Ryan Griggs](https://github.com/ryangriggs/EcoSmartLib) to [decode](https://electronics.stackexchange.com/questions/233374/reverse-engineering-asynchronous-serial-protocol-for-ecosmart-tankless-water-hea) the EcoSmart remote control interface protocol.\n\nEcoSmart has long since stopped selling [remote controls](https://www.amazon.com/Ecosmart-US-ECO-RC-Control/dp/B005R41ZAS) for their [electric tankless water heaters](https://www.ecosmartus.com/), but that doesn't mean that the remote protocol doesn't work anymore. In fact, it still works and with a little patience and ingenuity you can incorporate the EcoSmart tankless water heater into your [home automation system](https://www.home-assistant.io/).\n\n## Decoding the protocol\n\nThe protocol as so far determined is as such:\n\nseq.              | µs duration | mark or space | note\n------------------|-------------|---------------|------\n1                 | 7000        | mark          | header/sync\n2                 | 4000        | space         | header/sync\n3,5,7...81        | 2400 / 720  | mark          | data bit 1 / 0\n4,6,8...80        | 840         | space         | data space\n82 (if repeating) | 2700        | space         | repeat space\n\nRepeat 1 - 82 if repeating, otherwise go through 81 and stop.\n\nThe data is always 40 bits (5 bytes) in length and might look something like this:\n\n```\n00001111 00111100 00011000 01101010 00101001\n```\n\nOr, in hex bytes:\n\n```\n0F 3C 18 6A 29\n```\n\n### Byte 1\nThe first byte is `0x0F` and is unknown at this time.\n\n### Byte 2\n\nThe second byte has been observed to be `0x3C` and is unknown at this time. It may change depending on operation mode of the heater, such as when it is limited to 105°F. Further investigation is needed.\n\n### Byte 3\n\nThe third byte appears to contain information about the state of the heater.\nSo far, three bits have been decoded.\n\n*  Bit 4 is the on/off state of the heater.\n   ```\n   00001000\n       ^\n   ```\n\n*  Bit 5 is if the display is in °C (or `0` if using °F).\n   ```\n   00010000\n      ^\n   ```\n\n*  Bit 6 is if the flow sensor detects flow.\n   ```\n   00100000\n     ^\n   ```\n\nIt is currently unknown what, if anything, the other bits might represent.\n\n#### Examples\n\n`00000000` (or `0x00`) means the device is off, flow is off, and\nthe display is in °F.\n\n`00001000` (or `0x08`) means the device is on, flow is off, and\nthe display is in °F.\n\n`00101000` (or `0x28`) means the device is on, flow is on, and\nthe display is in °F.\n\n`00010000` (or `0x10`) means the device is off, flow is off, and\nthe display is in °C.\n\n`00111000` (or `0x38`) means the device is on, flow is on, and\nthe display is in °C.\n\n### Byte 4\n\nThe fourth byte is the temperature in °F. For example, `01101010` (or `0x6A`) is 106°F.\n\n### Byte 5\n\nThe fifth byte is the temperature in °C. For example, `00101001` (or `0x29`) is 41°C.\n\n\n\n## Configuration\n\n### Warning\n\nIf you are connecting directly to the [control board](https://www.amazon.com/Ecosmart-CB-QC-MEDLRG-Control/dp/B00Z0Z6HMU), **BE VERY CAREFUL** about not shorting any of the pins. The processor on the control board **is not well protected** and will more than likely be damaged by _even the slightest mishap_. I **strongly advise you** to disconnect all power to the heater, ground yourself, and be very cautious when connecting an Arduino or NodeMCU device to the heater's control board. Obviously, EcoSmart will probably not honor your warranty if you break it. Fortunately the control board is only about $50 at the moment.\n\n### Pinout\n\nThe connector labled \"CN4\" on the sub-board with the display LED and the control knob has pins as follows:\n\n```\n[LED1]\t\n\nLabel:\nE123995\n94V-0\nSMT18-36A\nS.V: 1\n\n\no \u003c--- ground\no \u003c--- +12V\no \u003c--- data in\no \u003c--- data out\n[CN4]\n\n\n[SW1]\n```\n\n~~Since I am using a [NodeMCU](https://www.amazon.com/HiLetgo-Internet-Development-Wireless-Micropython/dp/B010N1SPRK) device, it is able to be powered directly from the +12V pin to the \u003cu\u003eVIN\u003c/u\u003e pin.~~ After noticing some flakiness I have decided to power the NodeMCU from a separate USB power supply (but grounds must still be connected). Connect ground to ground, connect the EcoSmart's \u003cu\u003edata in\u003c/u\u003e to the `OUTPUT_PIN` (D6 by default) and the EcoSmart's \u003cu\u003edata out\u003c/u\u003e pin to the `RECV_PIN` (D2 by default).\n\n### Software\n\nProgram the correct wifi SSID, password, and MQTT broker settings before building and uploading to your remote device. I used [CLion and platformio](http://docs.platformio.org/en/latest/ide/clion.html) to develop, build, and upload the software, but use whatever works for you. I have written this software to be compatible with [Home Assistant's MQTT Climate device](https://www.home-assistant.io/components/climate.mqtt/) with the following example configuration:\n\n```yaml\nclimate:\n  - platform: mqtt\n    name: Tankless WH\n    min_temp: 27\n    max_temp: 60\n    modes:\n      - 'off'\n      - 'heat'\n    mode_command_topic: \"ecosmart/mode/set\"\n    mode_state_topic: \"ecosmart/mode\"\n    temperature_command_topic: \"ecosmart/temperature/set\"\n    temperature_state_topic: \"ecosmart/temperature\"\n```\n\n## ESPHome Integration\n\nFor easier integration with ESPHome, see [this document](esphome/README.md).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilrw%2Fecosmart-remote","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilrw%2Fecosmart-remote","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilrw%2Fecosmart-remote/lists"}