Tasmota vs. ESPHomeYAML - Pro's & Con's

In my network the devices flashed with ESPHome seem to have problems connecting to the wifi after flashing when not giving it an ip address. So after doing so problems were gone.

https://esphome.io/components/wifi.html

yes, and you can also use internal: True

I used both tasmota and ESPhome. Initially used tasmota for simple relays and switches and few simple DHT sensors. Later when I expand GPIO with MCP I2C board, tried to include 8 relays and switches, but rules in tasmota is confusing and frustrating. Combined all 8 inputs in a single rule (as tasmota only limited to 3 rules), only first input worked. After exhausting all trials and minimal help from discord, changed firmware to ESPhome, I have easily written YAML code and easily flashed and I’m using 8 relay board with 8 switches along with DHT sensor.

Not only tasmota, I had issues with Mosquitto MQTT broker for few weeks. Now it’s stable, but I have my doubts on it’s longevity.

I feel like TASMOTA is good for newbies who prefers GUI to configure things. ESPhome is good for complex local automation without involvement of a hub.

Hello OttoWinter,

I am new to ESPHome and I found that it is the easiest way to program ESP32 based controllers. I have developed one piece of hardware and I am planning it to distribute some pieces among friends. These switches will run without HA, and multiple Sonoff relays will controlled with MQTT. My device acts as a simple switch.

However I need simplest way to provide configuration to users. I want basically to give access to edit MQTT topics so that user can define their own topics. They can decide which relay to control by which switch.

Is there any way to achieve this with ESPHome? If yes then any link for reference if available.

Thanks

1 Like

I’d love to have this capability, too. Perhaps something like having some magic token that can substitute in the MAC address or some other unique identifier into the MQTT topic prefix?

No, that’s not possible. The reason ESPHome is possible is because all config parsing is done with a python tool beforehand.

If you want changes during runtime, you get web interfaces like Tasmota/ESPurna. Sure they make it easy to set some settings, but you can’t ever get as close to customization as with ESPHome.

You can however give them YAML files with substitutions that makes it easy for them to change some values like YAML base topic etc (see FAQ).

Problem with tasmota that, I am unable to get it working on ESP32. My skills need to be realigned to make it work :wink:

Other solution I can think of, if there is any way where I can push updates from web to the device. I am thinking that if I make this product available for sell and I want anybody can change settings.

  1. Simple Web Application to manage devices of users and settings on the device
  2. For settings, user will get a form which will edit YAML file on server
  3. Once that is done, firmware will be built on webserver and pushed to the device. Either automatically or with some clicks if required.
  4. Obviously device needs to be connected to internet.
  5. I am really lazy to get Tasmota working on my device. ESPHome works flawlessly right now.
  6. If required a mobile app layer can also be added which will get firmware built on external web server and will push to device.

Tasmota only works with esp8266 not esp32.

Yes, but there is ESP32 port available which appears to be not working as expected. That is why I came to ESPHome path.

I also had massive WiFi issues, but since I use Tasmota compiled with the old core version 2.3.0, I’m running error-free for over seven months now…

I could never get anything other than core 2.3.0 to be reliable and not do WiFi and MQTT disconnects all the time… until pre2.6.0 core which is at least as good as 2.3.0 if not better with none of the bugs/security issues so I recommend upgrading. The latest 6.7.1 of Tasmota uses that core by default now and older cores are unsupported. V7 available in dev uses the released core 2.6.0 and it’s working brilliantly.

Thanks, will try that version and see if all goes well with my devices. I have a lot of different beasts: Sonoffs, Wemos D1 mini’s, ESP01S’s, Node MCUs, Tuya TYWE2S’s, so that should give a good insight of the stability of core 2.6.0

They just released core 2.6.1 today in latest dev versions.

1 Like

Yes, and Tasmota 7.0.0.4, so testing that combo right now…

Yep - That’s what I’m running…

I’ve recently recieved an ifan03 and butchered @finity code to fit the ifan03 (shifting the GPIO to reflect the new hardware config) :grimacing:. One thing that I am unable to get working is the 433mhz reciever for the remote control.

From what I’ve seen its just a matter of getting the 433mhz processor to talk to the main chip through a serial connection 9600bps 8N1 , but some whatever reason I cant get it to work. I undertand there is only 1 UART connection, and by default this is taken up with the serial logs, not really sure if its possible to shift this around?

Hopefuilly someone on here is able to tinker to get it working!

# Template from https://raw.githubusercontent.com/finity69x2/Home-Assistant/master/packages/iFan02/esphome_firmware_code

## you will end up with three (3) files in your esphome directory:
## ifan03_test.yaml (or whatever filename you want)
## common_sonoff_ifan03.yaml
## ifan03.h
##
#################################################################
## this is the device specific yaml file. put all of the device specific configuration in here. 
## it will get tranferrred to the firmware file at compile time.

substitutions:
  name: mainbr_ifan03
  ip: !secret ip_mbr_ifan
  friendly_name: Main Bedroom iFan
  friendly_name_light: Main Bedroom iFan Light
  friendly_name_fan: Main Bedroom iFan Fan
<<: !include common_sonoff_ifan03.yaml


###############################################################################
## This is the device common file that will be used for all of the iFan03 devices


