Maybe this is a stupid question, but I haven't been able to find the answer on this forum nor on the wiki. I'm writing a lua script that has to run with different actions on a device change depending on the time of day. This works fine:
Code: Select all
time = os.date("*t")
commandArray = {}
if (devicechanged['Slot Voordeur'] == 'Closed' and time.hour >= 12 and time.hour <=17) then
commandArray['Spots Woonkamer']='On'
Using
Code: Select all
time = (os.date(“%H:%M”))
gives me an error unexpected symbol near character 226.
I'm pretty new to lua, but I hope someone can help me out..