Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Motion sensor scene triggering


Question

Posted

Hi Forum,

We have installed Fibaro Motion sensor on HC2, we would like to know how efficiently we can use the motion sensor in different scenarios

We have a scenario like

When someone enters in Living room motion sensor has to detect the motion and trigger the lights ON and if there is no motion detected, then it should turn OFF the lights. How efficient can the motion sensor will work with this scenario.

How can we create a scene for the above scenario.

In the advanced settings we have noticed there are plenty of parameters, can anyone give us some shortcuts on how to make use of those parameters to make automation more effective.

Recommended Posts

  • 0
Posted

Edit:

I managed to finalise the scene as expected with LUA.

--

Hi,

I just got my motion sensor and it was easy to create basic scene to control the wall plug (activating power on for the coffee maker).

However, I did not figure out how to have scene activated only after 06:00AM because I do not need coffee eg. in the middle of night.

Please login or register to see this image.

/emoticons/default_icon_wink.gif" alt=";-)" />

How to do this with the graphic blocks? Or do I need to make it somehow with LUA?

Thanks in advance!

  • 0
Posted

Emariu,

Just change the sleep(10000) to sleep(4*60*60*1000) and remove the following "break". that will turn off the light and deactivate the scene for four hours. Then you can just turn it back on and it will stay like that for 4 hours. After 4 hours, the svøcene will autoresume from where it left off and kill the lights for you

  • 0
Posted
Emariu,

Just change the sleep(10000) to sleep(4*60*60*1000) and remove the following "break". that will turn off the light and deactivate the scene for four hours. Then you can just turn it back on and it will stay like that for 4 hours. After 4 hours, the svøcene will autoresume from where it left off and kill the lights for you

I tried that but after turn Off manual switch, the light go out for 1 second, but it will automatically be turned ON immediatelly..I cannot switch OFF the light from the button,because the scene will automatically turn it on again..This is the code I had put:

--[[

%% properties

111 value

113 value

%% globals

--]]

-- CHANGE ABOVE VALUES 24 AND 27 TO MOTION DETECTOR AND LIGHT SENSOR ID!

if (fibaro:countScenes()>1) then

fibaro:abort();

end

local motid = 111 -- ID for the motion detector

local luxid = 113 -- ID for the light sensor

local dimid = 101 -- ID for the dimmer you want to operate

local light = 30 -- Lux level below which motion will trigger the light on, if lights should always turn on with motion set at 10000

local ondim = 50 -- Determines what light setting the light will start at

if (tonumber(fibaro:getValue(motid, "value"))) > 0 and (tonumber(fibaro:getValue(luxid, "value")) < light) and (tonumber(fibaro:getValue(dimid, "value")))<1 then

local starttimer =60; -- Determines how long the light will stay on before dimming starts

local timer = (starttimer)+ondim;

local dimout=ondim;

fibaro:call(dimid, "setValue", dimout);

fibaro:debug("Lights on at level "..dimout);

repeat

fibaro:sleep(1000);

--below if condition will turn the light off if the wall switch is pressed and

--timeout for 10 seconds to avoid the scene retriggering due to motion in the

--room.

if (tonumber(fibaro:getValue(dimid, "value"))) < 1 then

timer=1;

fibaro:call(dimid, "turnOff");

fibaro:debug("Light switched off manually, time out for 5 min");

fibaro:sleep(5*60*1000);

end

fibaro:call(dimid, "setValue", dimout);

timer=timer-1;

--below if condition will reset the timer and the dim level to initial values if

--motion has been detected since last sleep period. This means that as long as

--there is movement in the room, the light will remain lit.

if (tonumber(fibaro:getValue(motid, "value"))) > 0 then

timer=starttimer+ondim;

fibaro:debug("Motion detected, reseting timer");

dimout=ondim;

end

--once the full on time is elapsed, below if condition will start to dim from

--initial value to off in one second intervals (one dimlevel/sec).

