EgoSmartHeaterRS485 1.0.0
Library for controlling E.G.O. RS485 Smart Heaters.
Loading...
Searching...
No Matches
EgoSmartHeaterRS485 Class Reference

#include <EgoSmartHeaterRS485.h>

Public Member Functions

 EgoSmartHeaterRS485 (boolean manualDere=false)
 Constructor to setup the SmartHeater instance in automatic or manual DE/RE control.
 
 EgoSmartHeaterRS485 (int dere_pin)
 Constructor to setup the SmartHeater instance with enabled manual DE/RE control.
 
void begin (Stream &serial)
 Function to launch the SmartHeater communication using the default modbus ID.
 
void begin (Stream &serial, uint8_t slave)
 Function to launch the SmartHeater communication using the individual modbus ID.
 
uint8_t getErrCode (bool _clear=false)
 Function to retreive the latest error code, which occured during the device communication.
 
void clearErrCode ()
 Function to clear the error code store.
 
uint16_t getManufacturerId ()
 Retrieve ManufacturerID (0x2000)
 
uint16_t getProductId ()
 Retrieve ProductID (0x2001)
 
uint16_t getProductVersion ()
 Retrieve ProductVersion (0x2002)
 
uint16_t getFirmwareVersion ()
 Retrieve FirmwareVersion (0x2003)
 
String getVendorName ()
 Retrieve VendorName (0x2013)
 
String getProductName ()
 Retrieve ProductName (0x2023)
 
String getSerialNumber ()
 Retrieve SerialNumber (0x2033)
 
uint32_t getProductionDate ()
 Retrieve ProductionDate (0x2035)
 
RelaisConfigurationData_t getRelaisConfiguration (int r)
 Retrieve details for a particular relais (0x1000, 0x1020, 0x1040)
 
uint16_t getRelaisCount ()
 Retrieve RelaisCount (0x1204)
 
uint16_t getTemperatureMinValue ()
 Retrieve TemperatureMinValue (0x1209). Below this temperature the heater will warm the boiler even if no solar power is available. This can be used by the consumer to ensure a minimum water temperature in the boiler. 0 = Off, otherwise value has to be at least 10K below the actual setting of the Potentiometer.
 
uint8_t setTemperatureMinValue (uint16_t value)
 Configure TemperatureMinValue (0x1209). Below this temperature the heater will warm the boiler even if no solar power is available. This can be used by the consumer to ensure a minimum water temperature in the boiler. 0 = Off, otherwise value has to be at least 10K below the actual setting of the Potentiometer.
 
uint16_t getTemperatureMaxValue ()
 Retrieve TemperatureMaxValue (0x120A). The maximum specified allowed water temperature which will not exceeded by the smart heater even if the potentiometer is in the maximum position.
 
uint8_t setTemperatureMaxValue (uint16_t value)
 Configure TemperatureMaxValue (0x120A). The maximum specified allowed water temperature which will not exceeded by the smart heater even if the potentiometer is in the maximum position.
 
uint16_t getTemperatureNominalValue ()
 Retrieve TemperatureNominalValue (0x120B). This is the desired water temperature of the consumer. The special value zero means that the optional hardware potentiometer should be used by the regulator. The value of this potentiometer is available in register “UserTemperaturNominalValue”. The maximum value must not be higher than “UserTemperaturNominalValue”.
 
uint8_t setTemperatureNominalValue (uint16_t value)
 Configure TemperatureNominalValue (0x120B). This is the desired water temperature of the consumer. The special value zero means that the optional hardware potentiometer should be used by the regulator. The value of this potentiometer is available in register “UserTemperaturNominalValue”. The maximum value must not be higher than “UserTemperaturNominalValue”.
 
int16_t getPowerNominalValue ()
 Retrieve PowerNominalValue (0x1300). This is the desired power value which the heater should use to heat the boiler. The special value -1 means, that the heater should use the HomeTotalPower value and use as much power as possible. When writing this value the heater will match the desired value itself to the available relais and constraints (minimum switch on times etc.). Therefore this register is threat on a best-effort basis.
 
