Tasmota devices can be controlled by both HTTP and MQTT.
If you don’t have an MQTT broker or don’t want to use one then you can still control your Tasmota devices using node-red.
To do this you need to use the http request node which is one of the core nodes.
The http request node can be used for.
- Retrieving web pages from a website
- Making API Requests
- Sending and receiving JSON data to a website or API.
The node will send a request and receive the response and it handles both the request and response.
In the HTTP request node you can set the:
- Request Method -GET,POST etc
- Keep Alives
- Return Data
As shown below:
The request method and URL as well as other settings, like content headers, can also be set in the preceding node for creating dynamic requests.
Turning a Switch On and OFF Simple Flow
Below is a screen shot of the basic flow.
The flow is effectively two flows. The top flow using inject nodes to send the command. The inject node labelled ON looks like this:
You can see that we use the IP address of the switch and pass the command in the url. See controlling smart home devices using http.
Video Controlling Tasmota Sonoff Switch using HTTP and Node-Red
- Controlling the Tasmota SonOff Switch with MQTT and Node-Red
- Introduction to Sonoff Switches
- Setting up the Sonoff Tasmota MQTT Switch