3 channel code to work with new 1 channel relay module (Relay 2 and Relay 3 code stripped out)Adaptation of
Adapted by @trystanlea OpenEnergyMonitor.org
#One Channel WiFi Relay/Thermostat Board
The One Channel WiFi Relay/Thermostat Board is a WiFi connected multi-purpose relay board based on the ESP8266 SoC.
NOTE: The board connects to and controls high voltage, knowledge and care is required to handle it
- Option for on-board power supply
- Powered by the WiFi ESP8266 SoC module
- HTTP API to control the relays
- MQTT support
- NTP for network time
- HTTP daemon settings, including security/authentication setup
- HTTP UI for configuration and control
- Thermostat function with weekly scheduling
- Manual relay control
- Broadcast using HTTP GET to services like ThingSpeak and emonCMS
- Integration with ThingSpeak for charting/analytics visualization
- Temperature sensor support
See more at the Three Channel WiFi Relay/Thermostat Board WiKi
Using serial input for an external temperature sensor
Details thanks to Felix Paliuc:
- First setup the "serial" as the input for the sensor.
The temperature value must be sent in a particular way:
First you have to send an "\n" which gets interpreted as a command.
After that, you have to send the temperature value like this: serialremotetemp=
The value of the temperature must be between -3000 and 12000 which gets divided by 100 later.
Practically, I hooked a moteino to the Rx of the ESP8266 and configured the sketch to send temperature with a line like this:
#Author Martin Harizanov
#License This project is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.