Page 1 of 1
Newbie help Just send temperature to prowl or email every morning 06:00
Posted: Monday 05 February 2018 14:26
by rich710
Hello!
Trying to make some simple script to just send the value of one of tempsensors to Prowl or email at 06:00. But I'm stuck
Do I have to have some if-condition?
Thankful for help
Code: Select all
return {
on = {
timer = { at '14:12' },
}
},
execute = function(domoticz)
domoticz.notify('Dagens Utetemperatur!', 'Current value is ' .. 'Utetemp01'.temperature, domoticz.PRIORITY_NORMAL)
end
end
}
Re: Newbie help Just send temperature to prowl or email every morning 06:00
Posted: Monday 05 February 2018 14:49
by CaesarPL
This one works for me:
Code: Select all
return {
on = {
['timer'] = {
'at sunrise'
}
},
execute = function(domoticz,triggerInfo)
if (domoticz.devices('Temp outside').temperature < 0) then
domoticz.email('Cold!', 'Be careful!', '[email protected]')
end
end
}
Re: Newbie help Just send temperature to prowl or email every morning 06:00
Posted: Monday 05 February 2018 21:01
by rich710
Yes, thank you, but I want to be told "what" temperature it is 6 o clock with a notice on my phone.
I think your script just tell you IF it's below 0? Or am I wrong?
Re: Newbie help Just send temperature to prowl or email every morning 06:00
Posted: Monday 05 February 2018 22:57
by elmortero
Assuming that
Utetemp01 is the exact name of your outside temperature sensor this should work:
Code: Select all
return {
on = {
timer = { 'at 6:00' }
},
execute = function(domoticz)
local Ute = round(domoticz.devices('Utetemp01').temperature, 1)
domoticz.notify('Dagens Utetemperatur!', 'Current value is ' ..Ute, domoticz.PRIORITY_NORMAL)
end
}
Re: Newbie help Just send temperature to prowl or email every morning 06:00
Posted: Tuesday 06 February 2018 10:16
by rich710
Perfect! Thank you! But I couldn't get the round-util to work, got this error in the log.
But if i remove round and the 1 for decimals it worked, but I got like 6 decimals in the notice.. but no big deal...
Thanks for your effort!
2018-02-06 10:12:00.298 dzVents: Info: ------ Start internal script: Utetemp:, trigger: at 10:12
2018-02-06 10:12:00.299 dzVents: Error (2.4.1): An error occured when calling event handler Utetemp
2018-02-06 10:12:00.299 dzVents: Error (2.4.1): ...i/domoticz/scripts/dzVents/generated_scripts/Utetemp.lua:6: attempt to call global 'round' (a nil value)
2018-02-06 10:12:00.299 dzVents: Info: ------ Finished Utetemp
Re: Newbie help Just send temperature to prowl or email every morning 06:00
Posted: Tuesday 06 February 2018 10:46
by welby
This rounding works for me.
Re: Newbie help Just send temperature to prowl or email every morning 06:00
Posted: Tuesday 06 February 2018 10:54
by rich710
Perfect! Now it worked! But for info I got this message in the log.. And I learned some new things, thank you everybody.
2018-02-06 10:51:00.287 dzVents: Info: domoticz.round deprecated. Please use domoticz.utils.round.
2018-02-06 10:51:00.287 dzVents: Info: ------ Finished Utetem
Re: Newbie help Just send temperature to prowl or email every morning 06:00
Posted: Tuesday 06 February 2018 10:56
by rich710
Here is "my"

working script for getting notified daily temp at 06:00 from my temp sensor. With 1 decimal.
Code: Select all
return {
on = {
timer = { 'at 06:00' }
},
execute = function(domoticz)
local Ute = domoticz.utils.round(domoticz.devices('Utetemp01').temperature, 1)
domoticz.notify('Dagens Utetemperatur!', 'Current value is ' ..Ute, domoticz.PRIORITY_NORMAL)
end
}