Sugar Valley NeoPool Controller~
This feature is not included in precompiled binaries
To use it you must compile your build. Add the following to user_config_override.h:
#ifndef USE_NEOPOOL
#define USE_NEOPOOL // Add support for Sugar Valley NeoPool Controller (+6k flash, +60 mem)
#endif
Optional set Modbus address matching the address of your device (default is 1) by add the following to user_config_override.h:
#ifndef NEOPOOL_MODBUS_ADDRESS
#define NEOPOOL_MODBUS_ADDRESS 1 // Any modbus address
#endif
Sugar Valley NeoPool are water treatment systems also known under the names Hidrolife, Aquascenic, Oxilife, Bionet, Hidroniser, UVScenic, Station, Brilix, Bayrol and Hay. It uses a RS485 interface for enhancment equipments like Wifi-Interface or a second attached control panel. Most functions and parameters can be queried and controlled via the RS485 interface.
The sensor shows the most of parameters such as the built-in display:

Basic commands to control filtration and light are implemented. However, the sensor provides commands to read and write the NeoPool controller Modbus register, means that everyone has the option of implementing their own commands via their home automation system or using the Tasmota build-in possibilities with Rules and Backlog.
Configuration~
NeoPool controller connection~
Connect NeoPool controller using a TTL UART to RS485 converter to two GPIOs of your ESP. It is recommended to use GPIO 1 and GPIO 3 for this because the ESP then uses the serial hardware interface.
Note that your TTL UART to RS485 converter also works with a operation voltage of 3.3V. Some converters are not designed for operating with 3.3V and only works with 5V TTL level - these converters are useless. Do not operate your TTL UART to RS485 converter with 5V, your converter must be operated with the 3.3V from ESP, otherwise the ESP GPIO ports will be damaged.
The Sugar Valley NeoPool RS485 connector pins are located under the connection cover, for the Sugar-Valley products on the right-hand side next to the relay connections:

The pin assignment (from top to bottom):
| Pin | Description |
|---|---|
| 1 | +12V |
| 2 | |
| 3 | Modbus A+ |
| 4 | Modbus B- |
| 5 | Modbus GND |
Tasmota settings~
If you followed the recommendations above, the two GPIOs will be assigned as follows under Tasmota Configuration -> Configure Module:
- first change Module type to
Generic (0)- this will restart your Tasmota
After restart * set GPIO1 to NeoPool RX * set GPIO3 to NeoPool TX
so it looks like this

