Page 1 of 1

Lua script running every 5 - 10 seconds

Posted: Monday 11 February 2019 21:35
by zodracom
Hey Guys,

I'm new with Domoticz, and trying to make a LUA script for splitting my DHT11 temp/hum sensor.

this is the code, i found it online and changed it for my needs.

The problem is that my log-file is full of status triggers for this script. How can i add a line to it, so the value is the same, it does not update the dummy switch?

so.. when the temp or hum changes, it wil trigger the LUA script?

Thanx for the help all...
:oops:

Code: Select all

commandArray = {}

sensorTemperature, sensorHumidity, sensorHumidityStatus = otherdevices_svalues['Schuur temp']:match("([^;]+);([^;]+);([^;]+)")
table.insert (commandArray, { ['UpdateDevice'] = string.format("%d|0|%.2f", otherdevices_idx['schuur temperatuur'], tonumber(sensorTemperature)) })
table.insert (commandArray, { ['UpdateDevice'] = string.format("%d|%d|%d", otherdevices_idx['schuur vochtigheid'], sensorHumidity, sensorHumidityStatus) })

return commandArray

Re: Lua script running every 5 - 10 seconds

Posted: Monday 11 February 2019 23:35
by Lebo2d9
you can add the line

Code: Select all

if (devicechanged['MyDeviceName']) then
.

Re: Lua script running every 5 - 10 seconds

Posted: Thursday 07 March 2019 6:38
by zicht
see also

https://www.domoticz.com/wiki/Events

there is a lot of info on the wiki pages