Skip to content

Instantly share code, notes, and snippets.

View zubir2k's full-sized avatar
🏠
Working from Home

Zubir Jamal zubir2k

🏠
Working from Home
View GitHub Profile
@zubir2k
zubir2k / batterymonitoring.md
Last active February 2, 2024 03:46
Battery Monitoring - Mobile/Tablets based on HA Companion App

Battery Monitoring

What is this? A simple jinja template that will show battery level for mobile devices only.

There are 2 options:

  1. Alert first, then list of device
  2. List of device first, then alert

image

@zubir2k
zubir2k / Cloudflare.md
Created November 5, 2023 09:26
Cloudflare

Cloudflare DNS Bash Script

Simple bash script that will update your A record to your current IP.
This script can be used in Synology Task Scheduler.

image

Preparing Setup

  1. To get your Cloudflare Zone ID and API key, log in to the Cloudflare Dashboard for the domain you want to use. Your Zone ID will be displayed in the bottom right corner.
@zubir2k
zubir2k / MinecraftAlert.md
Created July 17, 2023 07:30
Minecraft Server Alert
@zubir2k
zubir2k / HomeAssistantIslamicPrayerTimeExtended.md
Last active April 24, 2024 14:31
Home Assistant Islamic Prayer Time [Extended]

Home Assistant Islamic Prayer Time [Extended]

Reference: https://www.home-assistant.io/integrations/islamic_prayer_times

Assalamu'alaikum

The current integration only creates sensors consist of fajr, dhuhr, asr, maghrib, isha, sunrise and midnight. This will add 2 additional sensors which will ease in creating adzan automation:

  1. Current Prayer Time
  2. Imsak Time

Home Assistant Doa Pagi & Takbir visitors

Automation playing Doa Pagi on sunrise with addition of Takbir Raya on Eidul Fitr and Eidul Adha

Prerequisite

  • This will create hijri date sensor
  • It will allow to trigger based on the following conditions:
    1. Eidul Fitri 1 Syawal (01-10)
    2. Eidul Adha 10 Zulhijjah (10-12)
@zubir2k
zubir2k / HomeAssistantSolatGPS
Last active April 26, 2022 06:01
HomeAssistantSolatGPS
## Solat by Location ##
# Based on API Provided by Malaysia Prayer Time (https://mpt.i906.my/api.html)
# Please change the person sensor (person.zubir) accordingly..
# Place this code into configuration.yaml
sensor:
- platform: rest
name: "Solat GPS"
scan_interval: 1800
resource_template: "https://mpt.i906.my/api/prayer/{{ state_attr('person.zubir', 'latitude') ~ ',' ~ state_attr('person.zubir', 'longitude') }}"
@zubir2k
zubir2k / HomeAssistantTNB
Last active September 20, 2021 23:22
Calculate TNB Bill based on Energy Sensor
########################
## configuration.yaml ##
########################
## Change sensor name accordingly (sensor.sonoff_xxxxxxxxx)
## Original code from bro Ishak (https://github.com/ishakmuhamad/bill_tnb_ha)
## AlexxIT/SonoffLAN ##
sonoff:
username: your@email.here
password: password
@zubir2k
zubir2k / HomeAssistantYoutube
Last active September 9, 2021 02:22
Home Assistant Sensors for Youtube Subscriber & Viewers from Socialblade
## Youtube Subscription & Viewers Sensors
#########################################
## Stats is based on Socialblade using scrape. Scan interval is set at 30min to avoid from being blocked.
## Consist of 2; subscriber and views sensors
## Automation ideas: use telegram to notify changes. Can also trigger other stuff like RGB light bulb (e.g. Flashing red).
## configuration.yaml ##
sensor:
- platform: scrape
name: Youtube Subscriber
@zubir2k
zubir2k / HomeAssistantWashingMachine
Created September 6, 2021 19:39
Washing Completion Notification based on value from Power Monitoring Plug.
## Washing Machine Notification
###############################
## Description:
## 1. Based on power monitoring plug (measuring in Watt & Amp)
## 2. State is determined by power monitoring value (further analysis is required; recommended 3 cycle washing)
## 3. Adjust the Watt & Amp value in the template sensor according to your analysis result
## 4. Notification is triggered based on final value (when washing is completed state)
## 5. Weather forecast is using OpenWeatherMap integration. Can also use others.
## configuration.yaml ##
@zubir2k
zubir2k / HomeAssistantDSSVOIP
Last active September 3, 2021 03:52
VoIP call on Home Assistant with DSS VoIP Addon
### DSS VoIP Addon Configuration with IPTel.org
### Consist of 2 areas:
### 1. configuration.yaml
### 2. lovelace
###
### Requirements:
### 1. SIP account with IPTel.org (free)
### 2. DSS VoIP addon (https://github.com/sdesalve/hassio-addons/tree/master/dss_voip)
### 3. A working TTS