Fireangel fire/CO/heat alarm network bridge integration

Who provides your email? Is it Gmail? I have just managed to do this with the IMAP Email Content integration that you mentioned

This is the config I used

sensor:
  - platform: imap_email_content
    name: IMAP Email
    server: imap.gmail.com
    port: 993
    username: 
    password: 
    senders:
      - [email protected]

template:
  sensor:
    - name: FireAngel Alarms
      state: >
       {{ state_attr('sensor.imap_email','body')
         |regex_findall_index(">(.*) has been detected") }}

Hope this helps!

1 Like

So I was in communication with FireAngel at this time. I sent some test results to them which were not good at all. I received direct feedback at the time that this downtime was a result of improvements following my complaint.

The complaint I made to their tech department, related to a test I carried out, where I could get the gateway to say ā€œall devices are OK / Onlineā€, even as though Iā€™d bagged up all my alarms and removed them from the property.

After being bitterly disappointed with the gateway (and not minding if I destroyed it), I attached it to a debugger, to see exactly what it was doing. With the mindset of intercepting its comms to create a local HA integration.
I could see all the JSON state changes being sent to AWS. But in the end I went a different route (I will post the details in this thread). But I can also attach a debug log of the gateway communicating with AWS, in case anyone wants to take a look.

However, my recommendation is not to buy the gateway. It is a very unreliable piece of kit. There are better ways to get the WiSafe2 feed into HA.

My gateway has been offline for almost a year, and the App still reports 1 device as ā€˜onlineā€™.
It also states "Monitoring the risk to your home in real time using complex algorithmsā€¦ Everything is OKā€.

1 Like

Hi. Iā€™m no HA expert. But I would like to share here my experience of integrating WiSafe2 alarms with HA. For any who are interestedā€¦

Like some others, I have expired Nest Protects, which I wanted to replace with a cheaper alternative, but I also wanted to realise a HA integration.

I initially purchased the FireAngel Gateway, but found it to be a dreadfully unreliable piece of kit (remove all the alarms at once, and it wonā€™t notice)!
I also observed that the gateway would not do anything if it couldnā€™t reach itā€™s AWS end-point. i.e. It wouldnā€™t work to snoop the alarms locally. It would only work to snoop what was being uploaded to AWS.

So in the end, the approach I took was to build my own WiSafe2 gateway.
It means all the coms is local, the alarms are unmodified, and I can listen in / talk back to them.

With this, I am able to see states, test and silence the alarms from within HA, I receive alert notifications on my phone and my google homes speak out which alarm was triggered.

Iā€™m absolutely sure that my HA automations can be improved by the community, as Iā€™m not experienced in creating them. So if this is your area, feel free to help improve them.

RE: My gatewayā€¦
The WiSafe2 protocol uses an 868MHz radio. The communication is encrypted and the specification is not documented for the public.
However, the radio module communicates with the alarm via SPI. So I took a radio as a donor and built my own gateway
(if you want to do this, you can get a cheap radio from an old, expired alarm, from a strobe (really cheap on ebay) or by buying the radio as a standalone module).

With the radio on the bench, I used PulseView to decode all that I could reverse-engineer. I was able to document:
Receive:

  • Test Button (and result good/bad)
  • Fire Emergency
  • CO Emergency
  • On/Off Base State
  • Low Battery State
  • Device ID
  • Model ID

Transmit:

  • Check Radio Pairing Status
  • Enter Radio Pairing Mode
  • Silence Alarms

My gateway uses an Arduino Nano, and connects to HA via USB.

Iā€™ll share the PCB, Arduino Code, HA automations, etc shortly.
Iā€™m new to the HA forums, so please bear-with me.

Iā€™ll also share my effort at reverse-engineering the WiSafe2 communication, for anyone looking to develop this further.

4 Likes

Hi,
Hereā€™s everything Iā€™ve built, in case you want to do this yourself.

Please let me know if I should share this somewhere else. As I say, Iā€™m new to posting in the HA forums.

Hereā€™s what it does:

HA Sensors (for each alarm)

  • Battery state
  • On/Off Base state
  • Event (test / emergency / type(smoke/heat/co))

HA Sensors (for the gateway)

  • Heartbeat (confirmation the radio is still online)
  • Messages (responses to radio pairing, etc)

HA buttons:

  • Check pairing (check gateway radio pairing status)
  • Initiate pairing (start pairing, if it is not already paired)
  • Test CO event
  • Test Fire event
  • Silence alarmsā€¦ takes a moment for the message to propagate around all the alarms, but works

Mobile (HA companion app):

  • Critical alerts (takes phone off silent)
  • Messages state the origin and cause

Google TTY:

  • Speaks the alert, origin and cause



Iā€™ll write a proper build guide at some point, if thereā€™s any interest. But in the meantime, this is everything you should needā€¦

All files, and more are here: GitHub Link

RE: The PCB:
The level sensors are just the usual bi-directional 3.3/5v type from ebay.

There is a jumper which toggles the driver mode.

  • For normal operation with HA, the jumper should be on.
  • If you want to receive raw wi-safe2 hex data from the alarm network, for the purpose of further development, then remove the jumper and connect the gateway to a serial debugger.