if (timer

dimout=timer;

fibaro:debug("Dimming, current level = "..dimout);

end

fibaro:debug(timer);

until (timer<1)

--Once the timer has finished and dimlevel reaches 1, the light will be turned off

fibaro:call(dimid, "turnOff");

fibaro:debug("Lights out");

--Change below number to the id of the scene

fibaro:killScenes(26);

end

  • 0
Posted

 I still can´t get this to work.. Sure i´m really new to the LUA and Fibaro system and i have been reading alot of the stuff and still can´t get it to work properly, am i just dumb and should sell it all again?!

NO, i won´t give in... i´ll make it work somehow ? Therefore i´ll appriciate all the help i can get.

 

I have the following:

  • Fibaro Home Center 2
  • Windows 11 PC - i usually log in to set everything up with this (add devices in secure mode, create scenes)
  • iPhone SE (2nd Generation) - this actually works best to add Aeotec Multisensor 6 to get the sensors to work at all and show anything in the Web UI and iOS app
  • Dimmer 2 = every switch at my home in the walls have this
  • Schneider Electric EXXACT WDE002104 = momentary single switches as ALL of the switches in my walls
  • Bypass 2 = in every socket in my ceiling (even in the rooms that have 2 outlets for 1 switch, they are connected in a serie)
  • Philips LEDluster P50 8W dimmable = everywhere in the ceiling in all rooms (in some rooms i have the E27 instead of the E14 but it´s still the same specs on them exept for the size of the socket)
  • Motion sensor 6 from Aeotech = in every room

I wanted to set it up like this:

  1. If anyone enters any room between 22:00 and 06:00 everyday the light in that room should be automatically turned on at 10% so you don´t get blind and die from falling down the concrete stairs and break your neck while you go and take a piss in the middle of the night.
  2. Different time schedules is of course different % of the lights (between 10-100) and also during wintertime and summertime, therefore i wanted to use (as you "Dalle1985" did in the scripts) lux instead of % of the lights (it is about 10% = 4lux and 100% = 15 lux according to the multisensors, i really don´t trust those anymore and besides they are really really slow to update that lux, it takes about 7-10 minutes for it to update)

 

By the way, in the script you wrote: "ID for the dimmer you want to operate" at row 13 and i wonder witch one is the "dimmer"? is it the dimmer 2 switch or the lamp? i´ll upload some pictures with some of my setup in my office so it will be easier for you to help out.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

  • 0
Posted

As you noticed lux value is .....

In my opinion you cant work with the values its different every time compareable with the human eye.

You can use < 10 dark inbetween < 20 and light >20

Tip:

for better reading use different names

pir

pirLux

pirHumidity

pirAmp

pirVolt  

//Sjakie

  • 0
Posted (edited)
14 hours ago, Sjakie said:

As you noticed lux value is .....

In my opinion you cant work with the values its different every time compareable with the human eye.

You can use < 10 dark inbetween < 20 and light >20

Tip:

for better reading use different names

pir

pirLux

pirHumidity

pirAmp

pirVolt  

//Sjakie

Thank you for the fast response Sjakie.

 

Now i have done a fresh reinstall of the Fibaro Home Center 2 and added everything that´s needed with my iPhone thru the Fibaro App and after that i renamed everything with my Windows 11 computer (it was alot of changes on the lux and also the response of the motion sensors, i believe that has to do with the "secure" installation i did with the computer last time) anyhow it´s like this now:
1) Aeotech - Multisensor 6 (this has all 5 of theese sensors built in and are named like this):

   - Motion

   - Temperature

   - Light/Lux

   - Humidity

   - UV

2) Fibaro - Dimmer 2

   - Schneider Electric - EXXACT WDE002104 = momentary single switches (the Dimmer 2 is located behind this)

   - Fibaro - Bypass 2 (located in the outlet in the ceiling)

   - Philips - LEDluster P50 8W dimmable lamps (Hanging in the ceiling and is controlled by the wall switch)

 

 

Picture 1:

All devices are showing now in this room i call "hall", the devices are as you can see:

   - dimmer2 (ID: 47)

   - always_on (ID: 48)

   - wall_switch (ID: 49)

   - ceiling_lamp (ID: 50)

   - always_off (ID: 51)

   - multisensor (ID: 52)

   - motion (ID: 53)

   - temperature (ID: 54)

   - light_sensor-lux (ID: 55)

   - humidity (ID: 56)

   - ultraviolet (ID: 57)

If i press on the "wall_switch" physically or click in the web UI on "ceiling_lamp" it only is the "ceiling_lamp" that changes to "ON" or "OFF" & the physical lamp turns on or off (as it should be if someone who don´t wanna use something like Google/Alexa/Siri to turn it on or off), nothing else happens... BUT if i log in to the FHC2 and click on "always_on": "ON" or "OFF" both the "always_on" and the "ceiling_lamp" either turns "ON" or "OFF" and the physical lamp also turns either on or off..

Therefore i wonder witch one is the "ID for the dimmer you want to operate" in the code?

Also: where should that "< 10 dark inbetween < 20 and light >20" be typed in?

 

Picture 2:

   - Here i show whats hidden and what is not hidden automatically after i add the "Dimmer 2" to the system

 

Picture 3:

  - Here i show whats hidden and what is not hidden automatically after i add the "Aeotec - Multisensor 6" to the system

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Edited by Retu
  • 0
Posted

You can use < 10 dark inbetween < 20 and light >20

This you can use in LUA rules and also in block scheme

//Sjakie

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...