uint8_t setPowerNominalValue (int16_t value)
 Configure PowerNominalValue (0x1300). This is the desired power value which the heater should use to heat the boiler. The special value -1 means, that the heater should use the HomeTotalPower value and use as much power as possible. When writing this value the heater will match the desired value itself to the available relais and constraints (minimum switch on times etc.). Therefore this register is threat on a best-effort basis.
 
int32_t getHomeTotalPower ()
 Retrieve HomeTotalPower (0x1301). This register is written by the smart meter and contains the total power consumption/generation of the home/flat. When the value is negative then the home is feeding power back to the utilities, thus the heater should consume energy to heat up the boiler. When the value is positive then the home consumes energy from the utilities and the heater should stop heating.
 
uint8_t setHomeTotalPower (int32_t value)
 Retrieve HomeTotalPower (0x1301). This register is written by the smart meter and contains the total power consumption/generation of the home/flat. When the value is negative then the home is feeding power back to the utilities, thus the heater should consume energy to heat up the boiler. When the value is positive then the home consumes energy from the utilities and the heater should stop heating.
 
uint8_t setRelaisMinOnTime (int r, uint16_t value)
 Configure relais MinOnTime for a specific relais (0x1005, 0x1025, 0x1045). This field defines the minimum time the relais remains switched on.
 
uint8_t setRelaisMinOffTime (int r, uint16_t value)
 Configure relais MinOffTime for a specific relais (0x1006, 0x1026, 0x1046). This field defines the minimum time the relais remains switched off.
 
uint32_t getRestartCounter ()
 Retrieve RestartCounter (0x1202) This is mainly used during development.
 
int16_t getActualTemperaturePCB ()
 Retrieve ActualTemperaturPCB (0x1205) This is the actual temperature of the heater’s control PCB. If the PCB temperature exceed this max. value the heater switches off. 10K below this temperature the heater swichtes on.
 
uint32_t getTotalOperatingSeconds ()
 Retrieve TotalOperatingSeconds (0x1400).
 
uint32_t getErrorCounter ()
 Retrieve ErrorCounter (0x1402)
 
int16_t getActualTemperatureBoiler ()
 Retrieve ActualTemperaturBoiler (0x1404)
 
int16_t getActualTemperatureExternalSensor1 ()
 Retrieve ActualTemperaturExternalSensor1 (0x1405) This is the actual temperature of an (optional) first external temperature sensor. Special values: 0x8000 – no sensor can be attached to this heater model 0x8001 – no sensor attached 0x8002 – sensor present but malfunctioning.
 
int16_t getActualTemperatureExternalSensor2 ()
 Retrieve ActualTemperaturExternalSensor2 (0x1406) This is the actual temperature of an (optional) second external temperature sensor. Special values: 0x8000 – no sensor can be attached to this heater model 0x8001 – no sensor attached 0x8002 – sensor present but malfunctioning.
 
int16_t getUserTemperatureNominal ()
 Retrieve UserTemperaturNominalValue (0x1407) This value corresponds to the position of an (optional) potentiometer where the consumer can select a desired boiler temperature.
 
uint16_t getRelaisStatus ()
 Retrieve RelaisStatus (0x1408) This bitfield reflects the switching state of the heater’s internal relais: 0x0000: all relais are switched off 0x0001: only relais 1 is switched on 0x0002: only relais 2 is switched on 0x0004: only relais 3 is switched on 0x0005: relais 1 + 3 is switched on.
 
RelaisOperatingTime_t getRelaisOperatingTime ()
 Retrieve the operating times of all relais (0x1409, 0x140B, 0x140D)
 
ErrorData_t getError (int i)
 Retrieve error struct (0x1500 - 0x1526)
 

Public Attributes

boolean manualDere
 

Protected Member Functions

float getModbusFloat (uint16_t data[2])
 
uint32_t getModbusUint32 (uint16_t data[2])
 
int32_t getModbusInt32 (uint16_t data[2])
 
String getModbusString32 (uint16_t data[16])
 

Protected Attributes

ModbusMaster _node
 
uint8_t _result = _node.ku8MBSuccess
 

Static Protected Attributes

static const uint16_t RegisterManufacturerId = 0x2000
 
static const uint16_t RegisterProductId = 0x2001
 
static const uint16_t RegisterProductVersion = 0x2002
 
static const uint16_t RegisterFirmwareVersion = 0x2003
 
static const uint16_t RegisterVendorName = 0x2004
 
static const uint16_t RegisterProductName = 0x2014
 
static const uint16_t RegisterSerialNumber = 0x2024
 
static const uint16_t RegisterProductionDate = 0x2034
 
static constexpr uint16_t RegisterRelaisConfiguration [3] = {0x1000,0x1020,0x1040}
 
static const uint16_t RegisterRelaisCount = 0x1204
 
static const uint16_t RegisterTemperatureMinValue = 0x1209
 
static const uint16_t RegisterTemperatureMaxValue = 0x120A
 
static const uint16_t RegisterTemperatureNominalValue = 0x120B
 
static const uint16_t RegisterPowerNominalValue = 0x1300
 
static const uint16_t RegisterHomeTotalPower = 0x1301
 
static const uint16_t RegisterUserTemperatureNominal = 0x1407
 
static const uint16_t RegisterRestartCounter = 0x1202
 
static const uint16_t RegisterActualTemperaturePCB = 0x1205
 
static const uint16_t RegisterTotalOperatingSeconds = 0x1400
 
static const uint16_t RegisterErrorCounter = 0x1402
 
static const uint16_t RegisterActualTemperatureBoiler = 0x1404
 
static const uint16_t RegisterActualTemperaturExternalSensor1 = 0x1405
 
static const uint16_t RegisterActualTemperaturExternalSensor2 = 0x1406
 
static const uint16_t RegisterRelaisStatus = 0x1408
 
static constexpr uint16_t RegisterRelaisOperatingTime [3] = {0x1409,0x140B,0x140D}
 
static constexpr uint16_t RegisterErrorData [10] = {0x1500,0x1504,0x1508,0x150C,0x1510,0x1514,0x1518,0x151C,0x1520,0x1524}
 

Detailed Description

E.G.O. Smart Heater control Controls SmartHeater product code 29.65335.000 and RS-485 module for Arduino (MAX485) on multiple architectures

Constructor & Destructor Documentation

◆ EgoSmartHeaterRS485() [1/2]

EgoSmartHeaterRS485::EgoSmartHeaterRS485 ( boolean  manualDere = false)

Constructor to setup the SmartHeater instance in automatic or manual DE/RE control.

Parameters
manualDereis a boolean to enable or disable manual DE/RE control (default: false).

◆ EgoSmartHeaterRS485() [2/2]

EgoSmartHeaterRS485::EgoSmartHeaterRS485 ( int  dere_pin)

Constructor to setup the SmartHeater instance with enabled manual DE/RE control.

Parameters
dere_pinis number of the PIN which shall be used to control the DE/RE input of the MAX485 board.

Member Function Documentation

◆ begin() [1/2]

void EgoSmartHeaterRS485::begin ( Stream &  serial)

Function to launch the SmartHeater communication using the default modbus ID.

Parameters
serialis a reference to the instance of serial interface, to which the MAX485 is connected. Might be HW-or SW serial.

◆ begin() [2/2]

void EgoSmartHeaterRS485::begin ( Stream &  serial,
uint8_t  slave 
)

Function to launch the SmartHeater communication using the individual modbus ID.

Parameters
serialis a reference to the instance of serial interface, to which the MAX485 is connected. Might be HW-or SW serial.
slavespecifies the modbus address of the slave device to communicate with.

