
Hello.
Today presents a device that I programmed a few days ago. It is used to automatically switch off the 230V receiver after arming the SATEL INTEGRA 128 alarm system.
For the implementation of the project, I used a ready-made SONOFF S20 socket from ITEAD, purchased for ALLEGRO. From the very beginning, I knew that the original embedded ESP8266-12E software goes into oblivion and replaces it with its own software written in the ARDUINO IDE.
The principle of operation is as follows:
The processor connects to the SATEL ETHM-1 module. It sends a query to the ETHM module about the status of zones, inputs, outputs and failures, calculating the CRC of data to be sent, and after receiving the data, it checks whether the CRC of the received data is correct. I do not use ready-made frames. The processor counts everything on foot, I only indicate to him which command of the Integration protocol I am asking about. Incorrect data is ignored.
After receiving the answer from the ETHM-1 module and its verification, a transition to control the relay takes place. In my case, if the zone programmed in the module is armed, the relay is turned off and 230V is cut off from the connected receiver. The opposite situation occurs after disabling the standby - the 230V receiver is turned on.
The ranges of the random polling time of the ETHM-1 module at the time of arming and disarming are set individually. Thanks to this, when the alarm system is armed, I can ask about the arming status more often than when disarmed.
Unfortunately, the ETHM-1 module is able to handle only one TCP / IP connection at a time. If at a given moment another device tries to ask for integration, the answer is "BUSY" - BUSY.
The ESP8266 processor detects this state, randomizes the time after which it re-joins.
Each connection with ETHM-1, regardless of whether it is successful or not, ends with disconnecting from the WIFI and waiting for a specific randomly selected time. After the time has been counted down, the procedure is repeated.
Briefly, the procedure works as follows:
Connection with WIFI -> Connection with ETHM-1 -> Asking questions -> Disconnecting from ETHM -> Disconnecting from WIFI -> Relay control -> Waiting for the drawn time.
Signaling by LEDs:
Blue on: relay is activated
Green slowly blinking: pause time measurement
Green fast blinking: connecting to WIFI
Green goes out briefly: ETHM BUSY status detected
The tests carried out so far indicate the correct operation of the system, but just in case I used the software WATCHDOGA - in the event of an error, it should reset the processor.
Time for photos and a video of the action:



In the attachment, soft ready to be uploaded after entering your configuration data. I would like to remind you that the processor must be powered from 3.3V, and the TX and RX lines also tolerate the same voltage level.
Feel free to comment.
!!!!! ATTENTION !!!!!
THERE ARE TENSIONS DANGEROUS TO HEALTH AND LIFE IN THE PRESENTED SYSTEM.
I CANNOT BE LIABLE FOR LOSS OR DAMAGES ARISING FROM THE USE OF THE INFORMATION CONTAINED IN THIS SUBJECT. \
.................................................. ..........
mod: suvorov
Also worth reading:
Satel Integra - system installation and configuration - selected issues
I invite you to read the other guides, highlighted topics and articles on security systems :
Stationary security. Alarm systems, Cameras, Intercoms, Gate and roller shutter drives, Home automation. Highlighted topics and guides.
If you cannot find the answer to your question in the above-mentioned topics, please visit the forum
https://www.elektroda.pl/rtvforum/forum77.html
I also encourage you to visit the General Guides section, where you will find materials from other forum sections, including those for those who are starting their adventure with electronics. :
https://www.elektroda.pl/rtvforum/forum510.html
Cool? Ranking DIY