Arduino serial through esp-01 tasmota to mosquitto broker

721 views
Skip to first unread message

Armand Bester

unread,
Jun 19, 2022, 4:45:57 AM6/19/22
to TasmotaUsers
Dear members

I have flashed tasmota to an esp-01.  I have an LED connected to GPIO2 and  a DS18B20 temperature sensor to GPIO0.  It is incredible how powerful tasmota is.  

I am using mosquitto as an MQTT broker, node-red, influxDB and grafana - everything is working beautifully - out of the box and easily.

Using an arduino I can control the brightness of GPIO2 LED in the example code below:

"""
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);

}

//   "\"It has yet to be proven that intelligence has any survival value\" ~Arthur C. Clarke"
//   cmnd/tasmota/json {"POWER": 1,"Dimmer":1}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.println("cmnd/tasmota_C2BA8A/json {\"POWER\": 1,\"Dimmer\":10}");
  delay(6000);
 
  Serial.println("cmnd/tasmota_C2BA8A/json {\"POWER\": 1,\"Dimmer\":100}");
  delay(6000);

  // --> My problem
  //Serial.println("mqt/tasmota_C2BA8A/SENSOR {\"ANSense1\": 255}");
  //delay(5000);
}

"""
As can be seen in the above example (commented as --> My problem).  I would like to 'relay/pass through' the value of an analog temperature from an arduino alalog pin through tasmota using serial.  There is no sensor connected yet, the value of 255 is just a mock example.

Thank you for you time reading this.

Kind regards
Armand


Philip Knowles

unread,
Jun 19, 2022, 5:14:59 AM6/19/22
to Armand Bester, TasmotaUsers

Not entirely sure what you are trying to achieve – if you used an ESP12 you could have an analogue pin anyway and send the signal directly.

If you are getting a serial message there are a few Rules which may help

Rules - Tasmota (JSON via Serial Bridge) shows how to read a serial input and send an MQTT message.

 

Regards

 

Phil K

 

 

 

Sent from Mail for Windows

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/f453d220-de52-4abe-8aae-ef93139feaa2n%40googlegroups.com.

 

Reply all
Reply to author
Forward
0 new messages