GithubHelp home page GithubHelp logo

tasmotaclient's Introduction

TasmotaClient

This library adds support for the TasmotaClient driver integrated into Tasmota from https://github.com/arendst/Tasmota

Read the TasmotaClient wiki article on the Tasmota wiki from https://tasmota.github.io/docs/#/TasmotaSlave to see how to enable support for this library inside Tasmota.

Edit:(docs are not up to date and dokuments the old TasmotaSlave comands) (2020-11-21)

Change Log

2019-11-29 - v0.0.2 (Pre-release)

  • Add support for sending commands to Tasmota using ExecuteCommand(char *cmnd)

tasmotaclient's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tasmotaclient's Issues

Read value from Tasmota

Hello, can you create an example of how I can receive values? I want to send values from Tasmota to TasmotaSlave and then use them as PWM values for a pin.
Example:

Tasmota:
SlaveSend Fan1 192

TasmotaSlave:
void user_FUNC_RECEIVE (char * data)
{
if (! strcmp (data, "Fan1")) ...
analogWrite (Fan1, 192);
}

Can't get arduino to work

Hi, I have flashed arduino mega with AnalogJSON example, connected Serial3 to ESP's TXD/RXD (GPIO1/3), compilled TASMOTA firmware for using serial communication with microcontrollers, set baudrate to 115200 and I do not see any activity in arduino's console like sending analog data e.t.c. What I'm doing wrong?

ClientSend not working on correct PIN and baud rate (tasmota 9.2.0)

Compiled 9.2.0 (on D1 mini) with

#define USE_TASMOTA_CLIENT  
#define USE_TASMOTA_CLIENT_FLASH_SPEED 57600   
#define USE_TASMOTA_CLIENT_SERIAL_SPEED 57600

In the configuration set D1 as Client RX, D2 as Client TX and D4 as RST
Wiring accordingly with an arduino mini
Communication between both MCUs does not work.
From the console I try ClientSend but does not work

Instead, SerialSend transmits on D1 AND (native) TX pins. Both with 115200. I cannot measure any transmissions on any pin when using ClientSend (console says {"ClientSend":"Done"})

So, I cannot get TasmotaClient on tasmota side to work.

Forward mqtt payload to slave

Hey,
first of all thank you for making TasmotaSlave.

I succesfully have changed TasmotaSlave for my C project on an nrf52840.
I can now autoconnect (via the code on nrf) and then control BLE-devices with the tasmota console and SlaveSend x.
My goal is now to make an autoconfiguration json for homeassistant everytime the chip connects to a known ble device to control the ble-devices via mqtt. I am able to generate and send the json with SendCommand . But after that I need something that forwards recieved mqtt payloads to the uart/ tasmota slave.

Could you add a feature that does that? I think it would be the same as SlaveSend but you forward the recieved mqtt payloads. Something like a CMND_SLAVE_SEND_MQTT in the ProcessCommand.

For example:

MQTT-Client sends
to topic: tasmota_esp/cmnd/mqtt or tasmota_esp/cmnd/slave
payload: ble_device/cmnd/led ON

Tasmota forwards to Slave: ble_device/cmnd/led ON

Maybe a problem with the second space.
But I also could use a payload like: ble_device/cmnd/led_ON,
send it via uart and then split the string at _ on the TasmotaSlave.

Is this easy/possible to implement as I am not into the code of Tasmota and just used your library.

Would be very helpful. Thank you for your response.

New exemple Event raised by the slave

Hello, thank you for this project.
Could you write an exemple .INO that implement this type of event:

An input GPIO connected to the arduino changes it state -> a MQTT telemetry is sent.

Most of the example are triggered by the Tasmota master, not the slave.

Thanks a lot

Informacion de funcion

good afternoon, could you tell me what function I use and how to execute a command in trasmota from arduino, thank you very much.

Tasmota Slave Version 29 not supported!

Good morning, very nice feature for Tasmota. Very powerfull.

