Cyberax's Blog

homesetup

Well, I have a residential elevator, and it's important to be able to call for help if you ever get stuck in it, it's also a part of the fire codes. For the curious, the requirements are codified in ASME A17.1-2019/CSA B44-19 section 2.27 Car Emergency Signaling Devices. That's why my elevator has a good old hardwired phone headset inside its cabin.

Unfortunately, I don't have a hardwired phone line anymore, and I don't want to get one either. It's a pretty steam-punky, that just a pair of wires can connect you to the central phone office, and provide you with a trickle of power even in the event of a complete outage. But in reality, hardwired phone lines are pretty susceptible to damage. They are also an annoyance to maintain, and they are pretty expensive.

So for a long while, I've just been using a trusty Yeastar S20 PBX with an S2 FXS module. This module provides the “station” part of the phone interface, allowing the handset inside the elevator to place calls. The call was then routed through a VoIP provider (1-Voip in my case).

To safeguard against electricity outages, my Internet router is powered through a large UPS, good enough for 3–4 hours, it also feeds power into the network via a PoE-capable switch. The Yeastar box in turn is powered through it.

This works fine... But I have never trusted this system completely, because of a huge number of “moving parts”. In an event of a power outage, my ISP can go offline, or maybe my UPS can malfunction, or my VoIP provider can randomly block my account.

Finding a better solution: LTE

My first idea: 1. Add an LTE module to the PBX. 2. Sign up for a voice-only line. 3. Add a backup battery to power the PBX box in case of an outage.

Well, first I bought an LTE module on eBay for $400 (ouch!): LTE Module Next, I tried to set up a cheapest-possible voice-only line with T-Mobile or AT&T. It turned out, that it would cost me more than $65 a month because “I'm on the unlimited plan”. Really, guys?

So I ordered a SIM card from Tello, an MVNO. They have really nice plans for exactly this use-case, for around $10 a month I can get a phone line with per-minute billing. I also got a backup 12V battery So I installed everything, and quickly set up the call routing via the LTE gateway.

It didn't work. The PBX couldn't place a phone call via that LTE module. I tried various permutations of options, and they all failed.

The module worked fine in data mode, though. I was able to set it up as a backup connectivity option for the PBX box. Yealink has really nice support for that, see the Failover Mode in their docs.

I could live with that, but this solution had still a bit too many “moving parts” for my liking. I still depended on the SIP provider for outbound access, I still needed the battery to hold, and I needed the LTE failover to work properly.

An even better solution: FXO+FXS

My attempts at setting up the connectivity highlighted that I'm really spending too much money on cellular lines that I barely use.

I have several tablets and phones, and they all have AT&T phone lines, and I even have two entirely unused lines for devices that I no longer have. I tried cancelling them, and AT&T kept me waiting for 40 minutes, offering various inane “deals” instead. This was the last straw, and I decided to move my secondary phones to an MVNO.

So I started browsing for options, and I stumbled on this: Phone Gateway It's a phone gateway offered by US Mobile as a home phone replacement. It has a backup battery and it only costs $10 a month. So I ordered it, and also got one of the FXO+FXS modules from eBay: FXO+FXS These modules have both a “station” port that allows connecting a phone headset, and an “office” port that allows it to connect to the PSTN (or a phone gateway).

I connected everything, and while in the process of testing the backup battery, I let it run out completely, resulting in the PBX box going offline. But to my surprise, when I tried to pick up the elevator phone, I got a dial tone! It turns out, that the FXO+FXS module ties both of its inputs together if it's offline. So a phone connected to its FXS input gets directly connected to the gateway on the FXO input.

This is perfect for me!

This allowed me to immediately simplify my setup, I no longer need a backup battery for the PBX box. So here's the final result:

TODO:

Here are some items I'd love to do eventually: 1. Add a periodic test call to verify that the gateway and SIP providers work correctly, and raise an alarm if the call fails.

#homesetup #sip #phone #todo

Discuss...

Alternative firmware

Buy firmware and get a license

Install the license

Set up the SIP settings

#homesetup #sip #videobell

Discuss...

So I've recently set up my alarm system to work with my home automation and with my security company. It works really well, and I'm delighted by the results.

Here's one problem, though. I like in-garage deliveries from Amazon, and I'd like to automatically disarm the garage partition when the delivery driver operates the garage door opener. And then re-arm the partition once the delivery driver leaves (of course, if the main partition is still armed).

Planning

First, I looked at doing everything using software only. I have an Envisalink card connected to my DSC alarm, so writing a HomeAssistant automation is fairly straightforward. I just

Ratgdo wiring

Assembling the synchronizer

Placing everything on a panel

Terminal blocks

Optocouplers

Power

Arduino programming

Testing

#dsc #homesetup

Discuss...

It's time to set up my new alarm system, after moving everything to a location downstairs and wiring up everything using Ethernet (see structured wiring for DSC). I have a DSC PC-1864 alarm, and here are some notes about setting it up. And it turned out to be not at all scary, once I found the right software!

First, I needed to ensure that the alarm is back in the factory configuration, this is easily done by shorting the PGM1 output with Zone 1 input (while the alarm unpowered) and then connecting the board to power for 10 seconds. After the reset, you can check that everything is working by getting into the installer mode using the default password (5555): "*8 5555". Now it's ready for the zone setup.

There is a nice blog from Chris Schuld detailing the alarm setup for his home. I did something similar before, but it's completely unintuitive and error-prone. But it turns out that DSC produces (a somewhat crappy) Windows-based software that can be used to set up their alarms using a visual UI.

