22.01.2025, 12:51
(22.01.2025, 12:47)Daniel Wrote: The quotes are the issue, remove from 30 and 60 otherwise it is a string not a number.
Code:
local min_temp = 30
local max_temp = 60
local water_temp = event.getvalue()
if water_temp <= min_temp
then
push = require('applibs.lmcloud.push')
token = 'ios:d-UdhwTxj05Mqtku6GH0JU:APA91bGK4SoVNL4AOg20RQTC2DiUMYtbjrk6YhsVPQoP9nDpgboWDpTQO0G6ruMHq2xXwccyI1LsyJL3kflVsfCjzvcrQspFTUOlqLfpjap4dAnHHSF9tE4'
title = 'Push title'
body = 'Χαμηλή Θερμοκρασία ΖΝΧ'
elseif
water_temp >= max_temp
then
push = require('applibs.lmcloud.push')
token = 'ios:d-UdhwTxj05Mqtku6GH0JU:APA91bGK4SoVNL4AOg20RQTC2DiUMYtbjrk6YhsVPQoP9nDpgboWDpTQO0G6ruMHq2xXwccyI1LsyJL3kflVsfCjzvcrQspFTUOlqLfpjap4dAnHHSF9tE4'
title = 'Push title'
body = 'Υψηλή Θερμοκρασία ΖΝΧ'
end