After Tasmota restarts the main screen should display the controller data as shown above.
SENSOR data~
Sensor data are send by tele/%topic%/SENSOR JSON reponse:
{
"Time": "2020-08-31T10:20:54+00:00",
"NeoPool":{
"Time": "2020-08-31T10:20:55",
"Type":"Oxilife (green)",
"Temperature":23.1,
"pH":7.26,
"Redox":0,
"Hydrolysis":0.0,
"Filtration":{
"State":1,
"Speed":1,
"Mode":1
},
"Light":0,
"Relay":{
"State":262,
"Acid":1
}
},
"TempUnit":"C"
}
Commands~
This sensor supports some basic commands to control filtration and light.
Regardless, all device registers can be read and written. Modbus register addresses and their meaning are described in xsns_83_neopool.ino at the beginning and within document 171-Modbus-registers.
Examples~
Get filtration mode~
NPFiltrationMode
RESULT = {"NPFiltrationmode":"Manual"}
Set filtration mode~
NPFiltrationMode 1
{"NPFiltrationmode":"Auto"}
Switch light relay on~
NPLight 1
RESULT = {"NPLight":"ON"}
Read Heating setpoint temperature MBF_PAR_HEATING_TEMP~
Backlog NPResult 0;NPRead 0x416
RESULT = {"NPResult":0}
RESULT = {"NPRead":{"Address":1046,"Data":28}}
Read system time MBF_PAR_TIME_* as 32-bit register using decimal output~
Backlog NPResult 0;NPReadL 0x408
RESULT = {"NPResult":0}
RESULT = {"NPReadL":{"Address":1032,"Data":1612124540}}
Enable temperature module by setting MBF_PAR_TEMPERATURE_ACTIVE and set it permanently into EEPROM~
Backlog NPWrite 0x40F,1;NPSave
RESULT = {"NPWrite":{"Address":"0x040F","Data":"0x0001"}}
RESULT = {"NPSave":"Done"}
Hide auxiliary relay display from main menu by setting bit 3 of MBF_PAR_UICFG_VISUAL_OPTIONS~
NPBit 0x605,3,1
RESULT = {"NPBit":{"Address":"0x0605","Data":"0x08C8"}}
Read Filtration interval 1-3 settings~
Backlog NPResult 0;NPRead 0x434;NPReadL 0x435,7;NPRead 0x443;NPReadL 0x444,7;NPRead 0x452;NPReadL 0x0453,7
RESULT = {"NPResult":0}
RESULT = {"NPRead":{"Address":1076,"Data":1}}
RESULT = {"NPReadL":{"Address":1077,"Data":[28800,0,86400,14400,0,1,0]}}
RESULT = {"NPRead":{"Address":1091,"Data":1}}
RESULT = {"NPReadL":{"Address":1092,"Data":[43200,0,86400,21600,0,1,0]}}
RESULT = {"NPRead":{"Address":1106,"Data":1}}
RESULT = {"NPReadL":{"Address":1107,"Data":[0,0,86400,0,0,1,0]}} *
Set filtration interval 1 to daily 9:00 - 12:30 (9:00: 3600 * 9 ≙ 32400 / 12:30 ≙ 3,5h = 12600)~
NPWriteL 0x435,32400 0 86400 12600
RESULT = {"NPWriteL":{"Address":1077,"Data":[32400,0,86400,12600]}}
Enhancements~
Using the command above we are now able to expand the WebGUI.
Add buttons for filtration and light control~
We are now add two dummy buttons to control the filtration pump and the light.
First we define two dummy relay (which does not have any physical function) on two unused GPIO (here we use GPIO0 and GPIO4 where we define Tasmota Relay 1 and 2):
Backlog GPIO0 224;GPIO4 225
Then we rename the buttons for better visibility:
Backlog WebButton1 Filtration;WebButton2 Light
Now we have the WebGUI buttons like this:

but missing the functionality behind. For that we use Rules and connect the states for Tasmota Power, Neopool filtration and light:
Rule1
ON Power1#State==0 DO NPFiltration %value% ENDON
ON Power1#State==1 DO NPFiltration %value% ENDON
ON NeoPool#Filtration#State==0 DO Power1 %value% ENDON
ON NeoPool#Filtration#State==1 DO Power1 %value% ENDON
ON Power2#State==0 DO NPLight %value% ENDON
ON Power2#State==1 DO NPLight %value% ENDON
ON NeoPool#Light==0 DO Power2 %value% ENDON
ON NeoPool#Light==1 DO Power2 %value% ENDON
Don't wonder about the double trigger definition, which at first glance seem nonsensical - they are necessary so that the rule does not trigger endless.
At least we activate the rule:
Backlog Rule1 5;Rule1 1
Here it is important to enable the Rule ONCE function, which prevents that the trigger are trigger themself in a loop.
You can now control filtration and light using the WebGUI and get the current status of the device elements when they are switched by auto-mode or manually on the device directly.

Additional advantage is that you can also use Tasmota Timer switching Power1 (=filtration) and Power2 (light) for your needs.
Daily sync device time to Tasmota time~
Since the NeoPool devices, without a WiFi module, have no way of synchronizing their internal clock with an external clock and, in addition, the accuracy of the internal clock leaves something to be desired, it makes sense to synchronize the clock with Tasmota once a day. Advantageously, we do this at night after a possible daylight saving time or normal time change.
Sync time is easy and we have two options for implementing it:
Option 1: Sync device using rules only~
Simply use the rule:
Rule2
ON Time#Minute=241 DO NPTime 0 ENDON
and activate it:
Backlog Rule2 4;Rule2 1
This syncronize the device time using Tasmota local time each night at 4:01 h.
Option 2: Sync device using Tasmota timer~
With this second option it is easier to setup the synchronization times using WebGUI and the Tasmota build-in timer.
Write a rule that synchronizes the time and that is triggered by the Tasmota built-in timer (here we use timer 10):
Rule2
ON Clock#Timer=10 DO NPTime 0 ENDON
and activate it:
Backlog Rule2 4;Rule2 1
Configure Tasmota Timer 10 for your needs (for example using same rule to sync time to Tasmota local time every day at 4:01 h).
