i change my event based script (a little), i had the problem, when i again get a off on my event, i got my value twice or more 'Last Run: '..Last_Run..' on'..time
so on my visualization i saw 'Last Run: Last Run: Last Run: 00:06 on Thu, 30-12 on Thu, 30-12 on Thu, 30-12'
so on my visualization i saw 'Last Run: Last Run: Last Run: 00:06 on Thu, 30-12 on Thu, 30-12 on Thu, 30-12'
Code:
Laptop_Seat = event.getvalue() --'0 WCD Woonkamer - laptoplader Seat (tm)'
ontime_Laptop_Seat = 'ontime_Laptop_Seat'
output_Laptop_Seat = '32/1/202' --'0 WCD Woonkamer - laptoplader Seat [timer on]'
if Laptop_Seat then
if not storage.get(ontime_Laptop_Seat) then
storage.set(ontime_Laptop_Seat, os.time())
grp.update(output_Laptop_Seat, '00:00')
end
elseif -- <------------ and this to elseif
storage.get(ontime_Laptop_Seat) then -- <------------i add this line
Last_Run = grp.getvalue(output_Laptop_Seat)
time = os.date(' %a, %d-%m',time)
grp.update(output_Laptop_Seat, 'Last Run: '..Last_Run..' on'..time)
storage.delete(ontime_Laptop_Seat)
end