I think the problem is that you’re relying too much on examples to give you the code that you’re looking for.
For a project of this type, you’re never going to find off the shelf code that fits your requirements 100%. Whilst its true that examples will get you headed in the right direction and show you how to do various operations, you still need to have the skills to piece these segments of code together into a workable solution.
@Alexis_Cabrera has given you some fairly substantial pieces of code (something I generally tend not to do, as I think can be counterproductive) but you’re still no closer to understanding how to achieve your goal. This tells me that you need to work on your coding skills, in particular how to use variables a flags to use throughout your code.
You’ve fixated on the need to use a segmented switch to mimic the layout in the screenshot. In reality, as you only have two possible states (at home, or away) any type of switch widget could be uses as they all provide a binary state (0/1, on/off, yes/no, home/away) switching function.
You should be using the switch to set a Boolean flag (at home - true or at home = false). You then use that flag throughout your code. (if alarm is activated and at home = true then do this, else do that).
I’d suggest that you take one of the simple sketch builder examples (say the example to turn an LED on or off), get it working then add-in m,ore functionality with hand-crafted code. Use flags to perform functions - for example if the LED is on and a slider widget is set to less than 100 then light a second LED.
You’ll learn much km,ore doing this, and be better equipped to build, and more importantly maintain, your code.