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
Question
julesmartens 0
Hi,
I'm no fan of the build-in alarm in HC2 so I'd like to create my own scenes/VD's for this. .
@Sankotronic is working on a very promising UHAS system but his plans are pushed out (no offence, he released real nice things already, I'm fan)
so I decided to move on, writing some code myself with hopefully some help of you ;-)!
What do I use in my alarm;
> Lights (selected regular lights in the house to switch to 100% when alarm is breached)
> Door/window sensors
> PIRs
> Sirenes (for acoustic alarm)
> flashlight (for visual alarm)
> RGBW led indicator (at the entrances to notify alarm is; just armed (leave the house indicator), armed (not safe to enter indicator), disarmed(safe to enter indicator)
What do I want;
> Fibaro remote keychains available to manually arm/disarm the alarm
> All users have a IFTTT account on their phones to trigger a scene when entering/leaving home (geofence). This will set my global "guestmode". (bad exerience with Fibaro GPS)
> When nobody is at home, the global "alarmmode" should set to "FullAlarm". At "FullAlarm" all PIRs and D/W's sensors are set to armed. (report error when not in safe state when arming).
> When at night (Darkness) all users are at home and all PIR and D/W are safe for X time, "sleepstate" to be set "sleep" else "awake".
> when at sleep, the "alarmmode" will switch to RingOnly. Only the D/W sensors will be armed (not PIR). When a PIR is breached the alarmmode will be set to disarmed state. When sleep state is reached again the alarmmode will switch back to RingOnly.
> if armed and breached, the alarm is triggered. The sirenes and flashlight will start to run and all lights will be set to 100%. If all D/W and PIR are safe for X time, alarm to back to armed state and lights off.
> if armed and breached, the timestamp of alarm will be logged. If alarm is disarmed after it was breached the notification LED will warn for this.
> If I disarm the alarm, put all lights/DW in safe state.
> Notifications via Pushover or even better, use the message hub of @autofrank with Fibaro PopUps and Push services. Unfortunately I currently have errors with the message hub.
What is my current status. All code based on simple if/then LUA coding, no fancy loops.
DONE: scene to check all PIRs Scene will set global variable
DONE: scene to check D/W sensors. Scene will set global variable
DONE: One scene to take care of the global sleepstate
DONE: One scene to take care of the global guestmode
DONE: a VD to manually set alarmstate and alarmmode.
DONE: a VD to manually set guestmode
todo: a mainalarm scene to arm/disarm the alarm (based on above algorithm)
todo: an alarm scene to trigger the alarm when breached (or merge this in the mainalarm scene)
todo: scene(s) for RGBW led indicators
todo: scene(s) for the push notifications (Alarm breached, error (Eg door/window open when arming the alarm)
I noticed that I get stuck with the remaining scenes. I'm no programmer, so I use mainly simple if/then LUA code. With a lot of scenes in the alarm you easily get lost.
In an attempt to keep my coding cleaner/more condensed I want to use tables/json. I already use the Hometable but that's just a simple copy the instructions of @AutoFrank.
Questions;
For the remaining alarm scenes I have difficulties how to store a table in a global and even more how to use from a table. The tutorials on this topic are not clear to me yet.
For example, when the alarm is breached, how to switch all lights to 100% for the device IDs in a global(table). I have seen examples of code like k,v in (i)pairs but I don't get it yet.
Can somebody help me with some code examples?
Any other suggestions on my ideas for an alarm?
Thanks!
Regards,
Jules
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.