jkosharek Posted November 8, 2023 Posted November 8, 2023 @Goose66 I am toying with an ESP8266 board running Tasmota and sending data to the MQTT node for battery voltage on a backup generator and wanted to also know when the generator is running by monitoring a 12v contactor coil voltage. Tasmota doesn't seem to be able to send sensor values to MQTT on a value change so I am looking at doing a publish with Tasmota Rules. Here is an example that I have working: Rule1 on tele-DS18B20#Temperature do var1 %value% endon on DS18B20#Temperature>%var1% do backlog var1 %value%; publish Stat/GenMonitor/Temp {"Time":"%TIME%","DS18B20":{"Id":"DS18B20-1","Temperature":%value%},"TempUnit":"F"}; var2 %value%; endon on DS18B20#Temperature<%var2% do backlog var2 %value%; publish Stat/GenMonitor/Temp {"Time":"%TIME%","DS18B20":{"Id":"DS18B20-1","Temperature":%value%},"TempUnit":"F"}; var1 %value%; endon That produces this, just don't understand the %time% output: {"Time":"1288","DS18B20":{"Id":"DS18B20-1","Temperature":79.59},"TempUnit":"F"} The one for the analog input doesn't seem to work at all, I have tried A0, ADC0, Analog: Rule2 on tele-ADC0#Range do var3 %value% endon on ADC0#Range>%var3% do backlog var3 %value%; publish Stat/GenMonitor/Batt {"Time":"%TIME","ANALOG":{"Range":%value%}}; var4 %value%; endon on ADC0#Range<%var4% do backlog var4 %value%; publish Stat/GenMonitor/Batt {"Time":"%TIME","ANALOG":{"Range":%value%}}; var3 %value%; endon Do you know of a better way to get more of a real time status from Tasmota to MQTT and in to IoX?
jkosharek Posted November 8, 2023 Author Posted November 8, 2023 I ended up settling on these rules, I would rather have them only send data on a change but this is giving me real time data from the sensors. Rule1 on tele-DS18B20#Temperature do publish Stat/GenMonitor/Temp {"Time":"%TIMESTAMP%","DS18B20":{"Id":"DS18B20-1","Temperature":%value%},"TempUnit":"F"} endon Rule2 on ANALOG#RANGE do publish Stat/GenMonitor/Batt {"Time":"%TIMESTAMP%","ANALOG": {"Range": %value%} } endon
Goose66 Posted November 9, 2023 Posted November 9, 2023 (edited) Two things: 1. This sub-forum is specifically for the Tasmota Node Server. The Tasmota Node Server supports a specific list of devices running Tasmota (primarily from Martin Jerry) that fall into several broad categories: Switch, Plug-in Module, Dimmer, Fan Controller, and Humidity Switch. I hope to add new device support for devices falling into these categories and new categories as we go, but this node server is not intended to support generic Tasmota devices with custom states or properties. For that, I suggest trying the generic MQTT node server that is available in the Node Server Store. 2. For Tasmota community support - particularly rules - I suggest the "Tasmota" server on Discord. There is a specific channel for discussions regarding Rules. Edited November 9, 2023 by Goose66 1
Recommended Posts