In addition to our letter, glue stick “strikk og binders” hack, we had to resort to another hack..
We had wanted to run our Python Flask app in Cloud, but turns out it’s not that easy to control an Arduino from Azure.. So we had to resort to running it locally, but exposing our endpoint through a third party called ngrok to get it to work:
This hack makes it possible to call a local API from the outside!
Greetings, wizarding developers and tech sorcerers! ✨
At Team PowerPotters, we take pride in our meticulous craftsmanship. From modular code design to robust CI/CD pipelines and seamless hardware integration, every aspect of our solution reflects a dedication to excellence. Today, we unveil the full spectrum of our development practices as we humbly submit our case for the ACDC Craftsman badge.
🪄 The Cornerstones of Craftsmanship
1. Modular Python Code for Seamless Integration
Our potion production system relies on a trio of well-structured Python scripts, each dedicated to a specific task:
sensor_script.py: Captures real-time data from ultrasonic sensors, seamlessly integrating with our IoT platform.
voice_script.py: Powers AI-driven voice recognition using the OpenAI Whisper API, enabling potion masters to command the system verbally.
integration_script.py: Acts as the conductor, tying sensor data and voice commands into cohesive workflows with Power Automate.
This modular structure ensures clarity, maintainability, and scalability, allowing individual components to be refined or extended independently.
Best Practices in Python Development:
Error Handling and Logging: Detailed try...except blocks ensure stability by gracefully handling errors, while comprehensive logging captures critical information for troubleshooting.
Mocking for Testability: Using a GPIO mock module, we simulate sensor behavior during testing, enabling rapid iteration without needing access to physical hardware.
🧙♂️ 2. Automating the Magic with GitHub Actions
To ensure our hardware remains ready for action, we created a GitHub Actions workflow that automates ESP32 firmware updates.
ESP32 Firmware Deployment Workflow:
Triggering the Workflow: Commits pushed to the main branch automatically initiate the firmware update process.
Code Checkout: The workflow uses the actions/checkout@v3 step to pull the latest code onto the runner.
Installing Dependencies: The esptool Python package is installed to enable communication with the ESP32.
Flashing the ESP32: The firmware is flashed using a shell command:
This process ensures fast, accurate, and automated firmware updates, reducing the risk of errors and saving time.
Why This Workflow Matters:
Automation: Eliminates manual steps, ensuring reliable and repeatable firmware updates.
Hardware Integration: Bridges the gap between software and IoT devices using a self-hosted runner for direct ESP32 access.
Scalability: Adaptable for multiple ESP32 units, making it a powerful tool for future growth.
✨ 3. CI/CD Pipelines: From Development to Deployment
Our CI/CD pipelines exemplify best practices in automation, ensuring smooth transitions from development to production:
Pre-Build Pipeline: A smart script starts the build box and waits for the service to become available before initiating the express build, which performs a simplified build without syncing.
Full Build Pipeline: If the express build succeeds, the full build pipeline is triggered. Success activates a webhook to:
Notify a Teams channel about the new release.
Trigger the upload of the package to the target environment.
Automatically deploy the package, ensuring rapid access to new features.
This pipeline streamlines the entire development lifecycle, ensuring efficiency and reliability at every step.
🧙♂️ 4. ALM Magic: Consistency in Customizations
Our Application Lifecycle Management (ALM) practices ensure clarity and structure across all customizations:
Naming Standards: We prefix all artifacts with Ad (Application Development) to maintain consistency. Examples:
AdCustGroup_Frm_Extension: Form extension for CustGroup.
AdCustGroup_Frm_dsCustGroup_fldGroupId_Extension: Field extension for CustGroup data source.
These conventions create an organized and easily navigable codebase, critical for large-scale projects.
🔮 Why We Deserve the ACDC Craftsman Badge
Our development practices embody the principles of the ACDC Craftsman badge:
Modular, Maintainable Code: Python scripts are well-structured and adhere to best practices, ensuring long-term scalability and clarity.
Automation Excellence: CI/CD pipelines and GitHub Actions workflows eliminate manual steps, streamline deployment, and reduce errors.
Consistency and Standards: Rigorous ALM practices, including naming conventions and structured customization, reflect our commitment to professionalism.
🐍 Crafting a Legacy of Excellence
From clean code to seamless deployment workflows, we’ve poured our hearts into creating a solution that reflects true craftsmanship. With every detail carefully considered, we humbly submit our case for the ACDC Craftsman badge.
We are using Copilot Studio to make an agent that can answer user questions about what potions they can make with the ingredients that they have collected in they beaded bag inventory.
We look to claim these badges with this blog post
Hogwarts Enchantment
Because we are truly making magic happen when the user can both get answers to what potions they can make and the AI agent can automatically add new potions to their inventory.
Plug N’ Play!! I mean, we are pluggi’n everything in everything in our solution, and this copilot agent will be plugged into every interface the young wizard turns to
We are leveraging the latest of the latest in AI cutting-edge technologies with autonomic Copilot Agent. Doesn’t get more hip than that!
We are claiming Feature Bombing because we are adding the copilot to all interfaces; Teams, Power Pages and Canvas app. The users are bombarded with this copilot feature wherever they turn. Sounds familiar? 😀
Using an autonomous agent to search both the internet (Harry Potter Wiki) and Dataverse tables and combining the results is using search in an interactive and innovative way
And last, but not least, in the vast world of potions and ingredients, this agent is not only smarter than a 5th grader – but even Hermione Granger herself!
Creating the Agent
The magical wizard who knows more about potions and spells and ingredients than Hermione Granger herself is actually a Copilot Agent.
Connecting the agent to Dataverse as a knowledge source
In the setup we choose the tables that we want to make available as sources for the agent to draw data from.
Allow the Potions Matcher to create potions
The agent will be able to create new potions in your inventory in the beaded bag based on the ingredients you have. To allow for this the agent is granted permissions to create new rows in the Potion Inventory table on the users behalf
Create custom prompts
We all know how hard it can be to understand what exactly an AI chat service can do, so we wanted to add predefined custom prompts to our agent chat experience, to give the users a better user experience.
We created a set of custom prompts that we added to the bot.
Testing the bot in the studio is one thing, but secretly, Dumbledore also adds it to to Teams
Testing the agent with a chat experience in Teams
Adding it to the Power Pages site and using it, logged in as Dumbledore to create new items in inventory
and this is a video of what the copilot agent looks like in a Canvas App on the phone
Does the code contain lines with low ambition? No worries, we’ll catch those nasty lines in a PR from a feature-branch into the main-branch, with a proper peer review process.
Commits on the main-branch will trigger a GitHub Actions workflow, using GitHub Secrets to retrieve tokens used in the build-process; and automagically deploying the finished build to our Azure Static Web App.
Approval processes are common for every organization across the globe, including wizarding schools. They arguably hold a more important place then ever with the rise of artificial intelligence, as a “human in the loop” approach can avoid some of the shortcomings with the technology, such as hallucinations. For our solution OwlExpress, we have two primary requirements in this area:
The release manager must receive a notifications in Microsoft Teams to approve all releases into our downstream environments.
If a prospective student is suspected to have characteristics that could make them a future Death Eater, then we again need to bring this to the attention of several teachers in Microsoft Teams to review and record the outcome.
For the first requirements, we can tap into our Power Platform Pipelines host environment which is fully configured to support automated ALM for our solution:
There is no support for native approval creation as part of Power Platform Pipelines, so we must instead create a cloud flow to orchestrate this:
For the second requirement, we’ve blogged already on how this solution works. So for the purposes of this blog here, we can just focus on the “good stuff” – the end result approval received in Microsoft Teams:
By having the approvals appear in Microsoft Teams, we can not only solve several business requirements, but also show the benefit of the unified platform.
The existential risk is real! As Slytherins there is nothing we would love more than a bit of chaos. So of course we take all risks and use AI!
We use Azure service APIs for both prompting and text-too-speech combined with pro-code run in our Python Flask app:
The chat completion prompt goes as follow:
You are an assistant that helps transform a text to a specific tone of voice. It is supposed to be a letter read out loud. Start with greeting the recipient and end with goodbye from the sender. If appropriate, add references to the Harry Potter universe. Keep it short.
This prompts adds a dazzle of Hogwarts magic to each message;
Original message: I don’t like you anymore. You have proven to be untrustful!
Magically transformed message: Oh, how the tides have turned! I find myself in a whirlwind of emotions, and I must confess, I don’t like you anymore. Your betrayal stings like a Cruciatus curse, and it’s clear you’ve proven to be utterly untrustworthy!
After obtaining the magically bedazzled message, we run text-to-speech from Speech Services to magically transform the written message to speech in your preferred tone:
Having consistent branding is important to give the users a good experience when navigating between different user interfaces. It makes a cohesive look and feel across apps, websites, reports, etc.
Define brand identity
The focus point for our solution is Hermione’s Beaded Bag, so we wanted to use soft purple
Font
One of the most identifying things about a brand is the font. We have found a free font that we want to use with most user-facing interfaces.
We used Microsoft 365 Copilot Visual creator to help get our creativity going. It helped us find a color scheme that was exactly what we were looking for to get a soft magical feeling.
From this we created a color scheme fit for apps and websites.
In Hogwarts school of witchcraft and wizardry, everything is about getting points. And who wouldn’t a pet that could give (or take away) points?
So, by using our datadriven Power app, we made this an option and made sure it would sync between Dataverse, Fabric and display them in the mirror by retriving the data using javascript.
In this blog post, we’ll show you how we integrated the Resco Tree View PCF (PowerApps Component Framework) component into a Dynamics 365 environment to make enhancements to our Sorting Hat quiz.
Before diving in, let’s quickly break down what PCF (PowerApps Component Framework) is. PCF is a powerful framework that allows you to create custom components for use in Dynamics 365 and PowerApps applications. These components are highly interactive and are commonly used to enhance the UI and user experience.
Resco’s Tree View PCF component is one such component. It’s primarily used for displaying hierarchical data in a tree-like structure, but with some creativity, you can repurpose it to display quiz questions, choices, and results in a fun and engaging way.
We used this component to create data hierarchy in CRM where each record represents a node.
The piece of code that is implemented and allows us to have a parent-child hierarchy:
The worst part of being a teacher? Having to spend time dragging lazy, unmotivated student through a course they show no interest in – just to tick off that KPI of 90% pass rate. ✅
Leave that to the magic cards! Sent out by owls a power automate flow, students at risk of failing a subject will automatically get notified directly in teams, two weeks before the semester ends.
A neat little reminder and the possibility to pass the subject by showing your magic in a quick quiz!