Skip to content

TriTue2011/R1-card

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

108 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Phicomm R1 cho Home Assistant

HACS

Integration + Custom Card cho Home Assistant, điều khiển toàn diện thiết bị Phicomm R1 (AI BOX).

Không cần bridge, không cần tunnel domain — HA kết nối trực tiếp đến R1 qua WebSocket native.


1. Cài đặt qua HACS

  1. HACS -> Custom repositories
  2. Add: https://github.com/TriTue2011/R1-card — Category: Integration
  3. Tìm và cài Phicomm R1
  4. Restart Home Assistant

2. Cấu hình integration

Vào Settings -> Devices & Services -> Add Integration rồi tìm Phicomm R1.

Thiết lập khuyến nghị:

  • Tên: Phicomm R1
  • Host: IP của loa
  • Cổng: 8080
  • Cổng WS media (YouTube/Zing): 8082
  • Chu kỳ cập nhật: 15
  • Dùng /media-dispatch để điều khiển phát: bật
  • Chế độ giao thức: auto

Gợi ý chọn giao thức:

  • auto: nên dùng cho lần cài đầu tiên
  • ws_native: dùng khi muốn ưu tiên kết nối native (khuyến nghị)
  • http_bridge: chỉ dùng nếu bạn biết chắc mình đang dùng bridge cũ

3. Cài đặt Card UI

Download file phicomm-r1-card.js từ thư mục www/phicomm_r1/ và copy vào config/www/phicomm_r1/

Sau đó vào Settings -> Dashboards -> Resources -> Add resource:

  • URL nhập: /local/phicomm_r1/phicomm-r1-card.js
  • Resource type: JavaScript module -> Save

Tuỳ chọn: AI BOX HA card (standalone, không phụ thuộc card khác)

Nếu bạn muốn dùng card aibox-ha-card độc lập (bản gọn, multi-room cơ bản):

Tuỳ chọn: AI BOX HA card (full UI, gần giống aibox-webui-card.js)

Nếu bạn muốn dùng bản full UI giống aibox-webui-card.js nhưng hỗ trợ domain/HTTPS qua custom endpoint:

  • www/phicomm_r1/aibox-ha-card.js -> config/www/phicomm_r1/aibox-ha-card.js

Sau đó add resource:

Tuỳ chọn: AI BOX card (phiên bản alias chạy qua integration)

Nếu bạn muốn giữ tên card kiểu AI BOX (dễ migrate từ card cũ), copy thêm file:

  • www/phicomm_r1/aibox-ha-card.js -> config/www/phicomm_r1/aibox-ha-card.js

Sau đó add thêm resource (đặt sau phicomm-r1-card.js):

  • URL: /local/phicomm_r1/aibox-ha-card.js
  • Type: JavaScript module

Tuỳ chọn: Lite card (bản nhẹ theo integration, có multi-room trong 1 card)

Copy file:

  • www/phicomm_r1/phicomm-r1-lite-card.js -> config/www/phicomm_r1/phicomm-r1-lite-card.js

Add resource:

  • URL: /local/phicomm_r1/phicomm-r1-lite-card.js
  • Type: JavaScript module

4. Tạo card trên Lovelace

Sử dụng cấu hình sau:

type: custom:phicomm-r1-card
entity: media_player.phicomm_r1
title: Phicomm R1

Nếu entity của bạn có tên khác thì thay media_player.phicomm_r1 bằng đúng entity đang dùng trong Home Assistant.

Bạn cũng có thể dùng thêm option max_height để giới hạn chiều cao của card:

type: custom:phicomm-r1-card
entity: media_player.phicomm_r1
title: Phicomm R1
max_height: 500px

Hoặc dùng card mới:

type: custom:aibox-ha-card
entity: media_player.phicomm_r1
title: AI BOX

aibox-ha-card hỗ trợ thêm:

  • custom_ws_url (HTTPS/domain main WS, ưu tiên trước tunnel)
  • custom_speaker_ws_url (HTTPS/domain speaker WS)
  • room-level override: rooms[].custom_ws_url, rooms[].custom_speaker_ws_url

Hoặc dùng lite card (1 card nhiều entity):

type: custom:phicomm-r1-lite-card
title: AI BOX Lite
rooms:
  - entity: media_player.phicomm_r1_phong_khach
    name: Phòng khách
  - entity: media_player.phicomm_r1_phong_ngu
    name: Phòng ngủ
show_sync_selector: true
show_volume: true

Tính năng

Media

  • Phát nhạc YouTube / Zing MP3
  • Seek bar, repeat, shuffle
  • Tìm kiếm bài hát / playlist (YouTube, Zing MP3)
  • Quản lý playlist: tạo, xóa, xem danh sách, thêm/xóa bài

Control

  • Wake Word — bật/tắt + chỉnh độ nhạy
  • TTS tiếng Việt (Chống Điếc AI)
  • DLNA / AirPlay / Bluetooth toggle
  • LED RGB + đèn viền Edge
  • Audio Engine: EQ 5 băng tần, presets, Bass Boost, Loudness
  • Báo thức nâng cao

Chat

  • Gửi text và nhận phản hồi AI
  • Wake Up / Test Mic
  • Lịch sử chat

System

  • CPU / RAM realtime
  • Reboot
  • Thông tin thiết bị

So sánh với phiên bản cũ (standalone card)

Phiên bản cũ Phiên bản mới
Kiến trúc Card JS kết nối WebSocket trực tiếp HA Integration + Card
Bridge Cần tunnel/domain khi HTTPS Không cần
Kết nối Browser -> R1 HA Server -> R1
Multi-room Quản lý trong card Thêm nhiều integration entry
Cấu hình YAML trong card Config flow UI

Troubleshooting

Triệu chứng Nguyên nhân Cách xử lý
Không kết nối được Sai IP hoặc loa offline Kiểm tra IP, port 8080/8082
Entity unavailable Integration chưa kết nối Kiểm tra giao thức, thử ws_native
Card không hiển thị Chưa add resource Thêm resource JS trong Dashboard settings

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors