BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes
BeeeOn::VPTDevice Class Reference

The class represents Thermona Regulator VPT LAN v1.0. It provides functions to control the VPT and to gather data from its sensors. Each VPT regulator consists of up to 4 zones and 1 boiler. This means one instance of VPTDevice takes care of 5 devices. Each subdevice has own DeviceID. More...

#include <VPTDevice.h>

Inheritance diagram for BeeeOn::VPTDevice:
BeeeOn::PollableDevice BeeeOn::Loggable

Public Types

enum  Action { PAIR = 0x01, READ, SET }
 
typedef Poco::SharedPtr
< VPTDevice
Ptr
 
- Public Types inherited from BeeeOn::PollableDevice
typedef Poco::SharedPtr
< PollableDevice
Ptr
 

Public Member Functions

 VPTDevice (const Poco::Net::SocketAddress &address, const Poco::Timespan &httpTimeout, const Poco::Timespan &pingTimeout, const GatewayID &id, const RefreshTime &refresh, const DeviceCache::Ptr deviceCache)
 Connects to specified address to fetch information for creating VPT Device. If the device do not respond in specified timeout, Poco::TimeoutException is thrown. More...
 
DeviceID id () const override
 
RefreshTime refresh () const override
 Regular period telling how often to call the method PollableDevice::poll(). The refresh must contain a valid time.
 
DeviceID boilerID () const
 
Poco::Net::SocketAddress address () const
 
void setAddress (const Poco::Net::SocketAddress &address)
 
void setPassword (const std::string &pwd)
 
Poco::FastMutex & lock ()
 
void poll (Distributor::Ptr distributor) override
 Perform polling for data and ship them via the given distributor.
 
std::string generateStamp (const Action action)
 Creates a stamp that consists of gateway id, IP address of gateway's interface from whitch the VPT is available, time, and action.
 
void stampVPT (const Action action)
 Sends stamp with aciton to the VPT. It serves to verify that the gateway communicates with the VPT.
 
void requestModifyState (const DeviceID &id, const ModuleID module, const double value)
 
std::vector< SensorDatarequestValues ()
 Gathers data from all sensors of subdevices. More...
 
std::vector< DeviceDescriptiondescriptions (const RefreshTime &refresh) const
 Returns list of new device commands of all subdevices.
 
bool operator== (const VPTDevice &other) const
 Compares two VPTs based on DeviceID.
 

Static Public Member Functions

static DeviceID createSubdeviceID (const int zone, const DeviceID &id)
 Creates DeviceID from VPT DeviceID and number of zone.
 
static DeviceID omitSubdeviceFromDeviceID (const DeviceID &id)
 Returns DeviceID of real VPT.
 
static int extractSubdeviceFromDeviceID (const DeviceID &id)
 Extracts subdevice number from DeviceID.
 
static std::string extractNonce (const std::string &response)
 
static std::string generateHashPassword (const std::string &pwd, const std::string &response)
 

Static Public Attributes

static const std::vector
< std::string > 
REG_BOILER_OPER_TYPE
 
static const std::vector
< std::string > 
REG_BOILER_OPER_MODE
 
static const std::vector
< std::string > 
REG_MAN_ROOM_TEMP
 
static const std::vector
< std::string > 
REG_MAN_WATER_TEMP
 
static const std::vector
< std::string > 
REG_MAN_TUV_TEMP
 
static const std::vector
< std::string > 
REG_MOD_WATER_TEMP
 
static const std::list
< ModuleType
ZONE_MODULE_TYPES
 
static const std::list
< ModuleType
BOILER_MODULE_TYPES
 
static const int COUNT_OF_ZONES = 4
 

Additional Inherited Members

- Protected Member Functions inherited from BeeeOn::Loggable
void setupLogger (Poco::Logger *logger=0) const
 
Poco::Logger & logger () const
 
 Loggable (const ClassInfo &info)
 
 Loggable (const std::type_info &info)
 
- Static Protected Member Functions inherited from BeeeOn::Loggable
static Poco::Logger & forMethod (const char *name)
 
static Poco::Logger & forClass (const ClassInfo &info)
 
static Poco::Logger & forClass (const std::type_info &info)
 
template<typename T >
static Poco::Logger & forInstance (const T *i)
 
static void configureSimple (Poco::Logger &logger, const std::string &level)
 
static void logException (Poco::Logger &logger, const Poco::Message::Priority priority, const Poco::Exception &e, const char *file, size_t line)
 

Detailed Description

The class represents Thermona Regulator VPT LAN v1.0. It provides functions to control the VPT and to gather data from its sensors. Each VPT regulator consists of up to 4 zones and 1 boiler. This means one instance of VPTDevice takes care of 5 devices. Each subdevice has own DeviceID.

Constructor & Destructor Documentation

