Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ############################################################################################
- ## Tenega Nasional Berhad (TNB) Malaysia Energy/Electric Bill Calculator for Home Assistant
- ## Suitable for eWelink RCCB Switch with Power Monitoring
- ############################################################################################
- ## Filename: automation.yaml
- ############################################################################################
- ## Disclaimer: Readings is STRICTLY for reference only. It may not be the same with
- ## your actual electric bill.
- ############################################################################################
- ## This automation performs the following;
- ## 1) [Optional] Record readings into file
- ## 2) [Optional] Notify readings to Telegram bot
- ## 3) Reset utility meter based on your TNB billing cycle
- alias: Monthly TNB Billing
- description: ''
- trigger:
- - platform: time
- at: '00:00'
- condition:
- - condition: template
- value_template: '{{ (now().strftime("%d") | int) == 9 }}' # 9 ikut pada tarikh mula bill TNB setiap bulan
- action:
- - service: notify.monthly_tnb_csv
- data:
- message: >-
- ## TNB Bill ## This month bill for {{ states('sensor.monthly_power_kw')
- | float(2) }}kWh usage is {{states('sensor.to_bill_tnb_rm') | float(2)
- }} MYR
- - service: notify.notify_telegrammaster
- data:
- title: '*⚡ TNB Bill*'
- message: >-
- This month bill for {{ states('sensor.monthly_power_kw') | float(2)
- }}kWh usage is *{{states('sensor.to_bill_tnb_rm') | float(2) }} MYR*
- - service: utility_meter.reset
- data:
- entity_id: utility_meter.monthly_energy
- mode: single
Add Comment
Please, Sign In to add comment