zubir2k

Home Assistant Sensor on monthly billing from MyTNB Website (WIP)

Jul 28th, 2021
917
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ## Testing - Sensor on monthly billing from MyTNB Website (WIP)
  2. ## Replace the following to your credentials:
  3. ## 1) NOMBOR_ACC_TNB
  4. ## 2) USERID_MYTNB
  5. ## 3) PASSWORD_MYTNB
  6.  
  7. - platform: rest
  8.   name: My TNB
  9.   username: USERID_MYTNB
  10.   password: PASSWORD_MYTNB
  11.   authentication: basic
  12.   headers:
  13.     User-Agent: Mozilla/5.0
  14.     Content-Type: application/json  
  15.   resource: https://myaccount.mytnb.com.my/AccountManagement/ViewAccountProfile/RetrieveTabData?tabID=3&accountNo=NOMBOR_ACC_TNB
  16.   scan_interval: 300
  17.   json_attributes_path: $.records[:1]
  18.   json_attributes:
  19.    - BillingDate
  20.     - Amount
  21.   value_template: "{{ value_json[1].EnergyConsumption }}"
  22.   unit_of_measurement: "kWh"
RAW Paste Data