Created At
Nov 27, 2023
Created At
Nov 27, 2023
Last Update
Nov 28, 2023
Platforms
Yubii Home Pro, HC 3
Views
944
Download
79
The "Light Butler" is a Lua script designed for the Fibaro Home Center 3 (HC3) system. It automates the control of lighting fixtures in a home based on input from motion sensors. Key components of the script include:
Device List (devices): This list contains the ID numbers of motion sensors and their corresponding lamps across various rooms in the house. Each device pair is also assigned a time interval (in seconds), which determines how long the lamp should remain active after the last detected movement.
Minimum Battery Level (min_battery_level): A variable specifying the minimum percentage of battery charge for the motion sensors. Actions are not executed if the battery level is below this threshold.
Helper Functions:
wasMotionDetected()
: Checks if motion was detected within the set interval.isBatteryLevelOk()
: Verifies whether the sensor's battery level is above the minimum required level.isDeviceReachable()
: Ensures the sensor is reachable and not offline.Lamp Control (turnOffLamp): A function to turn off the lamps.
Main Script: A loop that goes through each device pair, using the functions to decide whether a lamp should be turned off. The decision is based on the absence of detected motion, acceptable battery status, and sensor reachability.
Setup in HC3: This script needs to be implemented in the Fibaro Home Center 3. Log into the HC3 user interface and navigate to the Lua scripts section.
Customize the Device List: Update the devices
list to include the specific ID numbers of your motion sensors and lamps. Ensure that the IDs correctly correspond to the devices in your home.
Set the Minimum Battery Level: Modify the min_battery_level
variable as needed to set the desired minimum battery level for the sensors.
Activate the Script: After the script has been adjusted and uploaded, it should run automatically. It regularly checks the status of the sensors and controls the lamps accordingly.
Monitoring and Maintenance: Regularly monitor the system for proper functioning and update the device list as needed, such as when new sensors or lamps are added.
If it was in english it would be more helpfull