◆ getActualTemperatureBoiler()

int16_t EgoSmartHeaterRS485::getActualTemperatureBoiler ( )

Retrieve ActualTemperaturBoiler (0x1404)

Returns
Actual water temperature in the boiler in °C

◆ getActualTemperatureExternalSensor1()

int16_t EgoSmartHeaterRS485::getActualTemperatureExternalSensor1 ( )

Retrieve ActualTemperaturExternalSensor1 (0x1405) This is the actual temperature of an (optional) first external temperature sensor. Special values: 0x8000 – no sensor can be attached to this heater model 0x8001 – no sensor attached 0x8002 – sensor present but malfunctioning.

Returns
Temperature in °C

◆ getActualTemperatureExternalSensor2()

int16_t EgoSmartHeaterRS485::getActualTemperatureExternalSensor2 ( )

Retrieve ActualTemperaturExternalSensor2 (0x1406) This is the actual temperature of an (optional) second external temperature sensor. Special values: 0x8000 – no sensor can be attached to this heater model 0x8001 – no sensor attached 0x8002 – sensor present but malfunctioning.

Returns
Temperature in °C

◆ getActualTemperaturePCB()

int16_t EgoSmartHeaterRS485::getActualTemperaturePCB ( )

Retrieve ActualTemperaturPCB (0x1205) This is the actual temperature of the heater’s control PCB. If the PCB temperature exceed this max. value the heater switches off. 10K below this temperature the heater swichtes on.

Returns
Temperature in °C

◆ getErrCode()

uint8_t EgoSmartHeaterRS485::getErrCode ( bool  _clear = false)

Function to retreive the latest error code, which occured during the device communication.

Parameters
_clearindicates if the error code shall be cleared implicitly after reading (default: false).

◆ getError()

ErrorData_t EgoSmartHeaterRS485::getError ( int  i)

Retrieve error struct (0x1500 - 0x1526)

Parameters
iis the number of error message (0 - 9)
Returns
struct which contains OperatingHour, OperatingSecond and ErrorCode

◆ getErrorCounter()

uint32_t EgoSmartHeaterRS485::getErrorCounter ( )

Retrieve ErrorCounter (0x1402)

Returns
Number of errors

◆ getFirmwareVersion()

uint16_t EgoSmartHeaterRS485::getFirmwareVersion ( )

Retrieve FirmwareVersion (0x2003)

Returns
Firmware-Revision (e.g. 0x64 = 100 = 1.00)

◆ getHomeTotalPower()

int32_t EgoSmartHeaterRS485::getHomeTotalPower ( )

Retrieve HomeTotalPower (0x1301). This register is written by the smart meter and contains the total power consumption/generation of the home/flat. When the value is negative then the home is feeding power back to the utilities, thus the heater should consume energy to heat up the boiler. When the value is positive then the home consumes energy from the utilities and the heater should stop heating.

Returns
Power in Watts.

◆ getManufacturerId()

uint16_t EgoSmartHeaterRS485::getManufacturerId ( )

Retrieve ManufacturerID (0x2000)

Returns
For EGO SmartHeater always: 0x14ef

◆ getPowerNominalValue()

int16_t EgoSmartHeaterRS485::getPowerNominalValue ( )

Retrieve PowerNominalValue (0x1300). This is the desired power value which the heater should use to heat the boiler. The special value -1 means, that the heater should use the HomeTotalPower value and use as much power as possible. When writing this value the heater will match the desired value itself to the available relais and constraints (minimum switch on times etc.). Therefore this register is threat on a best-effort basis.

Returns
Power in Watts.

◆ getProductId()

uint16_t EgoSmartHeaterRS485::getProductId ( )

Retrieve ProductID (0x2001)

Returns
Indicates the E.G.O. product ID

◆ getProductionDate()

uint32_t EgoSmartHeaterRS485::getProductionDate ( )

Retrieve ProductionDate (0x2035)