Iā€™ve been using this setup myself for almost a year, and for what I want, it works really well.
One limitation, is that the alarms only send things like battery state when they need to. So if you restart home-assistant, the state will revert to ā€˜unknownā€™, until you test the alarm, or unless the battery really is low.
Iā€™m sure sensor states can be retained easily enough if you are familiar with HA configuration files, and if thatā€™s how you want it to work

Hereā€™s the files to build a gateway:

PCB (easy EDA)

Enclosure (for 3d printing)

Arduino Nano Code

And hereā€™s the HA yaml:

HA Automations (for google say events)

HA Configuration (sensors and templates)

7 Likes

Well done.

Not sure Iā€™d attempt it without a detailed build guide myself, but looks great.

This is totally awesome @chopwood. Thank you so much for sharing. Iā€™m yet to read through this and make sense of itā€¦

My first thought is that I could potentially re-fashion my RFLink Gateway for this purpose (https://www.rflink.nl/)ā€¦ I no longer use it for anything else.

Anyway, need to understand what you did firstā€¦ I will do that next!

I will share some progress once I have some!

Thanks again. You are a genius! :slight_smile:

Thanks for the link. Looks like a nice radio. I only had the sonoff bridge, which is 433MHz only.

If you have an 868MHz version, maybe this will help you.

Let us know how you get on :+1:

Project has been migrated here

ReadMe this should have all the detail needed to build a WiSafe-to-HomeAssistant Bridge yourself.

Cheers.

3 Likes

This looks amazing. Thank you for taking the time to document and share it. I just need to try and get my head round it now and find some time to try building this.

Would it need much modification to work with an ESP32 with ethernet port rather than plugged into Home Assistant via USB? This would allow it to be placed independently anywhere there is a network port available.

The deciding factor for me to use the Nano was the requirement to use SPI in slave mode.

Typically, the Arduino would be the SPI master (which is better documented online).
But in this project, the radio is already defined as the master, so the Arduino must be used in slave mode (with an interrupt line to get the attention of the radio when we want to send some data to it).

I didnā€™t have much luck getting it working with an ESP8266. But a quick google suggests that the ESP32 could work.
Plus, the ESP32 is 3.3v native. So it wouldnā€™t need the level-shifters buffering the lines to the radio.
I guess it would also need the sensors re-thinking. i.e. switching to a TCP socket sensor in HA, instead of the USB-TTY.

Iā€™ll have a look, but wonā€™t make any promises.
Especially with the working Nano sketch shared, which opens up the floor up for anyone to port it.

@chopwood @willsy555

Using a donor alarm like in the DIY guide provided seems to be the best approach. I was looking into the FireAngel Network monitor that is only sold in mainland Europe(?) And this gives no extra information on the 868MHz encryption. This guide was only available in German which I have run through Google Translate to find the following

  • The test button of one of the network components must be pressed within these five seconds
  • When the Network Monitor is successfully added to the network, the application flashes the red LED five times and then sends the network list to the PC where the Component Controls area displays ā€œActive Componentsā€ or ā€œMissing Componentsā€ in the relevant display areas will.

The German version of the instructions are here: https://www.eps-vertrieb.de/downloads/file/id/a32ecd86750ababfc823ce26874449b2

1 Like

Thank you @chopwood for sharing this!

I managed to get a donor device (W2-SVP-630L) locally off Facebook Marketplace for Ā£5 :slight_smile:

I have ordered the PCBs (x5) which should come in a couple of weeks.

I am looking forward to linking this up with SMS via an old 3g modem!

1 Like

Thx for the research!! Nice. Much better then the gateway.

This week had I receive the PCB and solder the components.

For me itā€™s only working with de battery installed, not without the battery (radio is off)
So I have made a connection between 3V3 output of the nano to the + of the removed battery.

Thx for your work.
Fokko

1 Like

Hmmā€¦ I have a problem. first I had made the print, and was happy to see the red led of the radio.
Today time to copy the code to HA and first start-up.
But the sensor.fireangel_radio_heartbeat: Offline!.
sensor.fireangeldata say: ā€¦ INIT FAIL - CHECK RADIO!

I have checked with my 2 radios(with accu and 3V3). The last option I had, did I try my working radio from my Alarm control unit (without battery) and had the same problem.

Then I check my in Arduino with the serial monitor and have the same INIT FAIL -ā€¦

Do you have any suggestions or tips??

Thx
Fokko

Hi Fokko,

Thanks for sharing your experience RE: the radio which didnā€™t power up.

When I developed this, I had a black and red radio which both worked. But there could be more variations out thereā€¦
I will make some additional tests for you soon, using the gateway with the black, battery powered type of radio.
Seems like I will need to add the 3.3v bridging mod to the guide.

In the meantimeā€¦

From what you describe, I would have thought your workaround should be good.

I compared a radio from a strobe (red), with a radio from the alarm (black).
There are some component differences depending whether itā€™s battery powered or not.

Black board = From Alarm (battery powered)
Red board = From Strobe (mains powered)

Differences:

  1. 100kĪ© on the black board. 0Ī© on the red board.
  2. Present on the black board. Omitted from the red board
  3. Omitted on the black board. Present on the red board (0Ī©).

However, essentially, with the battery removed, this difference is worked around by bridging 3.3v supply to the radioā€™s battery +v to power it up, which you have found.

By default, the Arduino code gives the radio up to 120 attempts to initialise:
line 20:
int maxInitAttempts = 120;

With a 1 second delay between each attempt:
line 92
delay(1000);

In that time, weā€™re waiting for the radio to return HEX 46 7E

You could try increasing the delay, to give the radio a bigger break between repeated attempts.

Regards,
Chris

Chris,

thx for you reply!

first I have increase the delay to 1000 but no luck.
second I have look to you pictures and we donā€™t have the same radio, my radio is form the Netherlands. Is it possible so the dutch radioā€™s donā€™t give Hex 46 7E but another hex key??

I have tried to work without the battery, and have removed al green components. The to blue resistors are 0Ī©. But there are more difference, it donā€™t work :frowning:
Later this week with a fresh head I look again.

Regards,
Fokko

Hi Fokko,

A couple of questions:

  • You appear to have a red and black radio there. Do you get any of them to initialise?
  • Were you able to get the radio to initialise when the battery was still attached?

There are clearly differences between your radios and the one I have here.
What devices did your radios come from?

Using one of my black, battery powered radio, with the battery unsoldered, I confirmed that the link-wire mod you suggested is sufficient. There is no need to modify any of the other components on the board!!

For anyone wishing to un-solder the battery, I have updated the guide to add the link wire. But Iā€™ve used the pins on the radio, to keep the PCBs detachable.

battery-remove-bridge-1

Also, to aid troubleshooting the connections, a pinout of the radio is here:

I have 3 radios laying around, and all initialised OK with the Arduino code ā€˜as-wasā€™.
But in an effort to improve, I have updated the code. See change notes below.

I tested 2 different initialisation sequences:
{0xD3, 0x19, 0x50, 0x00, 0x7E}
{0xD3, 0x14, 0x8E, 0x7E}

Either of these return {0x46, 0x7E} when the radio is ready to respond to subsequent commands.

I donā€™t have enough data to know the differences between the commands, so I left both options in, with a comment.
But with 10 cold starts, {0xD3, 0x19, 0x50, 0x00, 0x7E} seemed to initialise faster for me. So Iā€™ve changed the default over to that.

I also changed the code wait 5 seconds at boot, to allow the radio to stabilise before attempting the init.
If unsuccessful, the Arduino will reset after 30 seconds and keep retrying. So please make sure to wait for at least a couple of cycles.

Please let me know if you see any improvement with the new code.

Regards,
Chris

Hi Chris,

Iā€™m in a similar position to Fokko but Iā€™m using a strobe (red) radio. Iā€™ve left your arduino code (both versions) running for many cycles but it always fails to initialise the radio.

The radio LED flashes red, and the voltages supplied to it look correct during startup attempts but it stubbornly refuses to work.

The radio definitely works, as Iā€™ve checked it by replacing it in a strobe unit after a session trying to get the bridge to work.

Appreciate all your efforts, and assume Iā€™ve done something stupid. If you can suggest anything I could try to diagnose this Iā€™d be very grateful.

Thanks

Malcolm

Hi Malcolm,

Really sorry youā€™re having trouble.
I have tested a multiple builds of this now with 8 different radios and all of them work OK. So Iā€™m keen to understand what is causing the issue for you and Fokko.

Can you confirm you are using the 16MHz Arduino Nano (and not the 8MHz variant).
TIP1: Chip must say ā€œ328ā€ and not ā€œ168ā€
TIP2: Try uploading the built-in Arduino example blink sketch. It should run at 1-sec on, 1-sec off.

I trust that you have already double checked the quality of all your connections, through the level-converters.

Have you opened the COM port in the Arduino IDE after programming?
You can connect at 115200 baud.

You want to see this:

This is what happens with the radio removed.

You can also send commands (like ā€œ8ā€), which checks the status of the pairing:

If your radios arenā€™t attached to your network (in case they are 2nd hand and still paired with somebody elseā€™s network), then see FireAngelā€™s video to ā€˜un-learnā€™ the radios:
Un-Learn Wi-Safe2 Alarm

All that said, the existing sketch only tells us OK / Not-OK.
So to help us understand whatā€™s happening here, Iā€™ve added a new debug sketch here:
debug-sketch

With this, you will have:
ā€œ.ā€ when the radio does not respond ā€“ Implies a connection or sync issue
ā€œ-ā€ when the radio responds Not-Ready ā€“ Implies some other condition with the radio

If you find you are seeing ā€œ-ā€, then you can investigate further by uncommenting line 112:
// for(int i = 0; i < sizeof(spiBuffer); i++){ Serial.print(spiBuffer[i],HEX);}Serial.println(); // - debug - print response from radio

With this line uncommented, it will print the raw contents of the SPI buffer when the Init fails.
The Arduino is waiting for ā€œ46ā€ to show ā€œINIT OKā€

Please feel free to PM me to let me know what results you got.

Regards,
Chris