Skip to content
Andre Thomas edited this page Nov 29, 2019 · 3 revisions

TasmotaSlave

This library implements the protocol required to attach a slave device to an ESP8266 running Tasmota.

The following functions are implemented:

attach_FUNC_JSON()

Used to attach a function in the slave device firmware which will be called when Tasmota requests a telemetry JSON.

attach_FUNC_EVERY_SECOND()

Used to attach a function in the slave device firmware which will be called when Tasmota performs its FUNC_EVERY_SECOND callback (Occurs every 1 second)

attach_FUNC_EVERY_100_MSECOND()

Used to attach a function in the slave device firmware which will be called when Tasmota performs its FUNC_EVERY_100_MSECOND callback (Occurs every 100 milliseconds / 0,1 seconds)

attach_FUNC_COMMAND_SEND()

Used to attach a function which will be called in the slave firmware that will receive a command which was sent from Tasmota using the SlaveSend command. The attached callback function needs to accept a char* as a parameter which will contain the content sent as a parameter to the SlaveSend command on the Tasmota device.

SendTele(char *data)

Can be called from the slave firmware to send immediate telemetry data to the Tasmota device. The data passed as a parameter will be published using the Tasmota device's telemetry topic via MQTT.

ExecuteCommand(char *cmnd)

Can be called from the slave firmware to send commands to the Tasmota device. The format and usage of the command text provided as a parameter needs to adhere to those which would normally be available from the console command interface on the Tasmota device.