Returns
Date of when device was assembled. This field is BCD-encoded and thus can be interpreted as a string with a fixed length. (Example: 0x20140515)

◆ getProductName()

String EgoSmartHeaterRS485::getProductName ( )

Retrieve ProductName (0x2023)

Returns
Device name as a string (Example: Smart Heater SM1000)

◆ getProductVersion()

uint16_t EgoSmartHeaterRS485::getProductVersion ( )

Retrieve ProductVersion (0x2002)

Returns
Indicates the E.G.O. variant ID

◆ getRelaisConfiguration()

RelaisConfigurationData_t EgoSmartHeaterRS485::getRelaisConfiguration ( int  r)

Retrieve details for a particular relais (0x1000, 0x1020, 0x1040)

Parameters
Numberof the relais to query (0: 500W, 1: 1000W, 2: 2000W)
Returns
Structure which contains ActualPower, OperatingSeconds, SwitchingCycles, MinOnTime, MinOffTime

◆ getRelaisCount()

uint16_t EgoSmartHeaterRS485::getRelaisCount ( )

Retrieve RelaisCount (0x1204)

Returns
Number of relais available in this product. Should be 3.

◆ getRelaisOperatingTime()

RelaisOperatingTime_t EgoSmartHeaterRS485::getRelaisOperatingTime ( )

Retrieve the operating times of all relais (0x1409, 0x140B, 0x140D)

Returns
Counter of operating seconds for the three relais.

◆ getRelaisStatus()

uint16_t EgoSmartHeaterRS485::getRelaisStatus ( )

Retrieve RelaisStatus (0x1408) This bitfield reflects the switching state of the heater’s internal relais: 0x0000: all relais are switched off 0x0001: only relais 1 is switched on 0x0002: only relais 2 is switched on 0x0004: only relais 3 is switched on 0x0005: relais 1 + 3 is switched on.

Returns
Relais Status

◆ getRestartCounter()

uint32_t EgoSmartHeaterRS485::getRestartCounter ( )

Retrieve RestartCounter (0x1202) This is mainly used during development.

Returns
Number of the restarts of the smart heater’s internal controller.

◆ getSerialNumber()

String EgoSmartHeaterRS485::getSerialNumber ( )

Retrieve SerialNumber (0x2033)

Returns
Serial number as a string (Example: 30380912332211)

◆ getTemperatureMaxValue()

uint16_t EgoSmartHeaterRS485::getTemperatureMaxValue ( )

Retrieve TemperatureMaxValue (0x120A). The maximum specified allowed water temperature which will not exceeded by the smart heater even if the potentiometer is in the maximum position.

Returns
Temperature in °C

◆ getTemperatureMinValue()

uint16_t EgoSmartHeaterRS485::getTemperatureMinValue ( )

Retrieve TemperatureMinValue (0x1209). Below this temperature the heater will warm the boiler even if no solar power is available. This can be used by the consumer to ensure a minimum water temperature in the boiler. 0 = Off, otherwise value has to be at least 10K below the actual setting of the Potentiometer.

Returns
Temperature in °C

◆ getTemperatureNominalValue()

uint16_t EgoSmartHeaterRS485::getTemperatureNominalValue ( )

Retrieve TemperatureNominalValue (0x120B). This is the desired water temperature of the consumer. The special value zero means that the optional hardware potentiometer should be used by the regulator. The value of this potentiometer is available in register “UserTemperaturNominalValue”. The maximum value must not be higher than “UserTemperaturNominalValue”.

Returns
Temperature in °C

◆ getTotalOperatingSeconds()

uint32_t EgoSmartHeaterRS485::getTotalOperatingSeconds ( )

Retrieve TotalOperatingSeconds (0x1400).

Returns
Total operating seconds of the smart heater.

◆ getUserTemperatureNominal()

int16_t EgoSmartHeaterRS485::getUserTemperatureNominal ( )