Using my code on arduino MEGA2560 works like a charm, but with arduino UNO i get: "Tasmota Slave Version 29 not supported!". Using any example from your library also works with UNO, so, I think, may be the problem is in my code. I am using another library (https://github.com/FatBeard/vbus-arduino-library). To get data from solar controller this library use a hardware serial in MEGA2560 but, with UNO use Altofserial.
The funny thing is that, in UNO, even with the error, I get in Tasmosta Console the correct read values from solar controller, but data is not published via MQTT. This is the Console in UNO:

00:00:00 CFG: Loaded from flash at F7, Count 181
00:00:00 Project tasmota Tasmota Version 8.2.0(tasmota)-STAGE
00:00:00 WIF: Connecting to AP1 Tomato24 in mode 11N as tasmota_4CCA08-2568...
00:00:07 WIF: Connected
00:00:07 HTP: Web server active on tasmota_4CCA08-2568 with IP address 192.168.130.78
09:14:17 MQT: Attempting connection...
09:14:17 MQT: Connected
09:14:17 MQT: tele/tasmota_4CCA08/LWT = Online (retained)
09:14:17 MQT: cmnd/tasmota_4CCA08/POWER =
09:14:17 MQT: tele/tasmota_4CCA08/INFO1 = {"Module":"Generic","Version":"8.2.0(tasmota)","FallbackTopic":"cmnd/DVES_4CCA08_fb/","GroupTopic":"cmnd/tasmotas/"}
09:14:17 MQT: tele/tasmota_4CCA08/INFO2 = {"WebServerMode":"Admin","Hostname":"tasmota_4CCA08-2568","IPAddress":"192.168.130.78"}
09:14:17 MQT: tele/tasmota_4CCA08/INFO3 = {"RestartReason":"External System"}
09:14:18 Tasmota Slave Enabled
09:14:21 MQT: tele/tasmota_4CCA08/STATE = {"Time":"2020-04-17T09:14:21","Uptime":"0T00:00:14","UptimeSec":14,"Heap":27,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":30,"MqttCount":1,"Wifi":{"AP":1,"SSId":"Tomato24","BSSId":"B0:6E:BF:B2:7F:A0","Channel":1,"RSSI":34,"Signal":-83,"LinkCount":1,"Downtime":"0T00:00:08"}}
09:14:21 Tasmota Slave Version 29 not supported!
09:14:24 CMD: ***
09:14:24 CMD: Collector Temp: 0.00
09:14:24 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:24 CMD: Top Tank Temp: 0.00
09:14:24 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:24 CMD: Bottom Tank Temp: 0.00
09:14:24 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:24 CMD: Flow in Temp: 0.00
09:14:24 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:24 CMD: Water Pump Status: 0
09:14:24 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:24 CMD: Water Pump Speed: 0
09:14:24 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:24 CMD: Pump Hours Operation: 15
09:14:24 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:24 CMD: Backup Heater Hours Operation: 0
09:14:24 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:25 CMD: System Alert Status: 1
09:14:25 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:25 CMD: Scheme: 1
09:14:25 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:25 CMD: System Time: 00:0
09:14:25 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:25 CMD: *** End Read ***

And this is my code:

#include <VBUSDecoder.h>
VBUSDecoder vb;
#include <Arduino.h>
#include <TasmotaSlave.h>
TasmotaSlave slave(&Serial);
long lastTimevbus = 0;
long intervalvbus = 15000;
#define DEBUG 1
void setup() {
Serial.begin(115200); // Configure the Serial port for the correct baud rate
vb.initialise();
}
void loop() {
slave.loop(); // Call the slave loop function every so often to process incoming requests
vb.readSensor(); // Read the data from Vbus-UART in Serial1
if (millis() - lastTimevbus > intervalvbus) {
lastTimevbus = millis();
char buffer[40];
int S1Temp = vb.getS1Temp();
int S2Temp = vb.getS2Temp();
int S3Temp = vb.getS3Temp();
int S4Temp = vb.getS4Temp();
char SystemTime[5];
vb.getSystemTime().toCharArray(SystemTime, 6);
int P1 = vb.getP1OperatingHours();
int P2 = vb.getP2OperatingHours();
sprintf(buffer, "{%02d,%02d,%02d,%02d,%s,%02d,%02d}", S1Temp, S2Temp, S3Temp,
S4Temp,SystemTime,P1, P2);
slave.SendTele(buffer);
#if DEBUG
Serial.println("");
Serial.println("*** Fresh Read ");
Serial.print("Collector Temp: ");
Serial.println(vb.getS1Temp());
Serial.print("Top Tank Temp: ");
Serial.println(vb.getS3Temp());
Serial.print("Bottom Tank Temp: ");
Serial.println(vb.getS2Temp());
Serial.print("Flow in Temp: ");
Serial.println(vb.getS4Temp());
Serial.print("Water Pump Status: ");
Serial.println(vb.getP1Status());
Serial.print("Water Pump Speed: ");
Serial.println(vb.getP1Speed());
Serial.print("Pump Hours Operation: ");
Serial.println(vb.getP1OperatingHours());
Serial.print("Backup Heater Hours Operation: ");
Serial.println(vb.getP2OperatingHours());
Serial.print("System Alert Status: ");
Serial.println(vb.getAlertStatus());
Serial.print("Scheme: ");
Serial.println(vb.getScheme());
Serial.print("System Time: ");
Serial.println(vb.getSystemTime());
Serial.println("
End Read ***");
#endif
}
}

The Tasmota Console with MEGA2560:

00:00:00 CFG: Loaded from flash at F9, Count 718
00:00:00 Project tasmota Tasmota Version 8.2.0(tasmota)-STAGE
00:00:00 WIF: Connecting to AP1 Tomato24 in mode 11N as tasmota_01A69E-1694...
00:00:07 WIF: Connected
00:00:07 HTP: Web server active on tasmota_01A69E-1694 with IP address 192.168.130.245
09:35:29 MQT: Attempting connection...
09:35:29 MQT: Connected
09:35:29 MQT: tele/tasmota_01A69E/LWT = Online (retained)
09:35:29 MQT: cmnd/tasmota_01A69E/POWER =
09:35:29 MQT: tele/tasmota_01A69E/INFO1 = {"Module":"Generic","Version":"8.2.0(tasmota)","FallbackTopic":"cmnd/DVES_01A69E_fb/","GroupTopic":"cmnd/tasmotas/"}
09:35:29 MQT: tele/tasmota_01A69E/INFO2 = {"WebServerMode":"Admin","Hostname":"tasmota_01A69E-1694","IPAddress":"192.168.130.245"}
09:35:29 MQT: tele/tasmota_01A69E/INFO3 = {"RestartReason":"Power On"}
09:35:30 SNS: Hardware Serial
09:35:30 Tasmota Slave Enabled
09:35:32 Tasmota Slave Version 20191129
09:35:33 MQT: tele/tasmota_01A69E/STATE = {"Time":"2020-04-17T09:35:33","Uptime":"0T00:00:14","UptimeSec":14,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":22,"MqttCount":1,"Wifi":{"AP":1,"SSId":"Tomato24","BSSId":"B0:6E:BF:B2:7F:A0","Channel":1,"RSSI":58,"Signal":-71,"LinkCount":1,"Downtime":"0T00:00:08"}}
09:35:33 MQT: domoticz/in = {"idx":503,"nvalue":0,"svalue":"0;14.0","Battery":100,"RSSI":5}
09:35:33 MQT: domoticz/in = {"idx":508,"nvalue":0,"svalue":"16.0","Battery":100,"RSSI":5}
09:35:33 MQT: tele/tasmota_01A69E/SENSOR = {"Time":"2020-04-17T09:35:33","ENERGY":{"TotalStartTime":"2020-04-11T14:35:16","Total":0.014,"Yesterday":0.007,"Today":0.000,"Period":0,"Power":[0,0],"ApparentPower":[0,0],"ReactivePower":[0,0],"Factor":[0.00,0.00],"Voltage":[0,0],"Current":[0.000,0.000]},"DS18B20":{"Id":"011452EE49AA","Temperature":16.0},"TempUnit":"C"}
09:36:22 MQT: tele/tasmota_01A69E/RESULT = {"TasmotaSlave":{26,24,40,30,09:35,720,39}}

With MEGA2560 works very well, and I get the sting with the solar controller data published via MQTT.
I dont know if would possible to solve my problem with arduino UNO.

Kind regards.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.