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 / gasconsumption.md
Last active August 30, 2025 21:47
Gas Consumption Based on Cooker Hood

๐Ÿ”ฅ Gas Consumption based on Cooker Hood

Requirement

  • Power monitoring switch (Wifi/Zigbee) installed to Cooker Hood
  • Assumption: Current above 40watt is considered running (adjust accordingly)

What to adjust

  • sensor.cooker_hood_power
  • float > 40 (change this to the current value that matched with cooker hood in running state)
@zubir2k
zubir2k / Panda PWR.md
Last active March 19, 2025 15:55
Panda PWR Template

Panda PWR Home Assistant Template

image

First of all, this is an alternative to the Panda PWR custom integration made by @juanillo62gm

I noticed that the connectivity while using that integration keeps on disconnected with timeout error shown in the log.
So I decided to take a look into the Bigtreetech API documentation for Panda PWR and create a working template.

However, I do hope that Bigtreetech would consider adding MQTT support within the WebUI itself as describe here PandaPWR/Issue #20

โšกTNB NEM Calculator

This template will create the necessary sensor that calculates your monthly TNB bill with NEM (Net Energy Metering).

๐Ÿ“ฆ Installation

  1. Set path /HAMY as package directory in your configuration.yaml (if you have not done so)
homeassistant:
  packages: !include_dir_named HAMY/
@zubir2k
zubir2k / solplanet.md
Last active October 13, 2024 08:54
Solplanet Inverter Template - IP and Serial No. maintained in a text input.

๐ŸŒž Solplanet Inverter Template

Easily apply template with Text input for inverter IP and serial no.
Note:

  1. If you have battery, it will fetch battery information such as SoC, Voltage, Amps, Current.
  2. I use ShellyEM to read reverse energy via CT Clamp.

๐Ÿ› ๏ธ Initial Setup

Enter inverter IP Address and Serial Number to these input_text entity:
image

@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 March 1, 2025 16:22
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') }}"