Retrieve UserTemperaturNominalValue (0x1407) This value corresponds to the position of an (optional) potentiometer where the consumer can select a desired boiler temperature.

Returns
Temperature in °C

◆ getVendorName()

String EgoSmartHeaterRS485::getVendorName ( )

Retrieve VendorName (0x2013)

Returns
Vendor name as a string (Example: E.G.O.)

◆ setHomeTotalPower()

uint8_t EgoSmartHeaterRS485::setHomeTotalPower ( int32_t  value)

Retrieve HomeTotalPower (0x1301). This register is written by the smart meter and contains the total power consumption/generation of the home/flat. When the value is negative then the home is feeding power back to the utilities, thus the heater should consume energy to heat up the boiler. When the value is positive then the home consumes energy from the utilities and the heater should stop heating.

Parameters
valueis the power in Watts
Returns
result code of the modbus write operation (see ModBus libary)

◆ setPowerNominalValue()

uint8_t EgoSmartHeaterRS485::setPowerNominalValue ( int16_t  value)

Configure PowerNominalValue (0x1300). This is the desired power value which the heater should use to heat the boiler. The special value -1 means, that the heater should use the HomeTotalPower value and use as much power as possible. When writing this value the heater will match the desired value itself to the available relais and constraints (minimum switch on times etc.). Therefore this register is threat on a best-effort basis.

Parameters
valueis the power in Watts
Returns
result code of the modbus write operation (see ModBus libary)

◆ setRelaisMinOffTime()

uint8_t EgoSmartHeaterRS485::setRelaisMinOffTime ( int  r,
uint16_t  value 
)

Configure relais MinOffTime for a specific relais (0x1006, 0x1026, 0x1046). This field defines the minimum time the relais remains switched off.

Parameters
Numberof the relais to query (0: 500W, 1: 1000W, 2: 2000W)
Minimumon-time in seconds.
Returns
result code of the modbus write operation (see ModBus libary)

◆ setRelaisMinOnTime()

uint8_t EgoSmartHeaterRS485::setRelaisMinOnTime ( int  r,
uint16_t  value 
)

Configure relais MinOnTime for a specific relais (0x1005, 0x1025, 0x1045). This field defines the minimum time the relais remains switched on.

Parameters
Numberof the relais to query (0: 500W, 1: 1000W, 2: 2000W)
Minimumon-time in seconds.
Returns
result code of the modbus write operation (see ModBus libary)

◆ setTemperatureMaxValue()

uint8_t EgoSmartHeaterRS485::setTemperatureMaxValue ( uint16_t  value)

Configure TemperatureMaxValue (0x120A). The maximum specified allowed water temperature which will not exceeded by the smart heater even if the potentiometer is in the maximum position.

Parameters
valueis the Temperature in °C to be applied
Returns
result code of the modbus write operation (see ModBus libary)

◆ setTemperatureMinValue()

uint8_t EgoSmartHeaterRS485::setTemperatureMinValue ( uint16_t  value)

Configure TemperatureMinValue (0x1209). Below this temperature the heater will warm the boiler even if no solar power is available. This can be used by the consumer to ensure a minimum water temperature in the boiler. 0 = Off, otherwise value has to be at least 10K below the actual setting of the Potentiometer.

Parameters
valueis the Temperature in °C to be applied
Returns
result code of the modbus write operation (see ModBus libary)

◆ setTemperatureNominalValue()

uint8_t EgoSmartHeaterRS485::setTemperatureNominalValue ( uint16_t  value)

Configure TemperatureNominalValue (0x120B). This is the desired water temperature of the consumer. The special value zero means that the optional hardware potentiometer should be used by the regulator. The value of this potentiometer is available in register “UserTemperaturNominalValue”. The maximum value must not be higher than “UserTemperaturNominalValue”.

Parameters
valueis the Temperature in °C to be applied
Returns
result code of the modbus write operation (see ModBus libary)

The documentation for this class was generated from the following files: