ใช้งานLocal Home Assistant ร่วมกับ Google Home

  1. ติดตั้ง add-on ngrok และเริ่มต้นสร้าง tunnel เข้ามาที่ Home Assistant
  2. Integrate Google Home กับ Home Assistant
  3. ตั้งค่าให้อุปกรณ์ Google Home เชื่อมต่อกับ Home Assistant

ติดตั้ง add-on ngrok และเริ่มต้นสร้าง tunnel เข้ามาที่ Home Assistant

  • cofiiguration
  • Add-ons,Backups & Supervisor
  • ADD-ON STORE
  • มองหา ngtok Client  แล้ว Install 
  • หลังติดไปไปที่ www.ngrok.com เข้าไป sign-up ลงทะเบียน
  • จากนั้น login เข้าไป ดูที่ Getting Started
  • เลือก Your Authtoken
  • จะมี Token ให้ คัดลอกมา
  • กลับมาที่ ngrok Client เลือกเมนูบน  Configuration
  • ที่ Option ให้วางค่า token ที่ได้หน้า auth_token:
				
					log_level: info
auth_token: 27XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
region: us
tunnels:
  - name: hass
    proto: http
    addr: 8123
    inspect: false
    bind_tls: true
				
			
  • จากนั้น SAVE และ RESTART
  • กด menu บน Info เลือก Open WEBUI
  • จะได้ค่า Tunnel URLs คัดลอกมา

2.Integrate Google Home กับ Home Assistant

ไปที่ https://console.actions.google.com/ สมัครใช้งาน 

จากนั้นไปกดสร้าง New Project ตั้งชื่อ

หลังจากตั้งชื่อ project แล้ว จะเข้า Get Started

เลือก Smart Home เลือก Start Building

เลือก Build your Action

กด Add Action(s) จะขึ้น

Build your first Action เลือก Get Started

เลือก Smart Home เลือก Build

ตรง Fulfillment URL

นำลิงค์ tunnel ที่ได้จาก ngrok บน home assistant มาใส่แล้วตามด้วย /api/google_assistant แล้วกด save

กดปุ่มจุด 3 จุดบนมุมขวาบนแล้วเลือก Project Setting

คัดลอก Project ID ไว้

ไปที่ Develop เลือก Account linking

เลือก No, I Only want to allow accoubnt creation on my website

ที่ Linking type เลือก OAuth

https://www.duckdns.org/
ลงทะเบียน
add subdomain ex. xxxxx.duckdns.org
Copy Token
Home Assistant
Settings -> Add-ons ->
ADD-ON STORE เลือก Duckdns -> INSTALL
Configuration
Domains
Token
Save
ไปที่ info กด Start
สมัคร Let’s Encrypt เพื่อ ทำ SSL
Settings -> Add-ons ->
ADD-ON STORE เลือก Let’s Encrypt-> INSTALL
เลือก Configuration
ใส่ Domains
E-mail
กด Save
กลับมาหน้า info
กด Start


แก้ไข configuration.yaml
เพิ่ม
# enable https
http:
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem