Skip to the content
PCBKitNew board
2 layers62.2 × 57.1 mmWs2mqtt, the printed circuit board in 3D

Connect WiSafe2 devices to Home Assistant

Size
62.2 × 57.1 mm
Copper layers
2
Thickness
1.6 mm
Parts
8
Nets
65
Pads
97
Tracks, vias
112, 0
Pours
2
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
12 Mar 2022
Updated
12 Aug 2023

Overview

Ws2mqtt is an open-source printed circuit board by Tho85, from the Tho85/ws2mqtt repository on GitHub, published under the BSD-3-Clause licence. It is a 2-layer board of 62.2 × 57.1 mm with 8 parts on 65 nets, routed with 112 tracks and 0 vias.

It is built around the ESP32-DEVKITC-VE. Its parts include 3 connectors and 2 ICs. It belongs with the home automation and IoT boards and the ESP32 boards of this library.

Main components

1

README

README.md

ws2mqtt - WiSafe2 to MQTT gateway

ws2mqtt is an inofficial gateway to connect WiSafe2 smoke, heat and CO detectors to your smart home.

The gateway consists of an ESP32 module that handles Wifi and MQTT communication and integrates with Home Assistant through MQTT auto discovery. It is connected to an Arduino that acts as an SPI/UART converter. The Arduino talks to an official WiSafe2 module that is connected to your smoke detector network.

Disclaimer

This project is not related to or endorsed by the manufacturer of WiSafe2 devices. It is an unofficial hobby project.

:warning: DO NOT USE THIS PROJECT FOR SAFETY-CRITICAL PURPOSES! :warning:

This is a hobby project after all, so do not rely on it for your personal safety or the saftey of others. Always assume that it will not work in a case of emergency, and plan your emergency procedures accordingly. As the license states in more detail, I won't be liable for any damages incurred by this project.

Pictures

image

image

image

image

Supported devices

Tested:

  • ST-630-DE(P) Smoke detector
  • HT-630-EUT Heat detector

Not tested, but should be working:

  • WST-630 Smoke alarm
  • W2-CO-10X CO alarm
  • FP1720W2-R Smoke alarm
  • FP2620W2-R Smoke alarm

Features

  • Smoke / heat detector states:
    • Smoke / heat detected
    • Battery state
    • Radio module battery state
    • Device attached to base
  • Test button detection
  • Combined test button / detection event (see Tips & troubleshooting)
  • Test all devices from Home Assistant

TODO:

  • Test single device from Home Assistant
  • Logging via MQTT
  • ESP32 over-the-air updates

Additional Hardware required

Setup

  • Setup Arduino
    • Mount Arduino to PCB
    • Flash Arduino firmware (see Firmware-Atmega folder) via programmer
  • Setup ESP32
    • Mount ESP32 to PCB
    • Configure your secrets in Firmware-ESP/include/credentials.h (see example)
    • Flash ESP32 firmware (see Firmware-ESP folder) via USB
  • Power board via ESP32 USB connector
  • Setup WiSafe2 module
    • Mount WiSafe2 module to PCB
    • Join WiSafe2 network
      • Push button on module for 5 seconds
      • Module LED should light up
      • Within 5 seconds, push test button on a different detector
      • Module LED should blink multiple times as a confirmation
  • Mount ESP32, Arduino and WiSafe2 module on PCB
  • Configure Home Assistant
    • The gateway and all detectors should be visible in the "Devices" tab
    • Create an automation that listens for the alarm event emitted by the gateway, see below

