Lua script running every 5 - 10 seconds

Moderator: leecollings

Post Reply
zodracom
Posts: 11
Joined: Monday 11 February 2019 21:20
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.7900
Location: Roosendaal, Netherlands
Contact:

Lua script running every 5 - 10 seconds

Post 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
Lebo2d9
Posts: 139
Joined: Tuesday 06 September 2016 20:39
Target OS: Raspberry Pi / ODroid
Domoticz version: L stab
Location: Belgium
Contact:

Re: Lua script running every 5 - 10 seconds

Post by Lebo2d9 »

you can add the line

Code: Select all

if (devicechanged['MyDeviceName']) then
.
Domoicz on RPI3 (wifi) directly connected 3x ds18b20 for CV temp, Evohome (9 zone), 1 remote 220V switch based on ESP-12. RFXtrx433E, 16x AMST-606, 5 Somfy RTS motors
Domoticz on RPI3(wifi) as slave for terraruim control
More to come
zicht
Posts: 251
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Re: Lua script running every 5 - 10 seconds

Post by zicht »

see also

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

there is a lot of info on the wiki pages
Rpi & Win x64. Using : cam's,RFXCom, LaCrosse, RFY, HuE, google, standard Lua, Tasker, Waze traveltime, NLAlert&grip2+,curtains, vacuum, audioreceiver, smart-heating&cooling + many more (= automate all repetitive simple tasks)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest