Page 1 of 1

Email Temperature Notifications not working

Posted: Saturday 05 March 2016 15:36
by RaspberryPiDavid
I am able to send a temperature alarm based on the temperature. However, the email that comes shows the temperature in Celsius instead of Fahrenheit. (My settings page is in Faherenheit)

Is this a bug, or something I have wrong with my settings?

Capture.JPG
Capture.JPG (36.38 KiB) Viewed 1055 times
The email says "My temperature is -18.6 degrees"

Re: Email Temperature Notifications not working

Posted: Monday 07 March 2016 22:33
by georgesattali
Hello,
seems to be a bug in Domoticz, I have no better idea that maybe you could create a lua script to get around the problem ?

- log (with putty on your raspberry)
- use the command
nano /home/pi/domoticz/scripts/lua/script_time_fridge.lua
(file name is must begin with script_time_xxx)
paste the code and save the file
Watch the Setup/Log the check there isn't errors.
come back if u have problems.
PS :
- I "think" that your 45 F becomes a 7 C (that's why I put >= 7)
- you should do some test by replacing temporarily ... >= 7 by ...>=0 to be sure you receive the mail
- [email protected] is not a real adress, you have to put smth real.
Bye, Geo

Code: Select all

commandArray = {}

if otherdevices['Fridge Alarm Adknowledge'] == 'Off' and otherdevices_temperature['Basement Temperature'] >= 7 then
   valueInDeg = otherdevices_temperature['Basement Temperature']
   valueInF   = valueInDeg * 9/5 + 32
   
   commandArray['SendEmail'] = "Fridge is warm"
      .."#".."My temperature is "..valueInF.." F ("..valueInDeg.." C)"
      .."#".."[email protected]"
      
   commandArray['Fridge Alarm Adknowledge'] = 'On'
end

return commandArray