It's called DLS-5, and it's a free download that is normally locked on the installer-only section of their website. Fortunately, it can be bought for $40 from https://www.credexalarmsystems.eu/en/dsc-software-dls5.html The panels are region-specific, so I made sure to get the North America (NA) version.

I also bought a PC-Link cable, CredexAlarmSystems sells them, but I found one much cheaper on eBay. I also bought one of the “PC-Link Adapter” cables from eBay for around $25, after failing to make the DLS work: PC-Link Adapter

Ultimately, both cables worked fine, after I found (by accident) the correct way to connect them, see below for the details.

These cables are simple pass-through serial cables, so you should be able to just connect any other USB-serial adapter, but I had no luck connecting my RaspberryPi adapter with female ferrule-style pins.

Connecting the DLS

System setup

Setting up the zones

Setting up partitions

Envisalink

#dsc #homesetup

Discuss...

DSC alarm panels are usually a veritable rats' nest of wires and strange connectors, so I decided to try and clean up my panel by using structured wiring. This makes a lot of sense, standard Ethernet wiring is good enough for 2 amps for a single pair, which provides more enough power for the DSC panel and alarms.

My house uses a Legrand On-Q enclosure, so I used an AC1015 Network Interface Module to terminate the wires from sensors in individual zones. At this point, I spent some time deciding on the way to map the wiring from the DSC standard to the T-568A Ethernet pinout.

Security alarms typically use cables with 4 wires: Black, Red, Green and Yellow. Sometimes cables might have Blue wires instead of Green ones.

This is the Ethernet wiring mapping that I came up with:

T-568A 4-wire Meaning
WhiteGreen
Green
WhiteOrange Black 12V(–)
Blue Red 12V(+)
WhiteBlue Green (Blue) KEYBUS
Orange Yellow KEYBUS
WhiteBrown
Brown

DSC uses the Black and Red wires for 12V DC power supply, so it's important to make sure that they are not connected to the same Ethernet pair (for example, do NOT connect them to blue and white-blue). This way, if you accidentally plug in a regular Ethernet device into a DSC plug, there won't be any magic smoke emitted.

Additionally, I used RJ11 phone jacks with 4-wire cable instead of the regular CAT6 cable for the zone-to-alarm wiring. It saves a bit of space and makes sure they are visibly distinct from Ethernet jacks. RJ11 jacks are perfectly compatible with the regular CAT6 Ethernet sockets.

Wiring the zones to a patch panel

The first step in organizing the mess was to terminate the wires from zone sensors in the network interface module. This turned out to be pretty easy, I just lined up the wires according to the mapping above and punched them in using a Keystone Punch Down Tool. It can be done with a thin screwdriver, but a proper punch down tool saves a lot of effort.

My alarm wiring shorts the Black wires with Green, and Red wires with Yellow at the door/window sensors. Then the sensor in turn shorts these two 2-wire bundles all together when it's closed. So all four wires end up shorted.

It means that if I connect all these zones to the alarm panel according to the wiring above, I'll end up with shorted +12V and -12V power lines. I have basically two ways to deal with it: I can leave the Black and Red wires (coming up from the sensors) disconnected inside the Network Interface Module, or I can use patch cables that don't have Black and Red wires to connect the door/window sensors to the alarm terminals.

Leaving the wires disconnected inside the Network Interface Module will make any future upgrade from passive sensors to powered motion sensors harder, but it's completely safe. Fortunately, it turned out that shorting the +12V and -12V is not a big deal for the DSC alarm panels, they simply shut down as a result and come back up once the fault is removed. So I decided to just use appropriate patch cables.

Here's how the alarm zone panel looks:

Using extender for zones

Another thing is that I wanted to move my alarm panel into the basement, out of my living room. This is mainly to get rid of an ugly metal cabinet in my food pantry, and also because my wiring cabinet was getting congested.

I added several conduits leading from the basement up into my living room, so there was plenty of space to just run the wires to the panel downstairs. But then I had an idea, I could use a zone expander and just run one wire from it to the control panel!

It worked well, I was able to use just one Ethernet cable to connect the zone expander with the main panel downstairs. Here's how the living room panel looks, and it also holds an Envisalink 4 board that exposes the DSC alarm state for my HomeAssistant: \ Expander And this is the main alarm panel:

Super-tidy!

For comparison, this was the initial look. Expander

Expander wiring

Zone expanders for the DSC alarm systems use the same KEYBUS standard for 4-wire cables. But we need two more modifications: 1. I also need to send the bell (siren) signal up from the main alarm panel. 2. I'd like to have some headroom for power. I have 3 keypads and 1 security camera powered by 12V from the expander, and this is just a bit too close to the maximum rated amperage for the CAT5 cable pairs. So I used up the remaining twisted pair for an additional power line.

This is the updated mapping for the expander-main connection:

T-568A Expander Meaning
WhiteGreen Additional Red MORE POWER
Green Bell (–) Siren
WhiteOrange Black 12V(–)
Blue Red 12V(+)
WhiteBlue Green (Blue) KEYBUS
Orange Yellow KEYBUS
WhiteBrown Additional Black MORE POWER
Brown Bell (+) Siren

As a note for myself, here's the zone mapping between locations and zones, they go in the descending order, from upstairs to downstairs:

Location Expander Zone Global Zone
4th floor door 8 16
3rd floor: balcony door and living room PIR 7 15
2nd floor balcony door 6 14
2nd floor bedroom PIR 5 13
2nd floor entry hallway PIR 4 12
2nd floor entry door 3 11
1st floor bedroom door and window 2 10
1st floor elevator door 1 9
garage PIR Main Panel 8

PIR stands for Passive InfraRed, in other words, motion detectors.

#dsc #homesetup

Discuss...