But first, see my first hand account of Tasmota vs ESPHome with the goal getting everything in Home Assistant for automation (like I believe we're all going for).
I got frustrated with esphome and this forum made me think it was going to be easier to figure out tasmota... Well I was able to get all the sensors to recognize the programming but not send the information back to me.
Getting it that close in Tasmota involved:
- taking the code that Tasmota flashes on your device at the original setup (I have the Atlas Scientific Aquaponics Kit that's powered by an Adafruit Huzzah32 Feather)
- opening it up with Gitpod
- modifying the "platformio_override.ini" for esp32 devices instead of esp8266 AND
- modifying the "user_config_override.h" to #define the ezo sensors, etc, then
- running in the Terminal
Code: Select all
platformio run -e tasmota32
- downloading the "tasmota32.bin" file to my computer and moving it into the esptool folder
- opening my computers Terminal in the esptool folder and running the following commands
-
Code: Select all
esptool.py --port COM7 erase_flash
-
Code: Select all
esptool.py --port COM7 write_flash -fs 2MB -fm dout 0x0 tasmota32.bin
But that's where I got stuck because I couldn't figure out how to use MQTT to share data with Home Assistant.
The big thing for a beginner like me that I couldn't figure out until today was that both i2c and gpio, while located at the same place, have to be defined in order for readings to happen.
I have zero coding experience and am working on automating a pretty significantly sized hydroponic system. I was able to get a little esp32-CAM setup in ESPHome yesterday so I decided to give ESPHome another try for the kit.
here's some code so hopefully you won't have to spend as long as I did figuring it out
(or if you're a seasoned vet you can have a good laugh)
Code: Select all
esphome:
name: lettuce-hub-v4
esp32:
board: featheresp32
framework:
type: arduino
i2c:
sda: 23
scl: 22
scan: True
id: bus_a
binary_sensor:
- platform: gpio
name: "HUM"
pin:
number: 32
inverted: false
mode:
input: true
pullup: true
- platform: gpio
name: "CO2"
pin:
number: 15
inverted: false
mode:
pullup: true
input: true
- platform: gpio
name: "RTD"
pin:
number: 33
mode:
input: true
pullup: true
filters:
- delayed_on: 100ms
- platform: gpio
name: "EC"
pin:
number: 27
mode:
input: true
pullup: false
- platform: gpio
name: "DO"
pin:
number: 12
mode:
input: true
pullup: false
- platform: gpio
name: "pH"
pin:
number: 13
mode:
input: true
pullup: false
sensor:
- platform: ezo
id: EZO_HUM
name: "HUM"
device_class: humidity
state_class: measurement
address: 111
unit_of_measurement: "%"
on_raw_value:
then:
logger.log: "Humidity f****** worked!!!"
- platform: ezo
id: EZO_CO2
name: "CO2"
device_class: carbon_dioxide
state_class: measurement
address: 105
unit_of_measurement: "ppm"
- platform: ezo
id: EZO_RTD
name: "RTD"
device_class: temperature
state_class: measurement
address: 0x66
accuracy_decimals: 2
unit_of_measurement: temperature
- platform: ezo
id: EZO_EC
name: "EC"
state_class: measurement
address: 100
accuracy_decimals: 0
unit_of_measurement: "CN"
- platform: ezo
id: EZO_DO
name: "DO"
state_class: measurement
address: 97
unit_of_measurement: "DO"
- platform: ezo
id: EZO_pH
name: "PH"
device_class: ""
state_class: measurement
address: 99
accuracy_decimals: 2
unit_of_measurement: "pH"
For whatever reason I still can't get the co2 sensor to respond, but I figured 5/6 was still pretty good.
Sorry if this post is a little long but I've been creeping around this forum for a while now for advice/guidance and I actually, finally have something I think is worth contributing... The complete beginner's account.
-Ray