lua startup

i put some simple luup.actions into Apps → develop → jua startup
the ui confirm the changes beeing stored, but they not executed …

is there anything i need to be aware of by placing code there ?

is there anything i need to be aware of by placing code there ?
Well it will only be executed when Vera restarts or, if it is a function definition, when it is called from a scene luup. Check the log to see if it flagged an error during startup.

its just straight forward luup.action

i have a few LED lights (this cheap junk from china) … they always ON after a power outage. so i simply had the idea to shut them off on startup.
somethings like this: luup.call_action(“urn:upnp-org:serviceId:Dimming1”,“SetLoadLevelTarget”,{ newLoadlevelTarget=0 },97)

nothing fancy

OK - I know why that doesn’t work. At the time it executes, the devices will not yet be ready. You need to delay the action. Try something like:

function lightsOff() luup.call_action("urn:upnp-org:serviceId:Dimming1","SetLoadLevelTarget",{ newLoadlevelTarget=0 },97) return 0 end luup.call_delay("lightsOff", 60)

great, that did the job well … i just need to figure out some way to find the difference between a reboot and a real power outage …

you could check the system monitor plugin for last reboot/vera restart time

Do you have System Monitor plugin? If so, it has state-variables that show systemVeraRestart and systemLuupRestart.

Edit: Like @Da_JoJo told you whilst I was typing…

Edit: System Monitor can trigger a scene for either Luup or Vera restarts.

well since i kind of “need” the system monitor to find out the difference between a reload and a hard reboot, i’d go with your recomentation and use the monitor to flush the lights :wink:

works perfectly!

i also have a (quite nice) touch-lightswitch … with a software bug.
if the power was out … it state returns to OFF but it still reports to the Vera its ON …
this is now also solved by simply sending the OFF command to the switch and everything is back in sync.

Great thing this is.