Chuyển đến nội dung chính

Bài đăng

Đang hiển thị bài đăng từ Tháng 11, 2020

[HA] EVNHCM Lấy thông tin điện lực HCM cho home assistant

Thông tin được lấy từ nguồn dữ liệu tại trang https://cskh.evnhcmc.vn/ với user/pass các bạn cung cấp . Chúng tôi chỉ lấy thông tin này và chuyển đổi dạng để phù hợp sử dụng trên Home Assistant . Chúng tôi sẽ không chiụ trách nhiệm về độ chính xác của dữ liệu này ============================================== Update : 2021/08/15 update code tương thích với version hass mới , không bị giới hạn số lần request các hướng dẫn bên dưới ko cần làm theo chỉ làm theo video trên youtube : https://www.youtube.com/watch?v=vfKpr9y1Oxs ============================================== từ ngày 2021/08/15 : các bạn không làm theo các step bên dưới chi tiết làm theo video hướng dẫn trên Các bước thực hiện : Step1 : Copy components (link bên dưới) vào đường dẫn chính xác bên dưới: /config/custom_components/nct_evnhcm/ Step2 : config sensor và nhớ reset HA Step 3: kiểm tra có thông tin chưa Step 4 : đưa thông tin vào giao diện hoặc xử lý automation tuỳ vào mỗi người =================== Link : https://git

[python] heroku - selenium

  Step 1: Set Up Your Code Add the following lines to your code before you use Selenium. from selenium import webdriver import os chrome_options = webdriver.ChromeOptions() chrome_options.binary_location = os.environ.get("GOOGLE_CHROME_BIN") chrome_options.add_argument("--headless") chrome_options.add_argument("--disable-dev-shm-usage") chrome_options.add_argument("--no-sandbox") driver = webdriver.Chrome(executable_path=os.environ.get("CHROMEDRIVER_PATH"), chrome_options=chrome_options) # Now you can start using Selenium Step 2: Add the Buildpacks On Heroku, open your App. Click on the Settings tab and scroll down to Buildpacks. Add the following: Python (Select it from the officially supported buildpacks) Headless Google Chrome:  https://github.com/heroku/heroku-buildpack-google-chrome Chromedriver:  https://github.com/heroku/heroku-buildpack-chromedriver Step 3: Add the Config Vars Scroll to the config vars section. Here, we will a