IoT Hottub Temperature Controlled Power Switch: Difference between revisions

From munkjensen.net/wiki
No edit summary
No edit summary
Line 13: Line 13:
<blockquote><pre>
<blockquote><pre>
on sensorTemp#temperature do
on sensorTemp#temperature do
    TaskValueSet,varTemp,Dummy,[sensorTemp#temperature] // Store current sensor temperature in a dummy variable


     if [varTemp#lastValue]>=37
        // 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
       TaskValueSet,Switch1,state,1
     else
     else
       TaskValueSet,Switch1,state,0
       TaskValueSet,Switch1,state,0
     endif
     endif
        // Set the relay and red LED state to the same state as dummy Switch1 state
     gpio,12,0[Switch1#state]
     gpio,12,0[Switch1#state]
endon
endon

Revision as of 10:06, 17 December 2021

  1. Køb en TH16
  2. & en temperatursensor der passer til TH16 og dine behov
  3. & en 3.3 volt USB til seriel adapter
  4. & diverse ledninger
  5. Læs dokumentation for ESPeasy
  6. Jeg flasher med filen ESP_Easy_mega_20211105_normal_ESP8285_1M.bin
  7. 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


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