Objective
Right now, it’s cata, cyberattacks and data exfiltration are almost daily, I need to be reassured about leaks of my email addresses.
So I created this HA card:

Principle
There are several sites that are able to test if my email address is compromised or not.
The compromise of an email address occurs when the information associated with that address (such as password, contacts, or personal data) is exposed to unauthorised third parties, usually as a result of a data breach. This can happen when databases of online services are hacked, and user information is stolen and then leaked or sold on forums or darknet sites. A compromised email address can be used to send spam, phishing attacks, or access other accounts linked to that address, endangering the security and privacy of the user.
The best-known site of all is:
But this site no longer provides APIs without a subscription, I looked for another solution and found the site:
This site offers a paid APIV2 but has left its APIV1 online, it is lighter but it is enough for me to know if my email is compromised and if it is compromised, how many leaks there are. This API also does not need an authentication token, so it is much simpler.
Here is the link to the API doc:
I create REST queries in sensors.yaml
I have very classically organised my configuration files into YAML files which are called by configuration.yaml.
sensor: !include rest.yaml
The call I am going to make is in the following format:
https://leakcheck.io/api/[email protected]
The result is in json format, for example:
{ "successful": true, "found": 7, "fields": [ "last _name", "country", "first _name", "username", "dob", "password", "city" ], "sources": [ { "name": "Deezer.com", "date": "2019-09" }, { "name": "Badoo.com", "date": "2013-07" } ] }
- found gives the number of compromises or rather the number of pirated databases that contain the email.
- fields is useless at this stage
- sources gives the names and databases of the compromises, but in the free version we obviously do not have completeness.
Here is the code I add for an example email:
- resource: "https://leakcheck.io/api/[email protected]" scan_interval: 86400 sensor: - name: "[email protected]" unique _id: _demo46 _mail _com value _template: "{{value _json.success }}" json _attributes: - found - sources
I rename the created sensor
I have to restart HA or at least reload the Yaml config, and the sensor arrives.

I am always surprised that the only _id is not taken into account, nothing serious, I correct it manually. I use sensor.fuite* because it is a self-entities card that I will then use.

I'll create the map
The code is quite complex, I started from the code of the excellent herveaurel for its batteries.
Here is what I added in the configuration editor to configure type: custom:button-card and template: leak _card
_card _templates button: leak_card: variables: entity: '[[[ return entity.entity _id ]]]' entity: '[[[ return variables.entity ]]]' icon: | [[ return entity.state === "True"? "mdi:car-brake-alert": "mdi:shield-lock-outline" ]]] name: '[[[ return entity.attributes.friendly_name ]]]' label: | [[ return entity.state === "True"? Compromise<br>${entity.attributes.found} leaks“: "Protected" ]]] show_icon: true show_state: false show_label: true template: - no_style - font tap_action: action: more-info double_tap_action: action: toggle custom _fields: bar: card: type: custom:bar-card entities: - entity: '[[[ return variables.entity ]]]' color: | [[ var state = entity.state; if (state === "True") { return "var(--card-red)"; } else { return "var(--card-green)"; } ]]] Directorate: right positions: name: 'off' indicator: 'off' value: 'off' height: 50px width: 100% icon: 'off' entity _row: true styles: card: - height: 40px - padding: 2px - animation: blink 0.8s ease infinite icon: - position: absolute - width: 25px - color: var(--orange) - left: calc(7%) - 5px) - margin-bottom: 2px name: - position: absolute - font-size: 13px - color: var(--orange) - font-weight: 500 - left: calc((20%) - 15px) label: - position: absolute - font-size: 13px - color: | [[ var state = entity.state; if (state === "True") return "var(--red)" else return "var(--green)" ]]] - font-weight: 600 - width: 100% - text-align: center - left: calc((10%) + 70px) custom_fields: bar: - top: '-19%' - left: '-50%' - width: 100% - position: absolute - z-index: 0 state: -value: 'False' styles: icon: - color: var(--green) name: - color: var(--green) card: - animation: none - value: unknown styles: name: - color: var(--grey) label: - color: var(--grey) card: - animation: blink 0.8s ease infinite - value: unavailable styles: name: - color: var(--grey) label: - color: var(--grey) card: - animation: blink 0.8s ease infinite
And here is the code of the card:
type: entities card_mod: style: | ha-card { background-color: var(--card-background-color); border-radius: var(--ha-card-border-radius)!important; } entities: - type: custom:decluttering-card template: header variables: - name: E-mail leaks - icon: mdi:home-battery - type: custom:auto-entities card: type: entities show _header _toggle: true filter: include: - entity_id: sensor.leak* options: type: custom:button-card template: leak_card comes out: method: state numeric: true ignores _case: false ip: false show_empty: true
And the finished card appears

