turning on and off ESPHOME Sonoff

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
ajocius
Posts: 83
Joined: Mon Feb 19, 2018 6:31 am

turning on and off ESPHOME Sonoff

Post by ajocius » Mon Mar 22, 2021 2:50 pm

I have ESP32 based temp measuring device in my greenhouse. Data is sent via mqtt protocol. Node-Red is capturing mqtt message and saves data to influxDB. I measure temp in several locations, but here important are temp at the top of greenhouse and soil temp. I would like to have solution where I can turn device when certain temp conditions are met. I have ventilator that moves air from the top of greenhouse under surface and therefore warm up soil during cold spring days.

I have flashed ESPhome to sonoff device and not sure what can I do next. I have tested sonoff device with Home Assistant, I can turn it on and off.

What kind of solution can I make ?
1. Best would be that NodeRed checks temp vs condition that I set up and send message to turn on or off to sonoff device?
2. Can Home Assistant be used for that purpose?
3. I could change micropython code in ESP32 to check conditions, but then again, I need to send some message to sonoff device.

User avatar
CmdrDeLiver
Posts: 27
Joined: Thu Dec 05, 2019 6:30 pm

Re: turning on and off ESPHOME Sonoff

Post by CmdrDeLiver » Tue Mar 23, 2021 1:40 pm

Hi ajocius,
ajocius wrote:
Mon Mar 22, 2021 2:50 pm
I have flashed ESPhome to sonoff device
Did you use a guide to do this? A link to it might help as there are several different ways to go about this and it makes a difference to access your modified Sonoff.

What kind of solution can I make ?
Any of your solutions are possible. NodeRed is likely the most straight forward. This guide shows how to write functions in NodeRed. You may find clues to your solution in the guides linked here.


Mike

kevinkk525
Posts: 925
Joined: Sat Feb 03, 2018 7:02 pm

Re: turning on and off ESPHOME Sonoff

Post by kevinkk525 » Tue Mar 23, 2021 9:43 pm

ajocius wrote:
Mon Mar 22, 2021 2:50 pm
2. Can Home Assistant be used for that purpose?
Absolutely. You can make all kinds of automations in HomeAssistant. and esphome is very easy on the microcontroller side.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

Post Reply