## This is the device common file that will be used for all of the iFan03 devices
## Modified for iFan03


  esphome:
    name: ${name}
    platform: ESP8266
    board: esp8285
    includes:
      - ifan03.h
      
  wifi:
    #hostname: ${name}
    ssid: !secret wifi_iot_ssid
    password: !secret wifi_iot_pass
    #reboot_timeout: 0s
    fast_connect: true
    manual_ip:
      static_ip: ${ip}
      gateway: 192.168.3.1
      subnet: 255.255.255.0
      
  # Enable logging
  logger:
  
  # Enable Home Assistant API
  api:
    password: !secret esphome_api
    reboot_timeout: 0s
  
  ota:
    password: !secret esphome_api
    
  web_server:
    port: 80   
    
  # Serial connected on GPIO1/3 9600bps 8N1
  uart:
    tx_pin: GPIO01
    rx_pin: GPIO03
    baud_rate: 9600
    stop_bits: 1
  
  binary_sensor:
    - platform: gpio
      id: vbutton_light
      pin: 
        number: GPIO0
        inverted: False
      on_press:
        then:
          - light.toggle: lamp
  
    - platform: gpio
      id: vbutton_relay_1
      pin: 
        number: GPIO14
        inverted: False
      on_press:
        then:
          - switch.toggle: fan_relay1
          - switch.turn_on: update_fan_speed
  
    - platform: gpio
      id: vbutton_relay_2
      pin: 
        number: GPIO12
        inverted: False
      on_press:
        then:
          - switch.toggle: fan_relay2
          - switch.turn_on: update_fan_speed
          
    - platform: gpio
      id: vbutton_relay_3
      pin: 
        number: GPIO15
        inverted: False
      on_press:
        then:
          - switch.toggle: fan_relay3
          - switch.turn_on: update_fan_speed
  
  output:
    - platform: custom
      type: float
      outputs:
        id: fanoutput
      lambda: |-
        auto ifan02 = new IFan02Output();
        App.register_component(ifan02);
        return {ifan02};
        
    - platform: gpio
      pin: GPIO09
      inverted: True
      id: light_output
  
  light:
    - platform: binary
      name: ${friendly_name_light}
      output: light_output
      id: lamp
  
  switch:
    - platform: template
      id: update_fan_speed
      optimistic: True
      turn_on_action:
        then:
          - delay: 200ms
          - if: 
              condition:
                and:
                  - switch.is_off: fan_relay1
                  - switch.is_off: fan_relay2
                  - switch.is_off: fan_relay3
              then:
                - fan.turn_off: ifan02
          - if:
              condition:
                and:
                  - switch.is_on: fan_relay1
                  - switch.is_off: fan_relay2
                  - switch.is_off: fan_relay3
              then:
                - fan.turn_on: 
                    id: ifan02
                    speed: LOW
          - if:
              condition:
                and:
                  - switch.is_on: fan_relay1
                  - switch.is_on: fan_relay2
                  - switch.is_off: fan_relay3
              then:
                - fan.turn_on: 
                    id: ifan02
                    speed: MEDIUM
          - if:
              condition:
                and:
                  - switch.is_on: fan_relay1
                  - switch.is_off: fan_relay2
                  - switch.is_on: fan_relay3
              then:
                - fan.turn_on: 
                    id: ifan02
                    speed: HIGH
          - switch.turn_off: update_fan_speed
  
    - platform: gpio
      pin: GPIO14
      id: fan_relay1
      
    - platform: gpio
      pin: GPIO12
      id: fan_relay2
      
    - platform: gpio
      pin: GPIO15
      id: fan_relay3
  
  fan:
    - platform: speed
      output: fanoutput
      id: ifan02
      name: ${friendly_name_fan}
      
  text_sensor:
    - platform: version
      name: ${friendly_name} ESPHome Version
      
  sensor:
    - platform: wifi_signal
      name: ${friendly_name} WiFi Signal Strength
      update_interval: 60s
## ifan03.h below
###############################################################################
#include "esphome.h"
using namespace esphome;

class IFan03Output : public Component, public output::FloatOutput {
  public:
    void write_state(float state) override {
        if (state < 0.3) {
          digitalWrite(14, LOW);
          digitalWrite(12, LOW);
          digitalWrite(15, LOW);
        }

        if (state >= 0.32 && state <= 0.34) {
          digitalWrite(14, HIGH);
          digitalWrite(12, LOW);
          digitalWrite(15, LOW);
        }
        if (state >= 0.65 && state <= 0.67) {
          digitalWrite(14, HIGH);
          digitalWrite(12, HIGH);
          digitalWrite(15, LOW);
        }
        if (state >= 0.9) {
          digitalWrite(14, LOW);
          digitalWrite(12, LOW);
          digitalWrite(15, HIGH);
        }
    }
};

I have work with both Tasmota and ESPHome. Tasmota is pretty finicky and I find ESPHome much easier to work with and reliable.

I migrated one of my Tasmota devices to ESPHome yesterday. So far I have to say I am impressed, it seems to work quite well. I especially liked the migration, I thought that was pretty cool. Connecting my existing NodeMCU to my HASSIO via USB and letting the add-on flash a new firmware was pretty cool.

Thanks Devs!

Interesting read this thread, I was contemplating going back to ESPhome but may update Tasmota first to see how things go.

Ive not had a issue with Tasmota and Sonoff devices but looking to employ some nodemcu devices now so may keep both running.

I use nodemcu devices and sensors with Tasmota FWIW