VPTDevice::VPTDevice ( const Poco::Net::SocketAddress &  address,
const Poco::Timespan &  httpTimeout,
const Poco::Timespan &  pingTimeout,
const GatewayID id,
const RefreshTime refresh,
const DeviceCache::Ptr  deviceCache 
)

Connects to specified address to fetch information for creating VPT Device. If the device do not respond in specified timeout, Poco::TimeoutException is thrown.

Parameters
&addressIP address and port where the device is listening.
httpTimeoutHTTP timeout.
pingTimeoutping timeout used to obtain the IP address of gateway's interface from which the VPT is available.
idGateway id used in generating of stamp.

Member Function Documentation

DeviceID VPTDevice::id ( ) const
overridevirtual
Returns
ID of the device.

Implements BeeeOn::PollableDevice.

void VPTDevice::requestModifyState ( const DeviceID id,
const ModuleID  module,
const double  value 
)
Parameters
idSubdevice of VPT.
moduleModule of subdevice.
valueRequested value. the success of the request
vector< SensorData > VPTDevice::requestValues ( )

Gathers data from all sensors of subdevices.

Returns
List of SensorData.

Field Documentation

const std::list< ModuleType > VPTDevice::BOILER_MODULE_TYPES
static
Initial value:
= {
ModuleType(ModuleType::Type::TYPE_ENUM,
VPTBoilerModuleType(VPTBoilerModuleType::MOD_BOILER_STATUS).toString()),
ModuleType(ModuleType::Type::TYPE_ENUM,
VPTBoilerModuleType(VPTBoilerModuleType::MOD_BOILER_MODE).toString()),
ModuleType(ModuleType::Type::TYPE_TEMPERATURE),
ModuleType(ModuleType::Type::TYPE_TEMPERATURE, {ModuleType::Attribute::ATTR_OUTER}),
ModuleType(ModuleType::Type::TYPE_TEMPERATURE, {ModuleType::Attribute::ATTR_OUTER}),
ModuleType(ModuleType::Type::TYPE_PERFORMANCE),
ModuleType(ModuleType::Type::TYPE_PRESSURE),
ModuleType(ModuleType::Type::TYPE_BITMAP,
VPTBoilerModuleType(VPTBoilerModuleType::MOD_CURRENT_BOILER_OT_FAULT_FLAGS).toString()),
ModuleType(ModuleType::Type::TYPE_BITMAP,
VPTBoilerModuleType(VPTBoilerModuleType::MOD_CURRENT_BOILER_OT_OEM_FAULTS).toString()),
}
const vector< string > VPTDevice::REG_BOILER_OPER_MODE
static
Initial value:
=
{"PE044","PE045","PE046","PE047"}
const vector< string > VPTDevice::REG_BOILER_OPER_TYPE
static
Initial value:
=
{"PE040","PE041","PE042","PE043"}
const vector< string > VPTDevice::REG_MAN_ROOM_TEMP
static
Initial value:
=
{"PE086","PE087","PE088","PE089"}
const vector< string > VPTDevice::REG_MAN_TUV_TEMP
static
Initial value:
=
{"PE098","PE099","PE100","PE101"}
const vector< string > VPTDevice::REG_MAN_WATER_TEMP
static
Initial value:
=
{"PE094","PE095","PE096","PE097"}
const vector< string > VPTDevice::REG_MOD_WATER_TEMP
static
Initial value:
=
{"PE075","PE076","PE077","PE078"}
const std::list< ModuleType > VPTDevice::ZONE_MODULE_TYPES
static
Initial value:
= {
ModuleType(ModuleType::Type::TYPE_ENUM,
VPTZoneModuleType(VPTZoneModuleType::MOD_BOILER_OPERATION_TYPE).toString(),
{ModuleType::Attribute::ATTR_CONTROLLABLE}),
ModuleType(ModuleType::Type::TYPE_ENUM,
VPTZoneModuleType(VPTZoneModuleType::MOD_BOILER_OPERATION_MODE).toString(),
{ModuleType::Attribute::ATTR_CONTROLLABLE}),
ModuleType(ModuleType::Type::TYPE_TEMPERATURE, {ModuleType::Attribute::ATTR_INNER}),
ModuleType(ModuleType::Type::TYPE_TEMPERATURE, {ModuleType::Attribute::ATTR_INNER}),
ModuleType(ModuleType::Type::TYPE_TEMPERATURE, {ModuleType::Attribute::ATTR_CONTROLLABLE}),
ModuleType(ModuleType::Type::TYPE_TEMPERATURE),
ModuleType(ModuleType::Type::TYPE_TEMPERATURE,
{ModuleType::Attribute::ATTR_INNER, ModuleType::Attribute::ATTR_CONTROLLABLE}),
ModuleType(ModuleType::Type::TYPE_TEMPERATURE, {ModuleType::Attribute::ATTR_CONTROLLABLE}),
}

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