Hey All,
I'm trying out Tasmota for the first time. I've found videos on what it is and how to flash a board; I've done that. I've logged on to the board and played around with the configuration.
Now I'm trying to figure out how to blink the onboard LED or connect a DS18B20 and can't find a tutorial on how to do it. I've read through some of the documentation but haven't gotten anywhere.
Where can I learn about actually using a board with Tasmota on it?
What device do you have Tasmota on?
Have you configured the MQTT settings?
In Node-red connect an mqtt-in node to a debug. The topic should be stat/<topic frome device MQTT setup>/#
eg stat/wemos/#
Now in the device console enter status.
Do you see the device status message in Node-red?
If you send "toggle" to cmnd/<topic frome device MQTT setup> you should see the device switch between ON and OFF on the main menu.
If it includes a relay, and you have it fully setup, you should hear the relay switch too.
Thanks Jbudd,
I tried this and got nowhere. I'm still missing the basics.
I'm using a generic esp8266.
I don't understand this
Topic = %topic% (tasmota_C59E35)
Does that mean I should use "%" signs when I define my topic? does it mean that "(tasmota_C59E35)" will be appended to the end of my topic?
What is a "Full Topic"?
Full Topic (%prefix%/%topic%/)
Is the mqtt host the Mosquitto install I have running on my Raspberry Pi? or something else.
I've played with all kinds of hardware over the years and there is usually a "hello world" example to get things up and running. What does that look like for Tasmota?
I'm looking for a resource/tutorial for a newbie who has flashed a board, got it on the network and a hello world or blink example.
Host is the IP address of my Mosquitto broker, which uses the default port 1883.
Every MQTT Client should have a unique ID. I never change this setting, everything works.
My mosquitto is setup to require login id and password. My login is "admin" and password "password1". You have to tick the little box to enter a password.
This device lives in my kitchen and it turns my coffee machine on and off, so I have topic kitchen/coffee
That means I send commands from Node-red to topic cmnd/kitchen/coffee and I get responses to stat/kitchen/coffee/#
Full Topic - I never use it, can't remember what it's for!
Once you have wifi and MQTT setup, the next step depends on what the board comes with.
You have to configure the template to match the device. I have smart plugs so I need to tell Tasmota which GPIO the relay is on. Once that's done I can toggle it from Node-red.
The fulltopic is exactly that, the cmnd/.... stat/....
I always set it up like %topic%/%prefix%, ie. some-room/some-device/cmnd as the concept works better in my mind.
Tasmota is usually used in conjunction with mqtt for its communication, but you can use the http interface as well (ie. with a http request node in node-red).
In Node Red I set up a test inject on the subject /chickenMan I tried a bunch of variations, you can see some of them in the pic below. But the Tasmota console remained silent/unresponsive.
An mqtt topic should not start with a / EDIT: Nor should it end with a /
To send a command you should use a topic cmnd/... not cmd/...
A hash character at the end of an MQTT command is a wildcard. I'm not sure that it makes any sense when you are using mqtt-out (publishing)
stat/chickenMan is (I think) valid. But it's not as much use as (for example) topic cmnd/chickenMan/status and payload 0
cmd/chickenMan/blink/# I don't think this is valid.
You send commands through an mqtt-out node using topic cmnd/chickenMan/~command~
where is one of the commands documented at https://tasmota.github.io/docs/Commands/. Avoid wildcards here. If the command takes a parameter (like the status command I posted above), put the parameter in msg.payload.
You get responses from the esp via an mqtt-in node on topic stat/chickenMan/~whatever~ . It's quite useful to use the wildcard # instead of specifying ~whatever~
Tasmota will also send some status info from time to time on tele/chickenMan/#
Cool, so what's the command to turn the led pin low? I've tried a bunch of variations and get nothing. Note I'm trying these from the Tasmota console, I suspect if they work there they'll work in Node.
cmnd/chickenMan/ 0
or
cmnd/chickenMan/ off
I'm using these boards, I call them generic because that's how I program them in Arduino. generic esp8266
It does appear that GPIO 2 is the built-in blue LED on the ESP8266.
I don't have that sort of ESP board, I use a Witty Cloud board for experimenting because it has an RGB LED and a light dependent resistor onboard. It's probably worthwhile getting one while you learn to use Tasmota.
On the Tasmota main menu, do you have a Toggle button?
If not, go to Configuration | Configure Module and set GPIO 2 as Relay_i 1 and try again.
(relay_i indicates inverse logic - you send "ON" to turn the "relay" off. It doesn't really matter for this test.)
Does the button turn the LED on/off?
Assuming it does, go to the console and enter power. Just the command, not the MQTT topic!
It should tell you if it is ON or OFF.
You can append "ON", "OFF", "TOGGLE" and probably 1 or 0 to the power command like this
If that's working, try from Node-red via MQTT. The topic should be "cmnd/chickenMan/power" and the payload ON, OFF or TOGGLE (It's not case sensitive)
Does the led turn on?
Does anything appear in the console when you send a message?
Do you receive stat messages in Node-red?