Skip to content

Instantly share code, notes, and snippets.

@zubir2k
Created July 17, 2023 07:30
Show Gist options
  • Save zubir2k/ca47a9256578f8ec69a1f9dbf5a10683 to your computer and use it in GitHub Desktop.
Save zubir2k/ca47a9256578f8ec69a1f9dbf5a10683 to your computer and use it in GitHub Desktop.
Minecraft Server Alert
# This is a simple automation that will provide alert (sample given via Telegram) upon player joining or leaving.
# Prerequisite: Minecraft Server & Minecraft Server Integration (https://www.home-assistant.io/integrations/minecraft_server)
# Sensor used: sensor.minecraft_server_players_online, sensor.minecraft_server_players_max and sensor.minecraft_server_map
# Installation: Add new automation, edit in YAML and paste below.
alias: 🏡 Minecraft Alert 2.0
description: Minecraft Join/Leave world
trigger:
- platform: state
entity_id: sensor.minecraft_server_players_online
condition: []
action:
- service: notify.notify_telegram
data:
message: >-
Someone {%if trigger.to_state.state > trigger.from_state.state
%}enters{%elif trigger.to_state.state < trigger.from_state.state
%}left{% endif %} your realm at {{ now().strftime('%I:%M%p') }}. {{
states('sensor.minecraft_server_players_online') }}/{{
states('sensor.minecraft_server_players_max') }} player(s).
title: 🏡 Minecraft - {{ states('sensor.minecraft_server_map') }}
mode: single

Minecraft Server Alert

This is a simple automation that will provide alert (sample given via Telegram) upon player joining or leaving. image

[Prerequisite] Minecraft Server & Minecraft Server Integration (https://www.home-assistant.io/integrations/minecraft_server)

[Sensor used] sensor.minecraft_server_players_online, sensor.minecraft_server_players_max and sensor.minecraft_server_map

[Installation] Add new automation, edit in the YAML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment