Need some help (newbie scene)

Hello ,

For my fist scene, i need some help

What i want to do

In my garage , I have a radio connected to a connected socket Greenwave (id 11)
The light of my garage is controlled by a Fibaro FGS -222 (id 12) and I have a magnetic sensor on my garage door connected to a Fibaro FGBS -001 (id 8).

I would like my radio comes on when I’m in my garage , so when my door is open OR that my light is on for over 30s.
As it happens we were back in the garage to throw things in the garbage , add a small delays before turning on the radio

Schematically it would give

  • id 11 ON when Id 8 ON OR Id 12 ON since 30s
  • Id 11 OFF when Id 8 OFF AND Id 12 OFF

OR (but i prefer the first 8))

  • Id 11 ON when Id 8 ON
  • ID 11 ON when id 12 ON since 30s
  • Id 11 OFF when Id 8 OFF AND Id 12 OFF

I do not want to use the plugin PLEG because I have , in the end , very few scene to create and I would limit the plugin instalation

Someone could give me the process of applying to the basic scene editor in UI7 and Luup codes to include

Thank you in advance to all

You’ve read this thread, Conditional Scene Execution: Some Examples, right?

I have read but for my first stage, it is quite confusing .
I do not know where to start it all.
Once I would have done the first , it will get better :wink:

Having Since 30s in your logic is pretty advanced for LUA developers.
You have to use luup.call_delay to cause an evaluation of the logic 30 seconds after the initial trigger.

This is pretty easy in PLEG with lots of documented examples.

If you want to avoid complicated lua for the timer, you could use the countdown timer app. Trigger it when light comes on, cancel it if light goes off and turn on radio if timer completes.
This means using multiple vera scenes but is simple to code.

I did exactly this type of thing when I first started but decided that it was worth the (tiny) expense of Pleg to take the opportunity to learn how to use it and have it available for more complex scenes later.

thanks all for your answer

I have try to instal pleg just to watch but i have, for a long time
“Program Logic Event Generator : Install Program Logic Core Plugin” in blue

And when i go to input/conditions/actions
Error executing function pleg_Inputs(): pleg_Inputs is not a function

@RichardTSchaefer, I must do something?

You must install Pleg AND the Program Logic Core.

;D sorry and thank

After various tests , I prefer not to use PLEG , sorry.

I realized the scene RadioOFF easily (if the scene generator of vera doing well an OR between the trigger)

But for radioON scene , I stumble a bit

I will make a proposal as soon as I have somewhat consistent thing … but I by far :wink:

Ps: Scene work well

For the scene RadioON

  • id 11 ON when Id 8 ON OR Id 12 ON since 30s

I have made a basic scene

  • id 11 ON when Id 8 ON OR Id 12 ON

but It remains to integrate the delay .

Or should I put this?
In Luup part (view in the picture) ?