Page 2 of 2

Re: [Problem] Event with time won't trigger

Posted: Tuesday 19 December 2017 19:13
by cantarevolare
Yes, I checked and there is only one device that's named like that.

I tried with another device that's named differently, and there is still this return :

2017-12-19 19:14:58.226 dzVents: curtemp:

I just thought of something and that's my bad of not telling you earlier, but this is a device that gives the temperature and the humidity. Maybe there is a sub function of the device or something like that to call in order to obtair the temperature only ?

I think I found the solution thanks to the wiki and you:

Code: Select all

sTemperature, sWeatherHumidity = otherdevices_svalues['Chambre temp']:match("([^;]+);([^;]+)")
curtemp = tonumber(sTemperature);
print("curtemp : " .. curtemp .. " ");
The result : 2017-12-19 19:31:53.247 dzVents: curtemp: 16.9

Let see if it matches exactly what I need.

Thank you very much for your help.

Re: [Problem] Event with time won't trigger

Posted: Tuesday 19 December 2017 20:26
by jvdz
That explains it.You could also do it this way:

Code: Select all

curtemp = tonumber(otherdevices_temperature['Chambre temp']);
print("curtemp : " .. curtemp .. " ");
Jos