Tips & troubleshooting

  • The recommended way to react to smoke detection and test events in Home Assistant is to listen to the alarm event emitted by the ws2mqtt Bridge device. This event is fired when any of the connected detectors detects smoke, or when any of the detectors' test buttons is pressed. This way you can test your emergency scenes and automations by pressing a detector's test button.

  • The "smoke detected" sensor shows an unknown state

    This is actually a deficiency of the WiSafe2 protocol. As far as I know, there is no way to query a device for the current smoke / heat detector state. Additionally, a "smoke detected" message is only sent once to other detectors, and not repeated later. So if you start the gateway while a "smoke detected" event is ongoing, there is no way for the gateway to know about that event. I decided to err on the side of caution and show the state of devices as "unknown".

  • The "battery" sensor, "docked" sensor etc. show an unknown state

    To conserve battery power, the gateway does not actively query the state of these diagnostic sensors. The sensor state is only updated on change. The easiest way to force an update is to remove a detector from its base, wait a bit, and re-mount the device. This should update not only the "docked" sensor, but also the battery ones.

  • What is the programming language you used, and why is it not perfect C?

    C is not my mother tongue, so it's nearly certain that there are race conditions, buffer overflows or bad C programming practices in the code. Feel free to file an issue to point things out, or even better file a pull request.

License

See LICENSE.

Final notes

Shout out to C19HOP and his WiSafe2-to-HomeAssistant-Bridge, for helping in reversing the protocol, and for giving me the motivation to finish this project I've been working on for the last months.

Parts

8
QtyValueFootprintReferences
1AntennaConnector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalAE1
1Arduino Pro MiniArduino:Arduino_Pro_MiniU2
1ESP32-DevKitCEspressif:ESP32-DevKitCU1
1ICSPConnector_IDC:IDC-Header_2x03_P2.54mm_VerticalJ1
1Logic analyzerConnector_IDC:IDC-Header_2x05_P2.54mm_VerticalJ2
1Logo_Open_Hardware_SmallSymbol:OSHW-Logo_5.7x6mm_SilkScreenLOGO1
1Module powerJumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mmJP1
1W2-ModuleTho85:W2-MMJ3

Questions

How big is the Ws2mqtt PCB?

It measures 62.2 × 57.1 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Ws2mqtt use?

8 parts, built around the ESP32-DEVKITC-VE. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Ws2mqtt KiCad files?

From the Tho85/ws2mqtt repository on GitHub, at the commit this page was made from: the board is PCB/PCB.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Ws2mqtt design in my own project?

Its repository publishes it under the BSD-3-Clause licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

Similar boards

  • 2 layers103.8 × 50 mmGalagino pcb set, the printed circuit board in 3D

    Galagino pcb set

    harbaum/galagino

    A Galaga, Pac-Man and Donkey Kong arcade emulator for the ESP32

    26 parts558
  • 2 layers115 × 75 mmSpinCoater, the printed circuit board in 3D

    SpinCoater

    RParkerE/OpenSilicon

    OpenSilicon enables DIY semiconductor fabrication with open-source guides for building IC equipment at home. The project includes BOMs, 3D files, firmware, and PDKs, supporting makers and researchers in chip fabrication.

    11 parts55GPL-3.0
  • 2 layers127.3 × 54.1 mmESP32 SolarBox, the printed circuit board in 3D

    ESP32 SolarBox

    cole8888/SRNE-Solar-Charge-Controller-Monitor

    Read data from SRNE solar charge controllers.

    34 parts42
  • 2 layers99.9 × 99.9 mmSplit flap, the printed circuit board in 3D

    Split flap

    tinkermax/split-flap

    DIY mechanical spli-flap display

    28 parts13CC-BY-4.0
  • 2 layersJF ECU32, the printed circuit board in 3D

    JF ECU32

    JoachimF/JF-ECU32

    RC Jet Engine ECU

    27 parts12GPL-3.0
  • 2 layers72.5 × 84.8 mmDevboard, the printed circuit board in 3D

    Devboard

    ste2425/PSP-Bluetooth-AVConnector

    An AV-Out Breakout library for the PSP. Providing Kicad symbols and footprints to interface with the PSP 2/3K AVOut socket (also known as the TVOut socket)

    13 parts12
  • 2 layers100 × 88.9 mmGen2, the printed circuit board in 3D

    Gen2

    Alignof/Juggernaut

    疑似時限爆弾解除競技

    41 parts10MIT
  • 2 layers96 × 100 mmADS1299EMG8xR2, the printed circuit board in 3D

    ADS1299EMG8xR2

    RF-Lab/emg_platform

    EMG platform

    152 parts9