While it helps proving the basic idea for how a specific goal can be achieved, it sometimes provides wrong results that manually need to be corrected (either by doing it on your own or asking the bot to use a different approach)
I am not entirely sure if this is helpful or confusing as the results are sometimes not valid rules, especially once it become more complex.It might help to get a starting point though if you are completely lost.
wtf i just asked him to do a simple alarm system this is not my coding
rule "Alarm system with pincode and motion sensor notifications"
when
Item MotionSensorGroup changed
then
// Check if the alarm is already armed
if (AlarmStatus.state == ARMED) {
// Check which motion sensor triggered the alarm
var String sensorName = MotionSensorGroup.members.findFirstMatch(member|member.state == ON).name
// Prompt the user for a pincode
var String enteredPincode = prompt("Enter pincode:")
// Check if the entered pincode is correct
if (enteredPincode == CorrectPincode.state as String) {
// Pincode is correct, disarm the alarm
AlarmStatus.sendCommand(DISARMED)
// Play a disarm sound
playSound("disarm.mp3")
// Send a notification to the homeowner
sendNotification("Alarm disarmed. Motion detected in " + sensorName)
} else {
// Pincode is incorrect, play a loud siren sound
playSound("siren.mp3")
// Send a notification to the homeowner
sendNotification("Incorrect pincode entered! Intruder detected in " + sensorName + " Check the security camera for more information.")
// Turn on all the lights in the house
sendCommand(AllLights, ON)
}
}
end
I don’t think “prompt” is a valid command though… Also most likely the Lux-Sensor example should be “inverted” as it’s decreasing the brightness with decreasing ambient lighting, so you should have asked it to correct that
i am impressed. look when you dont know where to start its a good kick.
Well for the lux i would send first 100 and then decrease it and if else off but still pretty good example also the alarm looks like a good start.
I have tested this part of functionality recently related to writing DSL rules
, it behaves quite well, I’m wondering how, apart from writing rules, it can be used in openhab