I am using Tasmota 13.0.0.1 and trying to write a Berry script to control a relay depending on the temperature reading from AM2301.
The AM2301 is working correctly and the temperature and humidity is showing good on the webGUI. But I didn't manage to get the temperature reading in the berry script. I have tried:
1.
def check_heat()
var arc = tasmota.arch()
var sens = tasmota.read_sensors()
log("value is", arc, sens)
end
tasmota.add_cron("* * */10 * * *", check_heat, "every_10m")
It can print value is in the console log, but nothing following.
2.
def check_heat(value) log("The value:", value) end tasmota.add_rule("tele-AM2301#Temperature", check_heat)
In this way, it doesn't print at all. No matter what value I changed for TelePeriod.
Any idea, please? Thank you very much