Skip to content

Using NodeMCU PowermaxProModel6

davesmeghead edited this page Apr 7, 2023 · 5 revisions

Using NodeMCU

In this guide I'll walk you through most of the required steps to use the NodeMCU as the middle-man between a PowerMax Pro and Home Assisant.

I'll use Linux in this guide.


Disclaimer: _I'm not responsible for bricked devices, dead alarms or short circuits.

_- You are choosing to make these modifications, please don't point the finger at me for messing up your device.

- Your Visonic-warranty will (possibly) be void if you tamper with any part of your device / software.



The guide contains the following subjects:
  • Hardware
  • Visonic Pin-layout and proper wiring to NodeMCU
  • Firmware on NodeMCU
  • Setup esp-link
  • Configuration in Home Assistant
  • Tips and tricks

Hardware

You'll need:

  • A NodeMCU
  • Four wires
  • Visonic PowerMax Pro

AliExpress: NoceMCU board v. 0.1 Current Title of Product: ESP8266 CH340G CH340 G NodeMcu V3 Lua Wireless WIFI Module Connector Development Board Based ESP-12E Micro USB Repalce CP2102) - Search Link.

image|349x247

Alarm Panel Pin layout

Picture of the Visonic PowerMax Pro (Mine is "Model type 6`) Pin-layout

Image credits: viknet from domoticaforum.eu

Visonic Pin Type
TP71 3.75V
TP29 GND
TP35 TX
TP33 RX

So, connect the following PIN's, from the Visonic PowerMax Pro (I've model type 6) to your NodeMCU:

Visonic NodeMCU
3.75V 3.3V
GND G
TX RX
RX TX

image|690x401 image|690x491

If you would like to make a permanent solution, where's a guide for soldering it to the mainboard:

Visonic NodeMCU
TP71 3.3V
TP29 G
TP35 RX
TP33 TX

Soldering by @dmarofer on HA's Community

Firmware on esp-link

As speaking, esp-link recommend to use version 3.0.14.

You can find the latest release here, and 3.0.14 here. A direct download-link to the firmwarepackage version 3.0.14 is here. Firmware-package download-link

You'll need a software, to flash the firmware. I recommend using esptool, cause it's easy to use. If you prefer a GUI, take at look at this page.

esptool can be installed via pypip:

pip install esptool

If you don't have Python installed on the machine, kindly take a look at python.org.

Flashing esp-link is easy with esptool, and you'll find all relevant information here. If you're unsure about which Serial Port to choose, kindly look at the "Serial Port"-page, from esptool's GitHub-page.

Before flashing the NodeMCU, you'll need to find the current flash-size, with: sudo esptool.py --port /dev/ttyUSB0 flash_id

Output:

> sudo esptool.py --port /dev/ttyUSB0 flash_id
esptool.py v2.8
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: rr:ee:mm:oo:vv:ed
Uploading stub...
Running stub...
Stub running...
Manufacturer: 1c
Device: 3016
Detected flash size: 4MB
Hard resetting via RTS pin..

You can also use the following image, as a reference: Source: github.com/spacehuhn/esp8266_deauthe _Image credits: spacehuhn/esp8266_deauthe > Wiki > Installation

Now, extract the firmware package file, and cd to the extracted folder.

And now run the following command:

sudo esptool.py --port /dev/ttyUSB0 --baud 230400 write_flash -fs 4MB -ff 80m \
0x00000 boot_v1.6.bin 0x1000 user1.bin \
0x3FC000 esp_init_data_default.bin 0x3FE000 blank.bin

_If it's reporting that boot_v1.* is missing, try correct it to the right version. If you can't find the four files in your folder, you properly downloaded the release from Github, instead of downloading the firmwarepackage version 3.0.14 (If the link is down, check Github and see if you can spot a fresh one)

Setup esp-link

You'll find a new hotspot, with esp-link. Connect to it, and setup Wifi.

Also, diable all pins, which aren't in use. image|690x485

Go to 'µC Console' and change baud to '9600' - Or, whatever needed.

My alarm use baud 9600, but check the Wiki, if you're unsecure:

Baud rate

Different panel firmware versions uses different baudrates. This needs to be set in either the Ethernet/RS232 connection or the USB/RS232 connection. I believe that these are: 17.133 and below - baudrate is 9600 18.XXX and above - baudrate is 38400

Configuration to Home Assistant

You should now be able to see details on the µC Console-page: image|689x169

NOTE: When adding the integration in HA, as well as the IP address you have to specify a port. If this is set to the ESP-Link default, as there's no indication of which port to be used in the ESP-Link configuration page on the 8266, then in order to connect through the esp-link to a microcontroller use port 23.

Adding Visonic to Home Assistant, can be done with the following configuration to configuration.yaml:

# Visonic PowerMax Pro
# Source: https://github.com/davesmeghead/visonic - Alarm
#*# *# #* #* *# *# #* #* *# *# #* #* 


Kindly note that i'm using [secrets](https://www.home-assistant.io/docs/configuration/secrets/). You can replace `!secret visonic_ip` with the IP if you like to do so...

For more questions related to setup on HA, kindly check the main [readme](https://github.com/davesmeghead/visonic/blob/master/README.md)-file.

## Tips, recommendations and other stuff

### Static IP / IP Reservation**
I highly recommend you to define a Static IP-address on the esp-link device, or even better, defining the IP in your DHCP service (On most normal ISP routers, it's called IP Reservation, or something like that).

### Connect to the Serial device, on a Linux client
If you're on Linux, and would like to connect to the serial output, it's fairly straight forward.

Add the device with socat, and define the path (don't forget to correct the IP):

sudo socat -d -d pty,link=/dev/ip1,raw,echo=0,waitslave tcp:192.168.1.123:23


And now connect a screen-session, to that path:

screen /dev/ip1 9600

Where `9600` is the baud-rate.

### Flashing permission-error
You may not have the right permission on your system, to begin with. Normally it's fairly to fix.

Try and Google your system name and something like ` /dev/ttyUSB0 permission`, if you're facing the problem.

After correcting the permissions (on some systems by adding your user to a specific group), it's required to log out, and back in, for the changes to take in place.