IoT Hottub Temperature Controlled Power Switch: Difference between revisions

From munkjensen.net/wiki
No edit summary
No edit summary
Line 1: Line 1:
[[Category:Arduino]]
[[Category:Arduino]]
=== Shopping list ===
# Buy a [https://www.google.com/search?q=sonoff+th16 TH16].  
# Buy a [https://www.google.com/search?q=sonoff+th16 TH16].  
# Buy a temperature sensor that fits TH16 and your needs. I use the Sonoff DS18B20 waterproof temperature sensor.
# Buy a temperature sensor that fits TH16 and your needs. I use the Sonoff DS18B20 waterproof temperature sensor.
# Buy a 3.3 volt [https://www.google.com/search?q=usb+to+ttl+ch340 USB to seriel adaptor]
# Buy a 3.3 volt [https://www.google.com/search?q=usb+to+ttl+ch340 USB to seriel adaptor]
# Be aware of [https://espeasy.readthedocs.io/en/latest/ dokumentation] for [https://github.com/letscontrolit/ESPEasy ESPeasy]
# I [https://espeasy.readthedocs.io/en/latest/Reference/Flashing.html flashed] my TH16 Ver. 2.1 dated 2019-08-26 with the  file <code>ESP_Easy_mega_20211105_normal_ESP8285_1M.bin</code>.
# https://espeasy.readthedocs.io/en/latest/Reference/URLs.html?highlight=csv
Inspiration til denne side kommer fra https://www.redelijkheid.com/blog/2017/12/31/flashing-the-sonoff-th16-wireless-switch og https://tinkerman.cat/post/sonoff-th10-th16-sensors-displays-actuators


=== Documentation &amp; inspiration pages ===
* I found a lot of inspiration in the pages https://www.redelijkheid.com/blog/2017/12/31/flashing-the-sonoff-th16-wireless-switch and https://tinkerman.cat/post/sonoff-th10-th16-sensors-displays-actuators
* Be aware of [https://espeasy.readthedocs.io/en/latest/ dokumentation] for [https://github.com/letscontrolit/ESPEasy ESPeasy]
* I [https://espeasy.readthedocs.io/en/latest/Reference/Flashing.html flashed] my TH16 Ver. 2.1 dated 2019-08-26 with the  file <code>ESP_Easy_mega_20211105_normal_ESP8285_1M.bin</code>.
* https://espeasy.readthedocs.io/en/latest/Reference/URLs.html?highlight=csv is usefull for pulling data from the hacked TH16


This is my rules
<blockquote><pre>
<blockquote><pre>
on sensorTemp#temperature do
on sensorTemp#temperature do

Revision as of 11:19, 17 December 2021

Shopping list

  1. Buy a TH16.
  2. Buy a temperature sensor that fits TH16 and your needs. I use the Sonoff DS18B20 waterproof temperature sensor.
  3. Buy a 3.3 volt USB to seriel adaptor

Documentation & inspiration pages

This is my rules

on sensorTemp#temperature do

        // Store current sensor temperature in a dummy variable
    TaskValueSet,varTemp,Dummy,[sensorTemp#temperature]

        // If temperature is above 37 OR the toggleSwitch state is 1
        // then set dummy Switch1 state to 1
    if [varTemp#lastValue]>=37 or [toggleSwitch#state]=1
       TaskValueSet,Switch1,state,1
    else
       TaskValueSet,Switch1,state,0
    endif

        // Set the relay and red LED state to the same state as dummy Switch1 state
    gpio,12,0[Switch1#state]
endon

https://hos.munkjensen.net/vildmarksbad.php