Last month I was honored to participate in the bi-annual SAP BTP Hackathon, a fierce and friendly 3-day competition during which teams from different organizations build a working prototype of an application using SAP BTP services. The Solace team was thrilled to partner with Hydro-Québec and collaborate with BlueBoot and SAP. Together, we tackled an exciting use case, dived into the architecture, and created a working prototype. In this article I will explain the use case and how we achieved the desired outcome using various BTP services and SAP Integration Suite, advanced event mesh.

The Challenge

Hydro-Québec is responsible for supplying power to all residents of Quebec (a province in Canada). Hydro-Québec’s mission is to provide clean and renewable energy which is low in greenhouse gas emission. All the energy is generated within the province and less than 1% of the electricity consumed in Québec comes from other out-of-province sources.

Problem Statement

Due to its location, Quebec gets very cold during winter — the temperature can get as low as -25 or -30° celsius, which is around -22°F. This is the time when the energy consumption is the most since everyone uses more power to keep their homes warm.

Figure 2 - Citizen's view on a winter day

Figure 2 – Citizen’s view on a winter day

At Hydro-Québec’s head office, the main concern is how to keep with the increased capacity demand.

Solution

Hydro-Québec’s SAP development team came up with an idea to keep energy consumption low during the winter months using SAP BTP technologies. The idea is to challenge the citizen to change the thermostat temperature to a lower value which would lead to lower energy consumption by:

  1. Monitoring the outside temperature and energy consumption every hour.
  2. If the consumption reading reaches a certain value, challenging the citizen (through the mobile app) to lower their thermostat a couple degrees, which they would hardly notice.
  3. If the client accepts the challenge, offering them a discount so they save some money.

Meanwhile, back at the head office, an admin portal lets Hydro-Québec managers see how much energy is saved through the program, how many people have accepted or rejected the challenge, etc.

Figure 4 - HQ Sustainability Initiative

Figure 4 – HQ Sustainability Initiative

 

Architecture

After the initial discussion, whiteboarding, and a lot of back and forth we came up with the architecture. This architecture involved some microservices best practices such as decoupled/loosely coupled services, agility, event-driven, extensibility, and individual scalability. The final architecture used the following services from the BTP cockpit:

  • SAP HANA Cloud
  • Advanced Event Mesh
  • Integration Suite
    • Cloud Integration
    • API management
  • SAP BUILD
    • Process Automation including Business Rules
    • AppGyver
    • WorkZone
  • Cloud Foundry Runtime
  • Business Application Studio
    • CAP
    • js
Figure 5 - Highlevel Architecture Using BTP Services

Figure 5 – High-level Architecture Using BTP Services

 

Here are brief descriptions of each of the components used:

  • SAP Workzone And UI Integration Cards: SAP Workzone enables organizations to easily build business sites that provide centralized access to business application information on any device. It also provides pre-built templates, user interface cards, and content widgets to help in easily building and managing sites visually. In this use case, SAP Build Workzone is used to create the Temperature simulator and the admin portal for the admin to login and have a single view of how much KWH is being saved by this challenge. The cards in the workzone interact with AEM (SAP Integration Suite, Advanced Event Mesh) to publish the temperature data and subscribe to challenge accepted/rejected and total savings which are published by downstream applications.
  • SAP Integration Suite, Advanced Event Mesh: AEM is an event streaming, event management, and monitoring platform that makes software event brokers available as a service. With AEM you can create event broker services in minutes, build a model of your event mesh to design and help implement it, and monitor your services and event mesh to ensure everything runs smoothly. In the current architecture, AEM provides the messaging and integration layer which glues different services together in a decoupled manner. This layer helps in providing decoupling between the components and enabling EDA. AEM provides various benefits in the overall architecture:
      • Decoupled/loosely coupled applications and services
      • Support for multiple messaging patterns, e.g. one to one, one to many, many to one
      • Support for popular APIs and open protocols, such as REST, AMQP, MQTT, WebSocket, etc.
      • Dynamic message routing

    As shown in the high-level design, various BTP components interact with AEM by publishing and subscribing to the data that is needed.

  • SAP Integration Suite, Cloud Integration: SAP Cloud Integration Connect lets you automate business processes with pre-built integrations, APIs, connectors, and best practices. It provides a graphical modeling environment that lets you design the details of message processing; both senders and receivers as well as the individual processing steps. Here, SAP Integration Flow (iFlow) interacts with AEM and the SAP HANA Cloud DB through SAP CAP application. The iFlow does the business logic and is in charge of updating the consumptions, savings, and challenge created/accepted/rejected status in the SAP HANA DB.
  • SAP Build Process Automation: SAP Process Automation is invoked by iFlow and decides whether a challenge needs to be created for a client. If there is new challenge to be issued to the client, it is published to AEM which is then in turn subscribed by Admin console and the iFlow for updating the DB.
  • SAP AppGyver (or SAP Build Apps): SAP Build Apps is a professional application development solution designed for anyone to quickly create apps without code regardless of role or skill level. SAP Build Apps is used to create the mobile App that the client can download. AppGyver polls the SAP Hana cloud for any new challenge. If there is a new challenge for the client, a notification on the app allows the client to accept or reject the challenge. This app also tells the client how much money the client has saved by accepting the challenge
  • SAP HANA Cloud: SAP HANA Cloud is a modern database as a service (DBaaS) powering intelligent data applications and analytics across all enterprise data. SAP HANA Cloud DB service is used to persist the data about the client, temperature, challenges, etc., so it can be used later for analytics and next-gen intelligent data applications.

Demo In Action

Here is what the mobile app looks like, specifically showing energy consumption details, the presentation of challenge to the client, and a display of how much they saved.

Mobile App View

Figure 6 – Energy Consumption Details Figure; 7 – Challenge Presented to Client; Figure 8 – Amount Saved by Client

Admin View

Figure 10 - Administrative View

Figure 10 – Administrative View

 

Wrapping Up

The SAP BTP Hackathon 2023 was a huge success. We all came out learning something new as well as fostering friendships that we will cherish forever. The working prototype was demoed to the entire SAP BTP, and HyrdoQuebec team. Please contact Solace if you have any comments or questions about this use case and the Advanced Event Mesh service of SAP BTP, or if you would like to see the hackathon demo in action.

The Team

Hydro Quebec

      • Vincent Desrochers
      • Mairana Chacin
      • Alexandre Doré
      • Wilson Hernando Reyes Torres
      • Youlian Dimitrov

Blueboot

      • Francisco Cosco

SAP

      • John Clavijo

Solace

      • Scott Dillon
      • Brad Caldwell
      • Neha Sinha

 

Neha Sinha
Neha Sinha

Neha is a sales engineer and solutions architect with Solace. An expert in middleware products and well-versed in APIs, integration, and the event-driven approach, Neha helps customers achieve their digital transformation goals.