Cozify HAN & Shelly – Deeper Integration into Shelly Application, History and Alerts
#powercharge #mainsfuse #shelly #han #p1 #history #TopAC #EVcharger

With the winter approaching and power charges on the rise, many of us are eager to get notifications when the phase limit is exceeded or when a user-defined threshold is crossed due to power charges. This information can be received through email, app notifications, or alerts. It's also a good practice to automate the disconnection of unnecessary electrical devices, especially during phase overloads, to prevent the main fuse from blowing. Many people also have electric vehicle charging stations at home, and in Finland, the electric sauna is a common feature. The need to monitor desired consumption levels well before the phase limit is reached is becoming more prevalent with the increase in power charges.
TopAC Portable EV charger 11kW
This is another way to manage your Shelly-supported "TopAC Portable EV charger 11kW". You can automatically switch it off when the main fuses or a set power limit (determined by you) is exceeded. Likewise, the charging can be automatically resumed once there is sufficient bandwidth in the phases where the charger is connected.
Solution
There are multiple solutions to this problem, each with various methods of implementation. This guide will explain how Cozify HAN communicates directly with Shelly devices. Using the familiar Shelly application, you can automate processes and activate desired alerts and messages.
As an owner of a newer Shelly device, it's possible to receive messages (email, notification, or alert) and historical data on electricity consumption based on the data from the Cozify HAN device. There are numerous ways to implement this, and here is just one example. While you could create virtual components automatically using a script, following this example will provide an understanding of the outcome and help you learn to modify and maintain your own automations. This guide does not cover every necessary step, so a little understanding of the implementation will be beneficial.

With the combination of a Cozify HAN meter and a Shelly Gen3 device (or newer), you can easily implement phase-specific energy monitoring and alerts, as well as automation. This guide will briefly go through how to create a Cozify HAN component in a Shelly device and a script that retrieves data from the Cozify HAN meter. This setup allows for historical data, messages, and alerts, as well as communication with other Shelly devices to manage their power usage in overcurrent situations.
Required Devices and Preparations
- Shelly Gen3 or newer device with script support
- New electricity meter with an activated HAN port, and a Cozify HAN meter
- Shelly mobile or tablet application and the device's IP address
- Preferably a computer with a browser, as setting up the script is easier than on a phone
Creating Virtual Components in Shelly
- Log in to the Shelly device's web interface using its IP address (found in the Shelly app settings)
- Create the following virtual components:
Name: "Total Power"- View: "Label" - Unit: "W" - Type of Statistics: "Measurement"
Name: "Total Energy" - View: "Label" - Unit: "kWh" - View: "Label" - Unit: "kWh" - Type of Statistics: "Measurement"
Name: "Current L1" - View: "Label" - Unit: "A"-Type of Statistics: Measurement
Name: "Current L2" - View: "Label" - Unit: "A" -Type of Statistics: Measurement
Name: "Current L3" - View: "Label" - Unit: "A" -Type of Statistics: Measurement
Name: "Electricity Price" - View: "Label" -Unit: "c/kWh" - Name the components and set the correct units (W, kWh, A, c/kWh) and type oif Statistics
- You can use the HAN icon from http://www.cozify.fi/CozifyHAN.jpg for both the components and the group icon.
- Create a virtual group "Cozify HAN" and add all the above components to it.

Adding the Script to Shelly
- Navigate to the Shelly device's Scripts section (easiest with a computer browser using the Shelly device's IP address).
- Create a new script and copy the content of the Cozify_HAN_Virtual_Device_Script.txt file into it.
- Check the Cozify HAN device's address and component IDs (e.g., 200, 201, etc.).
- Save and start the script.
Alerts and Automation
In the Shelly app's "All Scenes" section, you can create automation that reacts, for example, to a situation where the current on any phase exceeds the set limit. The automation can send an email, phone notification, or other alert, and if necessary, cut off the power supply through different Shelly devices to prevent the main fuse from blowing.

Example Automation
- Alert when the current exceeds 24A on any phase
- Email notification
- Phone notification via Shelly Cloud
- Can automatically turn off power-hungry devices through the same or other Shelly devices to avoid blowing the main fuse
Summary
- Cozify HAN and Shelly together provide a way to monitor and automate phase-specific energy consumption, fully customizable to your needs. With virtual components and a script, you get real-time data, historical Cozify data, and an easy way to automate alerts and, in emergencies, shut down power-hungry devices. This example is just a small glimpse of what can be done; ultimately, only your imagination limits the possibilities.
- If you want to avoid using clout for managing turning of you devices when consumption reaches your limits you can use local "Actions" section on you "Virtual Devices" master device.
More about HAN integrations
- Cozify Home Assistant.PDF
- Cozify Home Assistant Info
- Cozify and Shelly
- Cozify HAN EN FW 0.1.20 Modbus TCP Register Map
Thank you for reading!
Share your experiences and feedback at info@cozify.fi

Jukka Talja
Cozify, Head of Sales