Water Level Controller with ESP32,Tasmota,Home Assistant



Water level controller


Tasmota is a free source platform where the prebuild firmware binary file can be loaded into ESP based Device which can later configured with Web Us to configure the project as per your requirement.The main page of Tasmota Web Ui, the GPIOS, Timer, Sensors can be configured. The tasmota Device can communicate through Mqtt, HTTP,KNX protocols etc. The Ota Update of the Firmware is also possible with Tasmota.

Home Assistant is a free platform where you can integrate your Devices and monitor the data and control the operations.The Home assistant can also be integrated with Alexa and Google Assistant.The Windows portable version of Home Assistant is suitable for PC and Laptops. It is a very lightweight version.This HAAS WP can be downloaded from this link and watch this video to know how to download and use it.

Implement water level controller with ESP 32 ,Tasmota and Home Assistant 

Hardware Setup  


ckt diagram for wlt



sensor levels

                                                                             Water Tank Levels

                                      Basic Setup for Simulation for Water Level Controller





                       
practical setup for wlt
 

                                                  Practical Setup for Water Level Controller


Sensors

We can use sensors of following types

1]Electrodes as  per the type of Water (Fresh or Salty etc.). 
2]SS Contact type Water Level Sensors
3]Reed Switch Water Level Sensors
4]Float Water Level Sensors



Tasmota Configution

Flash the appropriate tasmota bin file using flashing tool e.g. Web installer.To know how to flash the Tasmota code in ESP32 and configure it , watch the video.

Configure GPIO

Open the Main menu page of  tasmota and Configure GPIOs in Configure Module page. as shown  below.

Set GPIO 2 as Relay

Set GPIO 5 as Switch1

Set GPIO 18 as Switch 2

Set GPIO  19 as Switch2


Mqtt Configuration

Open the Mqtt Config Page and Set Broker of choice e.g.broker.hivemq.com. Set Port as 1883 and topic  as tswitch.

Configure Name of the Device

Open config Other page and set Device Name as testTasmota.


Setting From Console page

Open the console page,Run the following commands from command window.

1.SetTelePeriod 10:This commands set device to send the data information over the topic every 10            seconds.

2. Set SwitchMod1 15 for switch1
          SwitchMod2 15 for switch2
          SwitchMod3 15 for switch3

These commands will not change the Power or Led(Gpio2) state on switch operation.


Setting UP Home Assistant

let us see how to add tasmota to home assistant
Locate the config folder where the Home Assistant Wp files are stored and open configutaion.yaml file and copy the following code.

sensor:
  - platform: mqtt
    name: "testtasmota_LowLevel"
    unique_id: "wri1"
    value_template: "{{ value_json.Switch1 }}"
    state_topic: "tele/tswitch/SENSOR"
    

  - platform: mqtt
    name: "testtasmota_MidLevel"
    unique_id: "wri2"
    value_template: "{{ value_json.Switch2 }}"
    state_topic: "tele/tswitch/SENSOR"  

  
  - platform: mqtt
    name: "testtasmota_HighLevel"
    unique_id: "wri3"
    value_template: "{{ value_json.Switch3 }}"
    state_topic: "tele/tswitch/SENSOR"


Save the file and run haas windows command script file.

Log in to the Home Assistant,Add Mqtt integration and search the Mqtt and configure Tasmota Device.

1. Search the TestTasmota Device and add Switch Control to dashboard or lovelace.

2.Add Entities  testtasmota_HighLevel,testtasmota_MidLevel and testtasmota_LowLevel by clickig on the add cards.

3. Add the automation to turn Switch or Pump on and turn Switch or Pump Off.

For More Details watch the YouTube Video.




Other Categories: You tube Videos


Post a Comment

Previous Post Next Post