This brief guide explains the changes made to the CTA-2045 source code in order to enable the AdvancedLoadUp command (ALU) functionality. ALU allows water heaters to store extra energy beyond their normal operation when useful to grid operation (Refer to CTA-2045-B documentation)
- CTA-2045-B-enabled Water Heater (any other storage device mentioned in the CTA-2045-B document)
- Follow the safety precautions highlighted within the CTA-2045-B documentation
- ALU increases the setpoint temperature, so care must be taken!
To implement the ALU functionality, do the following steps:
- Clone this repository.
- Checkout the ALU branch.
- Go to
/dcs/sample2/sample2/and open themain.cppfile. - Ensure the correct serial port is specificed in line 116.
- Go to
/dcs/, typemkdir -p build/debug. - Go to the newly created debug folder:
cd build/debug/ - In your terminal, type
cmake -DCMAKE_BUILD_TYPE=Debug -DSAMPLE=1 -DTEST=1 ../../ - Type
make.
The Advanced Load Up functionality is not created or set at all in the source code, so we need to set it up from scratch.
-
Create Message Classes in this directory
cea2045/device/message/:-
Create the following two files:
- SetAdvancedLoadUp.h
- SetAdvancedLoadUp.cpp
-
-
Update the Device Interface:
- Update the
CEA2045DeviceUCM.hfile incea2045/devicedirectory as shown in this repository.
- Update the
-
Implement the message handler:
- Update the
processIntermediateMessage()function within thecea2045/processmessage/ProcessMessageUCM.cppfile as shown in this repository.
- Update the
Implement the case letter for your advanced load up command as you see fit. In our case, we decided to implement the advanced load up with a switching case as follows:
case 'a':
{
unsigned short duration = 60; // 60 minutes
unsigned short value = 5; // 0.5 kWh when units = 100Wh
unsigned char units = 0x02; // 100Wh units
device->intermediateSetAdvancedLoadUp(duration, value, units).get();
}-
The
DeviceInforeturns, among other parameters, a BitMap capability, which shows if theAdvancedLoadUpcommand is supported or not. -
Check the responses:
- look for success code (0x00).
- Verify operational state changes to 3 or 6.
We encountered many issues as we were implementing the advanced load up functionality. For instance:
-
Wrong Message length:
- Check message structure matches the CTA-2045 documentation.
-
Response Not Processing:
- Verify opCode1 and opCode2 matching the CTA-2045 documentation.
- Implement debug messages in the ProcessIntermediateMessage files.
-
State Not Changing:
- Verify device support advanced load up command (bit 6 in the BitMapCapbility)
- Always check the CTA-2045 documentation, refer to page 74 to ensure appropriate responses from the device.
- We wrote a progress report that shows our progress as we went through this implementation.
- Feel free to communicate with us if you encounter any issues.