2020/12/22

網站資料庫 151

版本: 151 - 20201222
+ 新增 '書閱屋', '奇快中文' 支援
- 調整 '文學館', '愛小說書城', '鯉魚鄉 [腐書網]', '盜夢人小說網', '123讀', '純肉小說' 使用網址
- 調整 '百書樓' 分類
- 修正 '腐小說' 部份內文載入問題
- 修正 '電子書吧' 載入問題(需更新軟體才能正常)
- 修正 '聚合中文網' 搜尋問題
- 修正 '小說屋' 章節目錄載入問題
- 修正 '鉛筆小說網' 搜尋問題
- 修正 '啃書閣小說' 朗讀問題
- 修正 'POPO 原創市集' 解析問題
- 修正 '腐小說' 內文載入問題
- 修正 'FC2' 重複載入問題
- 修正 '書蟲網' 章節目錄載入問題
更新方式:
1. 手動更新
a) 設定的網站資料庫
b) 點擊下載
c) 下載檔案 "網站資料庫更新包x_151.zip"
d) 設定的網站資料庫
e) 匯入

2. 自動更新
a) 設定的網站資料庫
b) 點擊版本

2020/11/19

輕鬆讀小說 v5.6.3

v 5.6.3
BUGS
- 修正部份設備點擊小說強制關閉的問題
- 修正預設目錄刪除暫存的問題
- 修正內文插圖顯示問題

v 5.6.2
+ 更新資料庫至 150
BUGS
- 修正部份強制關閉的問題
- 修正 android 10 以下字型設定問題
- 修正部份章節目錄判斷錯誤問題
- 修正朗讀停止相關的問題
- 修正清除閱讀紀錄的問題

Google Play: 輕鬆讀小說
========================
支援網站: https://goo.gl/jXLsJu
使用說明與教學: FAQ
更新紀錄: changelog

輕鬆讀小說 v5.6.2

v 5.6.2
+ 更新資料庫至 150
BUGS
- 修正部份強制關閉的問題
- 修正 android 10 以下字型設定問題
- 修正部份章節目錄判斷錯誤問題
- 修正朗讀停止相關的問題
- 修正清除閱讀紀錄的問題

Google Play: 輕鬆讀小說
========================
支援網站: https://goo.gl/jXLsJu
使用說明與教學: FAQ
更新紀錄: changelog

2020/11/06

輕鬆讀小說 v5.6.1

v 5.6.1
+ 更新資料庫至 149
+ 朗讀新增設定, 可關閉背景朗讀
+ 內文朗讀畫面,新增朗讀速度設定
BUGS
- 修正 android 10 以上使用問題
- 修正部份強制關閉的問題

Google Play: 輕鬆讀小說
========================
支援網站: https://goo.gl/jXLsJu
使用說明與教學: FAQ
更新紀錄: changelog

2020/10/29

輕鬆讀小說 v5.6.0

v 5.6.0
BUGS
- 緊急修正權限設定問題

v 5.5.9
BUGS
- 緊急修正部份設備更新後會自動關閉的問題

v 5.5.8
+ 更新資料庫至 148
+ 我的書櫃新增直接匯入 google drive 文字檔, epub
+ 設定的閱讀新增內文分頁樣式,可設定為選單或者列表
+ 設定的閱讀新增段落首行縮排,可設定縮排字數或者不縮排
+ 支援背景朗讀
BUGS
- 修正點擊按鈕安裝同步插件時,按鈕無效的問題
- 修正部份文字敘述錯誤的問題

Google Play: 輕鬆讀小說
========================
支援網站: https://goo.gl/jXLsJu
使用說明與教學: FAQ
更新紀錄: changelog

2020/09/25

網站資料庫 147

版本: 147 - 20200925
+ 新增 '天天中文', '品書網', '52 小說網', '思兔閱讀網 [sto123]', '4G 小說網', '筆趣閣 [xswang]', '38 看書' 支援
+ 新增離線網站 '電子書吧' 支援
+ 更新 '完本神站' 使用網址
- 修正 '卡提諾小說網 [101novel]' 部份內文載入問題
- 修正 '就愛書屋' 部份內文載入問題
- 修正 'FC2' 解析問題
- 修正 '得間小說' 搜尋結果問題
- 修正 '求書幫' 內文載入問題
- 再度修正 '85 小說網' 內文載入問題

更新方式:
1. 手動更新
a) 設定的網站資料庫
b) 點擊下載
c) 下載檔案 "網站資料庫更新包x_147.zip"
d) 設定的網站資料庫
e) 匯入

2. 自動更新
a) 設定的網站資料庫
b) 點擊版本

2020/09/07

輕鬆讀小說 v5.5.7

v 5.5.7
+ 更新資料庫至 146
+ 調整流程以便更方便操作
BUGS
- 修正部份強制關閉的問題

Google Play: 輕鬆讀小說
========================
支援網站: https://goo.gl/jXLsJu
使用說明與教學: FAQ
更新紀錄: changelog

2020/09/03

輕鬆讀小說 v5.5.6

v 5.5.6
+ 更新資料庫至 145
+ 朗讀新增設定,可以設定返回鍵停止朗讀
+ 朗讀新增設定,可測試朗讀速度
BUGS
- 修正部份強制關閉的問題

Google Play: 輕鬆讀小說
========================
支援網站: https://goo.gl/jXLsJu
使用說明與教學: FAQ
更新紀錄: changelog

2020/08/21

網站資料庫 v144

版本: 144 - 20200821
+ 新增 '溜書網', '後花園', '得間小說', '九六中文', '書包網 [shubaow]', '棉花糖小說網', '若晨文學', '筆趣閣小說 [spps]' 支援
- 修正 '85 小說網' 因部份改版導致無法使用的問題
- 修正 '無限小說' 因改版導致無法使用的問題
- 修正 '飄天中文網' 因改版導致無法使用的問題
- 修正 '微風小說網' 部份載入問題
- 修正 '求小說' 使用問題
- 修正 '耽美書網' 判斷最愛的問題
- 修正 '伊莉 - 小說' 部份載入問題
- 修正 '小說屋' 改版導致不能使用的問題
- 修正 '輕小說文庫 [wenku8]' 封面問題
- 修正 '輕之國度 [LK]' 部份章節目錄問題
- 再度修正 '大家讀書院' 因改版導致無法使用的問題

更新方式:
1. 手動更新
a) 設定的網站資料庫
b) 點擊下載
c) 下載檔案 "網站資料庫更新包x_144.zip"
d) 設定的網站資料庫
e) 匯入

2. 自動更新
a) 設定的網站資料庫
b) 點擊版本

2020/08/05

輕鬆讀小說 v5.5.5

v 5.5.5
+ 更新網站資料庫至 143
+ 新增自動捲動的設定,可自動翻頁而不是捲動
+ 文字設定裡面新增字間距設定
BUGS
- 修正部份強制關閉的問題
- 搜尋最愛分類搜尋沒有結果的問題
- 修正部份操作上的錯誤
- 修正線上匯入小說名稱的問題
- 修正雲端開啟文字檔的問題

Google Play: 輕鬆讀小說
========================
支援網站: https://goo.gl/jXLsJu
使用說明與教學: FAQ
更新紀錄: changelog

2020/07/21

網站資料庫 v142

版本: 142 - 20200721
+ 新增 '小說樓', '土豪小說', '純肉小說', '新愛看書吧', '紅葉書齋' 支援
+ 調整 '文學館', '百書樓', '91baby 媽媽網 - 天天讀好書' 使用網址
+ 調整 '愛下電子書' 改使用行動網頁
+ 移除 '嗡嗡嗡論壇' 支援
- 修正 'ESJZone' 解析問題
- 修正 '下書網' 內文分頁問題
- 修正 '筆趣閣 [Biqubao]' 搜尋問題
- 修正 '縱橫小說網' 章節載入問題
- 修正 '長佩文學' 部份內文載入問題
- 修正 '求小說' 載入問題
- 修正 'FC2' 解析後閱讀問題
- 修正 '2K 小說' 載入問題

更新方式:
1. 手動更新
a) 設定的網站資料庫
b) 點擊下載
c) 下載檔案 "網站資料庫更新包x_142.zip"
d) 設定的網站資料庫
e) 匯入

2. 自動更新
a) 設定的網站資料庫
b) 點擊版本

2020/06/29

輕鬆讀小說 v5.5.4

v 5.5.4
+ 更新網站資料庫至 141
BUGS
- 修正部份強制關閉的問題

Google Play: 輕鬆讀小說
========================
支援網站: https://goo.gl/jXLsJu
使用說明與教學: FAQ
更新紀錄: changelog
========================

2020/06/19

輕鬆讀小說 v5.5.3

v 5.5.3
+ 更新網站資料庫至 140
+ 新增文字檔章節目錄可選取清除閱讀紀錄的功能
+ 新增清除搜尋歷使用紀錄的確認視窗
BUGS
- 修正最愛分類如果設定頁面會打不開的問題
- 修正跳下一個文字檔的問題
- 修正當最愛小說太多時會導致搜尋嚴重遲鈍的問題
- 修正載入逾時機制
- 修正小說更新時自動下載的部份問題
- 修正部份朗讀功能
- 修正文字檔重複的問題

Google Play: 輕鬆讀小說
========================
支援網站: https://goo.gl/jXLsJu
使用說明與教學: FAQ
更新紀錄: changelog
========================

2020/06/12

網站資料庫 v139

版本: 139 - 20200612
+ 新增 '2K 小說' 支援
+ 新增 'Uwants 小說園地' 支援
+ 新增 '銀子5A網' 支援
+ 新增 '14小說網' 支援
+ 新增 '就愛書屋' 支援
+ 新增 '輕之國度 [LK]' 新版解析支援
+ 加回 '卡提諾論壇 - 小說'
+ 調整 '鬼書集名著閱讀', '輕之國度 [論壇]' 使用網址
- 移除 '新千千小說', '看書閣' 支援
- 修正 '第八區小說網' 因改版導致不能使用的問題
- 修正 '齋書苑' 章節目錄載入問題
- 修正 'esjzone' 部份內文載入問題
- 修正 '好看小說網' 部分內文載入問題
- 修正 '真白萌Web小鎮' 部份載入問題
- 修正 '思兔閱讀' 部分搜尋問題

更新方式:
1. 手動更新
a) 設定的網站資料庫
b) 點擊下載
c) 下載檔案 "網站資料庫更新包x_139.zip"
d) 設定的網站資料庫
e) 匯入

2. 自動更新
a) 設定的網站資料庫
b) 點擊版本

2020/05/21

輕鬆讀小說 v5.5.2

v 5.5.2
+ 新增設定,設定背景圖片時是否將背景顏色自動設定成相似色
+ 新增設定,可設定已閱讀跟未閱讀章節的判別方式
+ 新增設定,可開啟或關閉內文強制斷行
BUGS
- 修正部份強制關閉的問題
- 修正部分判斷是否有同步導致強制關閉的問題
- 修正單一文字檔沒顯示閱讀紀錄的問題
- 修正朗讀自動換頁不會從頭朗讀的問題

Google Play: 輕鬆讀小說
========================
支援網站: https://goo.gl/jXLsJu
使用說明與教學: FAQ
更新紀錄: changelog
========================

2020/05/18

輕鬆讀小說 v5.5.1

v 5.5.1
+ 新增清單字體設定
BUGS
- 修正部份強制關閉的問題
- 修正點擊最近閱讀小說更多選項會強制關閉的問題
- 修正清除書櫃閱讀紀錄會強制關閉的問題
- 修正下載管理重試全部失效的問題
- 修正我的書櫃修正時間排序問題
- 修正朗讀自動換頁後不會隨句子跳行的問題
- 修正備份最愛小說時,標籤跟別名沒有備份的問題

Google Play: 輕鬆讀小說
========================
支援網站: https://goo.gl/jXLsJu
使用說明與教學: FAQ
更新紀錄: changelog
========================

2020/05/14

輕鬆讀小說 v5.5.0

v 5.5.0
+ 更新網站資料庫至 137
+ 我的最愛關鍵字搜尋新增包含作者的部份
+ 設定的操作新增雙點擊啟動朗讀功能
+ 設定的操作新增關閉左右滑動換章節功能
+ 自動捲動時,點擊停止按鈕上方可再叫出設定畫面
+ 小說清單新增多選小說加入最愛功能
+ 解析支援登入以及驗證功能
+ 支援只看作者選項(針對部份論壇網站)
+ 新增可設定最愛小說有更新時是否置頂
+ 新增內文背景設定,可設定背景圖片是否重複跟隨內文捲動
+ 調整曾經閱讀過章節的顯示方式
BUGS
- 修正部份強制關閉的問題
- 修正強制分頁朗讀的問題
- 修正內文分頁閱讀紀錄的問題
- 修正 android 10 設定字型問題


Google Play: 輕鬆讀小說
========================
支援網站: https://goo.gl/jXLsJu
使用說明與教學: FAQ
更新紀錄: changelog
========================

2020/04/29

網站資料庫 v136

版本: 136 - 20200429
+ 新增 '輕小說文庫 [Linovelib]' 解析
+ 新增 '真白萌Web小鎮', '耽美書網', '手打吧小說網' 支援
+ 新增 '親小說網' 登入功能
+ 新增 '書屋小說網' 搜尋功能
+ 調整 '卡夜閣' 改使用行動版(電腦版會缺章節)
+ 調整 '看書閣' 使用網址
+ 支援 '小說狂人' 驗證功能
- 移除 '筆迷屋' 支援
- 修正 'ESJZone' 章節目錄和解析書名問題
- 修正 '親小說網' 章節目錄以及內文分頁問題
- 修正 '親親小說網', '樂文書屋' 章節目錄載入問題
- 修正 '下書網' 載入問題與搜尋問題
- 修正 '伊莉 - 小說', '新小說吧' 部份朗讀問題
- 修正 '齋書苑' 因改版導致無法載入以及內文短缺的問題
- 修正 '耽美中文網' 小說清單問題
- 修正 '好看小說網' 內文載入問題
- 修正 'FC2' 部份內文載入問題
- 修正 '全本小說網 [Quanben5]' 部份載入問題
- 修正 '起點中文 - 台灣分站' 章節目錄載入問題

更新方式:
1. 手動更新
a) 設定的網站資料庫
b) 點擊下載
c) 下載檔案 "網站資料庫更新包x_136.zip"
d) 設定的網站資料庫
e) 匯入

2. 自動更新
a) 設定的網站資料庫
b) 點擊版本

2020/03/23

網站資料庫 v135

版本: 135 - 20200323
+ 新增 '完本神站', '卡夜閣', '妙筆閣' 支援
+ 新增 '百合會' 分類
- 移除 '4K 文學', '格格黨' 支援
- 再度修正 'FC2' 解析以及部份內文載入問題
- 修正 '印摩羅天言情小說' 章節目錄以及搜尋問題
- 修正 'ESJZone', '樂文書屋' 部份內文載入問題
- 修正 '親小說' 內文分頁問題
- 修正 '全本小說網 [Quanben5]' 搜尋問題以及內文問題
- 修正 '豆豆小說閱讀網' 章節載入問題
- 修正 'POPO 原創市集' 章節載入問題

更新方式:
1. 手動更新
a) 設定的網站資料庫
b) 點擊下載
c) 下載檔案 "網站資料庫更新包x_135.zip"
d) 設定的網站資料庫
e) 匯入

2. 自動更新
a) 設定的網站資料庫
b) 點擊版本

2020/02/20

網站資料庫 v134

版本: 134 - 20200220
+ 支援 '吾讀論壇' 解析閱讀
- 移除 '大海中文網', '桑舞小說網' 支援
- 移除部份網站搜尋支援
- 修正 '2k 小說閱讀網' 搜尋問題
- 修正 '十九樓書包網' 簡介問題
- 修正 '伊莉小說網 [YLXS]' 朗讀內文的問題
- 修正 'FC2' 解析以及部份內文載入問題
- 修正 'ESJZone' 部份內文載入問題
- 修正 '全本小說網 [Quanben5]' 部份內文載入問題
- 修正 '卡提諾 - 異色文學' 的章節以及內文部份的問題
- 修正 '求小說' 章節少頁數的問題以及載入問題
- 調整 '啃書閣小說', '愛看書吧', '印摩羅天言情小說', '戀上你看書網', '百書樓', '愛小說書城' 使用網址
- 修正 '愛看書吧' 分類小說清單顯示問題
- 修正 '印摩羅天言情小說' 小說清單顯示
- 修正 '飛盧小說網', '飛盧女生網' 小說清單, 搜尋以及內文問題

更新方式:
1. 手動更新
a) 設定的網站資料庫
b) 點擊下載
c) 下載檔案 "網站資料庫更新包x_v134.zip"
d) 設定的網站資料庫
e) 匯入

2. 自動更新
a) 設定的網站資料庫
b) 點擊版本

安裝 HACS 和移除

HACS - Home Assistant Comunity Store

裡面收藏了一些好用的套件,除了可以方便安裝以外,也可追蹤所使用的套件是否有更新。
以下是安裝步驟:

  1. HACS 下載最新版本
  2. 建立目錄 hacs,並將檔案解壓縮至此目錄,確認 hacs 目錄裡面包含隱藏目錄 .translations 。如果沒有則重新下載再解壓縮一次。
  3. 在 config 目錄底下建立 custom_components 目錄,如果已經存在則省略。
  4. 將 hacs 目錄搬移至 custom_components 目錄底下。
  5. 重啟 hassio。
  6. 建立 Github Personal Access Token,可參考此篇
  7. 進去 Home assistant,然後去 Configuration -> Integrations,點擊右下角 +,搜尋 HACS。然後選擇出現的項目。
  8. 貼上步驟 6 的 Token 按確定。如果要重新設定則必須先從 integrations 移除後重新加入。
  9. 如果要手動加入,則在 configuration.yaml 加入以下資料。token 請使用步驟 6 建立的部份。

    hacs:
      token: github_token
    
  10. 重啟 hassio。這樣就會看到側邊有 HACS,安裝就完成了。

參考連結: https://hacs.xyz/docs/installation/manual

如果要移除 HACS 則依照下面步驟。

  1. 從 configuration.yaml 把 hacs 移除。
  2. 去 Configuration -> Integrations 點進去 HACS 然後點擊右上角垃圾桶圖示移除。
  3. 重啟 Hassio 兩次。
  4. 移除 custom_components 底下的 hacs 目錄。
  5. 在 config 底下的 .storage,把關於 hacs 相關資料都移除。
  6. 重啟 Hassio。

參考連結: https://hacs.xyz/docs/installation/remove

2020/02/11

Configurator Add-On

安裝 configurator,這個方便可以直接線上修改相關的設定。
安裝方式很簡單,依照下面步驟:
1. Supervisor -> ADD-ON Store
2. Search 輸入 Configurator
3. 點擊 Configurator,再點擊 INSTALL
4. 安裝完畢,勾選 Show in sidebar,這樣左側選單就會出現 Configurator 快捷按鈕
5. 點擊 START

這樣就安裝完畢了。
建議安裝完 Hass.io 後可以先安裝這個插件。

2020/02/10

Let's encrypt 申請 ssl 憑證

Let’s Encrypt 可對 domain 做憑證以便後續的功能使用以及遠端登入可以提供更加的安全性。
如果沒有自己的 domain name,可以至 duckdns 免費申請。

Let’s Encrypt 有一個限制就是至少每 30-40 天必須更新憑證。
因此如果所使用的 domain 是從 duckdns 申請的,可以考慮安裝另外一個 addon - Duck Dns

這邊我只安裝 Let’s Encrypt 來做 domain 的憑證。domain 的部份則交由我另外一個地方的主機來做更新。

安裝 Let’s Encrypt
1. Supervisor -> ADD-ON STORE
2. Search Let’s 找到後點進去並點擊 INSTALL
3. 安裝完畢,不要勾選 Start on boot
4. config 依照實際需求修改,設定好後點擊右下 Save

email: abc@example.com
domains:
  - test.duckdns.org
certfile: fullchanin.pem # 不要修改
keyfile: privkey.pem # 不要修改
challenge: http # 依照需求可改成 dns,這邊我是使用 http
dns: {} # 依照需求修改
  1. 回到畫面最上面點擊 Start
  2. 拉到最下面點擊 Refresh ,看一下偵錯訊息,正常的話就表示申請憑證成功

申請成功後,開啟 configuration.yaml,加上以下的部份。

http:
  base_url: test.duckdns.org:8123
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem

重啟 hass,這樣就可以使用 https 連線了,且也不能再使用 http 連線了。
遠端連線方式變成: https://test.duckdns.org:8123
本地端連線就要改成: https://本地端IP:8123

另外建議備份 config/addons/data/ 裡面的 core_letsencrypt 這個目錄,裡面有相關的憑證以及認證訊息。
這個可以在重新安裝時直接把這些資料覆蓋回去,這樣就不用重新申請憑證。
太頻繁申請憑證會暫時無法申請。

由於 Let’s encrypt 只用於申請憑證並沒有定時自己更新的功能。
因此需要加上自動更新的功能。
開啟 automations.yaml,加上以下的部份。
這會定期在每天晚上 11 點重新做憑證更新的動作。
憑證更新的部份會先檢查是否需要更新,如果有需要才會更新,
沒有需要則直接結束。

- id: 'system_lets_encrypt_renewal'
  alias: "[ System ] Let's Encrypt Renewal"
  trigger:
    - platform: time
      at: '23:00:00'
  action:
    - service: hassio.addon_restart
      data:
        addon: core_letsencrypt

Hass 重啟後,部份 automation 被觸發

Hass 重啟後,發現部份 automation 會被觸發。

比如當某人到某個區域時會自動送訊息給我。

automation:
  - id: 'notify_me_when_someone_is_arrived_at'
    alias: 'notify_me_someone_is_arrived'
    description: ''
    trigger:
      - platform: state
        entity_id: device_tracker.someone
        to: 'Work'
    acton:
      - service: notify.mobile_app_me_mobile
        data_template:
          message: 'Someone is arrived'

看起來很正常。
但是在以下狀況卻會發生問題。
如果 someone 已經在 Work 這個地方,當我重啟 Hass 則會再觸發一次這個 automation。
原因是當重啟時,Hass 會重新設定這個 device_track 的狀態,導致就觸發了這個 automation。
解決方式如下

automation:
  - id: 'notify_me_when_someone_is_arrived_at'
    alias: 'notify_me_someone_is_arrived'
    description: ''
    trigger:
      - platform: state
        entity_id: device_tracker.someone
        to: 'Work'
    condition: 
      - condition: template
        value_template: '{{ true if trigger.from_state is not None else false }}'
    acton:
      - service: notify.mobile_app_me_mobile
        data_template:
          message: 'Someone is arrived'


參考連結

2020/01/17

如何在 raspbian 安裝 hass.io?

Based on these posts:

目前我安裝 raspbian os 在 Raspberry Pi 3 B+,並且在此之上再安裝 hass.io。

不直接使用 hass.io 的原因是 raspbian 本身是 debian base,平常我電腦也是使用 debian,

這樣對我來說操作彈性更大。

以下是安裝方式:

  1. 安裝基本環境,這邊要特別注意的是 network-manager 預設會使用 wifi 動態來連線,所以如果有使用 router 鎖 mac 或者把 mac 綁在某個固定 IP 的記得參考此篇

    sudo -i
    apt-get install software-properties-common
    apt-get update
    apt-get install -y apparmor-utils apt-transport-https \
     avahi-daemon ca-certificates curl dbus \
     jq network-manager socat
    systemctl disable ModemManager # ModemManager 會對 Z-wave 和 Zigbee 影響,因此關閉也可以移除。
    curl -fsSL get.docker.com | sh
    
  2. 以下 script 會需要使用到 root 權限,建議先切換至 root 後再執行。-d 後面是 hass.io 儲存資料的位置,建議選擇自己容易備份的地方。

    curl -o hassio_install.sh -sL "https://raw.githubusercontent.com/home-assistant/hassio-installer/master/hassio_install.sh"
    chmod +x hassio_install.sh
    ./hassio_install.sh -m raspberrypi3 -d /home/me/hassio_data
    
  3. 安裝完畢後,輸入網址 http://[hostip]:8123,然後等待建置完畢後就可以建立帳號登入了。hostip 是安裝設備的 IP。

將 google assistant 加入 hass.io

Based on these posts:

Hass.io 支援 google assistant 有兩種方式

  1. 使用 Home Assistant Cloud (需要付費,每月 5 美金)。
  2. 手動加入 (免費但是複雜)。

這邊我採用手動加入的方式。以下為手動加入步驟。(使用手動加入前提是必須可使用 hostname 和有效的 ssl 憑證,這部分可以使用 duckdns addon 達成)

  1. Actions on Google console 建立專案。

    1. 點擊 New Project。Project Name 則輸入你想要的英文名稱,再設定語言跟所在國家或地區。然後點擊 Create Project

    2. 點擊 Smart Home,並且再點擊 Smart Home Recommended

    3. 點擊 Build your Action 再點擊 Add Actions(s)

    4. 填入以下資訊

      1. Fulfillment URL: https://[host:port]/api/google_assistant,host:port 輸入連結到 home assistant 的網址。舉例 example.org:8123
      2. 點擊右上角 Save 後在點擊左上角 Overview 回到之前頁面。
  2. 點擊 Setup account linking 連結帳號以便 google home 可以連結到你設定的專案。

    1. 勾選 No, I only want to allow account creation on my website,點擊 Next

    2. Select linking type 選擇 OAuth,Select grant type 選擇 Authorization code。點擊 Next

    3. 填入以下資訊

      • Client ID issued by your Actions to Google: https://oauth-redirect.googleusercontent.com/,最後的 / 不能少。
      • Client secret: 可隨便輸入
      • Authorization URL: https://[host:port]/auth/authorize,host:port 為連結到 home assistant 的網址。舉例 example.org:8123
      • Token URL: https://[host:port]/auth/token,host:port 為連結到 home assistant 的網址。舉例 example.org:8123
      • 點擊 Next
    4. Scopes 輸入 name 再點擊 Add scope,然後再輸入 email 再點擊 Add scope。記得確認 Google to transmit clientID and secret via HTTP basic auth header 不可勾選,然後點擊 Next

    5. Testing instructions 可隨便輸入。 然後點擊右下角 Save

  3. 點擊上方 Develop,Display name 輸入你想要看到在 Google Home 做第三方連結時的名稱。然後點擊右上方 Save

  4. 點擊上方 Test,這會產生一個測試的 app 版本,這可以讓我們從 Google Home 連結。

  5. Google Could Console 建立服務帳號,這在 Home assistant 設定時會使用到。

    1. 上方選取專案。選擇前面所建立的專案。

    2. 點擊左方憑證。點擊建立憑證後再選取服務帳戶金鑰

    3. 服務帳戶設定如下:

      1. 新增服務帳戶
      2. 服務帳戶名稱輸入隨便任一名稱
      3. 角色選擇服務帳戶裡面的服務帳戶憑證建立者
      4. 通常輸入服務帳戶時會一併自動產生服務帳戶 ID,如果沒有自己產生,可以點擊右方圖示或者自己輸入即可。這 ID 必須是不能重複的。
      5. 勾選 JSON,點擊建立
      6. 把此檔案透過 Hass.io 的 Configurator 上傳至 Hass.io 的 config,可先修改檔案名稱再上傳。此檔案後續設定 google assistant 時會使用到。
  6. 啟用 HomeGraph API。

    1. Google Could Console
    2. 上方選取專案。選擇前面所建立的專案。
    3. 點擊啟用 API 和服務
    4. 輸入 HomeGraph,選擇 HomeGraph API,然後點擊啟用。
  7. 開啟 configuration.yaml。設定範例如下,仔細設定可參考 configuration

    google_assistant:
      project_id: YOUR_PROJECT_ID
      service_account: !include SERVICE_ACCOUNT.JSON
      report_state: true
      expose_by_default: false
      entity_config:
        light.living_room:
          expose: true
          aliases: 
            - LIGHT
    
    • YOUR_PROJECT_ID 改成實際的 project id,可至 Google Could Console 點擊上方選取專案後,查看專案後面的 ID。
    • SERVICE_ACCOUNT.JSON 則為前面所下載的檔案名稱。
    • expose_by_default: false,這設定預設為 true,會讓所有符合 exposed_domains 的件都被 google home 所看到。建議使用 false,後面再手動自己把想要顯示的加上去。
    • 如果 expose_by_default 設定為 false,一定要記得下面的 entity_config 裡面的設定必須加上 expose 為 true。
    • 另外 entity_config 裡面,aliases 的部分會顯示在 Google Home 裡面,測試發現即使設定多個也只會顯示第一個。
    • 設定完畢後,重啟 Hass。
  8. 開啟 Google Home,點擊左上角 +

    1. 點擊設定裝置
    2. Google 的合作夥伴
    3. 點擊右上角搜尋圖示,輸入 test,應該可以看到一個 [test] XXX 的服務,XXX 是前面 Develop 所設定的 Display name。點擊這個服務輸入帳號密碼後,成功登入後會跳為前面選擇夥伴的畫面,此時再點進去 Google 的合作夥伴看看有沒有成功連接,正常就會出現在已連結的服務了。
  9. 開啟 google assistant 輸入或說出 sync my devices。

  10. 開啟 Google Home 就可以看到所增加的物件了。

更新 Let's Encrypt 失敗

將 hass.io 做 snapshot 還原時,針對 Let's Encrypt addon 啟動確認是否可以正常更新憑證。
發現卻無法更新,出現以下錯誤。
File “/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/storage.py”, line 273, in _check_symlinks
“expected {0} to be a symlink”.format(link))
CertStorageError: expected /etc/letsencrypt/live/example.org/cert.pem to be a symlink
這原因是當 Let's Encrypt 更新憑證時,會將 live/example.org/cert.pem 做 symbolic link 到 archive/example.org 裡面 certX.pem (x 表示數字,越大越新)。
如果檢查到不是 symbolic link 就會判斷有問題而不執行更新。
而做 snapshot 還原時會修改到這部分,此時只要移除 live/example.org/ 裡面的憑證重新做 symbolic link 即可。
以下 X 表示最大的數字。
rm -f live/example.org/*.pem
ln -sf archive/example.org/certX.pem live/example.org/cert.pem
ln -sf archive/example.org/chainX.pem live/example.org/chain.pem
ln -sf archive/example.org/fullchainX.pem live/example.org/fullchain.pem
ln -sf archive/example.org/privkeyX.pem live/example.org/privkey.pem

2020/01/16

Using nmap to do presence-detection

Based on these two posts.
- https://www.home-assistant.io/integrations/nmap_tracker/
- https://www.home-assistant.io/integrations/person/

1. add these lines to configuration.yaml
device_tracker:
  - platform: nmap_tracker
    # global config
    interval_seconds: 15
    consider_home: 180
    new_device_defaults:
      track_new_devices: false
      hide_if_away: false
    # config for nmap_tracker
    hosts: # network address to scan
      - 192.168.1.1/24
    home_interval: 10 # if it is home, not scan this device at least 10 mins
    exclude: # not to scan this device
      - 192.168.1.1
2. restart hass.io
3. check known_devices.yaml in Configurator, this file will be auto generated.
original:
11_22_33_44_55_66:
  hide_if_away: false
  icon:
  mac: 11:22:33:44:55:66
  name: 11 22 33 44 55 66
  picture:
  track: false

22_22_33_44_55_66:
  hide_if_away: false
  icon:
  mac: 22:22:33:44:55:66
  name: 22 22 33 44 55 66
  picture:
  track: false

updated:
me:
  hide_if_away: false
  icon:
  mac: 11:22:33:44:55:66
  name: me
  picture:
  track: true

her:
  hide_if_away: false
  icon:
  mac: 22:22:33:44:55:66
  name: her
  picture:
  track: true
4. go Configuration -> Persons, Click on the account, and select Track Device, in this case, choose device_tracker.me
5. If someone doesn't have the account in hass.io, go to Configurator and edit configuration.yaml.
Add these lines and then restart hass.io
person:
  - name: Her
    id: her1224 # this must be unique.
    device_trackers:
      - device_tracker.her
6. go Configuration -> Persons to check if add successfully.

2020/01/15

Maintain ssh tunnel

Based on this: https://github.com/daradib/sidedoor

1. installation
sudo apt install sidedoor
2. create ssh public key and add to remote user ~/.ssh/authorized_keys
sudo ssh-keygen -t rsa -N '' -f /home/myaccount/id_rsa
cat /home/myaccount/id_rsa.pub | ssh myaccount@my.remote.server 'cat >> .ssh/authorized_keys'
3. modify /etc/sidedoor/config
Host my.remote.server
  # SSH private key to access the remote server.
  IdentityFile /home/myname/id_rsa

  # because I am using ddns, my IP might change, so I set it to no
  StrictHostKeyChecking no

  # SSH host key of the remote server.
  UserKnownHostsFile /dev/null

  # If tunneled traffic is encrypted (e.g., SSH),
  # it probably does not compress well.
  Compression no

  # Disable password authentication.
  BatchMode yes

  # Terminate if unable to set up port forwarding.
  ExitOnForwardFailure yes

  # Enable SSH keepalives.
  ServerAliveInterval 30

  # Disconnect after unresponsive SSH keepalives.
  ServerAliveCountMax 3

4. modify /etc/default/sidedoor
# Configuration for sidedoor service

# Arguments to pass to sidedoor, which are in turn passed to ssh.
# See man ssh for possible options.
# For example, uncomment the line below to create a remote port forward
# to the local SSH server (running on port 22, exposed on port 8022).
OPTIONS='-R 12345:localhost:9999'

# Remote SSH server to connect to, i.e., [user@]hostname.
REMOTE_SERVER=myaccount@my.remote.server

5. start up sidedoor service and check sidedoor status
sudo systemctl enable sidedoor.service
sudo systemctl restart sidedoor.service
systemctl status sidedoor.service

How to clean reinstall hassio ?

1. stop services
systemctl stop hassio-supervisor.service
systemctl stop hassio-apparmor.service

2. stop docker container
docker ps #list containers
docker container stop @containerid # remove @containerid with image name start with homeassistant
docker container prune # remove all stopped containers

3. remove docker images
docker images # list all images
docker image remove @imagename # remove @imangename start with homeassistant

4. remove data when install hassio.
# if you install like this 'hassio_install.sh -m raspberrypi3 -d /share/ha_data', remove all data in /share/ha_data
rm -rf /share/ha_data
rm -f /etc/systemd/system/hassio-*

Raspberry PI wifi mac 重啟後一直改變

想把 raspberry pi wifi 連線成固定某個 IP,
當設定好後發現每次重啟 raspberry pi wifi 的 mac 一直改變。

要修正這部份,可以新增一個檔案 "100-disable-wifi-mac-randomization.conf" 至 /etc/NetworkManager/conf.d
內容如下
[connection]
wifi.mac-address-randomization=1
 
[device]
wifi.scan-rand-mac-address=no
可透過以下指令確認 wifi mac 是否還有一直變動
sudo systemctl restart NetworkManager

2020/01/14

網站資料庫 v133

目前所有支援網站: https://goo.gl/jXLsJu

更新紀錄:
版本: 133 - 20200114
+ 新增 '起點' 登入支援
+ '輕小說文庫 [Wenku8]' 新增強制分頁功能
+ 新增 '鯉魚鄉 [腐書網]' 2020y 分類
- 調整 '新筆趣閣', '下書網', '黃金屋中文', '卡提諾小說網 [101novel]', '飛速中文網', '八零電子書' 使用網址
- 調整 '木子書屋' 朗讀問題
- 修正針對 android 4.4 機型載入問題
- 修正'豆豆小說閱讀網'簡介問題
- 再度修正 '全本小說網 [Quanben5]' 內文部份載入問題
- 修正 '4K 文學' 內文載入問題
- 修正 '中網文學' 搜尋問題
- 修正 '卡提諾小說網 [101novel]', '好看小說網' 載入問題
- 修正 'ESJZone' 部份內文載入問題
- 修正 'FC2' 解析以及部份內文載入問題
- 修正 '飛速中文網' 內文載入問題
- 修正 '繁體小說網', '耽美中文網' 搜尋問題

更新方式:
1. 手動更新
a) 設定的網站資料庫
b) 點擊下載
c) 下載檔案 "網站資料庫更新包x_v133.zip"
d) 設定的網站資料庫
e) 匯入

2. 自動更新
a) 設定的網站資料庫
b) 點擊版本

2020/01/12

Ssh port forwarding

操作之前記得先修改 sshd_config 加上
PermitTunnel yes # 允許做 ssh tunnel
GatewayPorts yes # 允許 remote port forwarding

Local Port forwarding (Local to Remote)
ssh -L 1234:192.168.1.1:80 user@example.com 
當使用帳號 user ssh 到 example.com 後,本地端的 port 1234 會對應到遠端 192.168.1.1 的 port 80。
當這個連線保持開啟時,開啟瀏覽器連線至 127.00.1:1234 則會變成連線到 192.168.1.1:80。

Remote Port Forwarding (Remote to Local)
ssh -R 1234:192.168.1.1:80 user@example.com 
當使用帳號 user ssh 到 example.com 後,遠端的 port 1234 會對應到 192.168.1.1 的 port 80。
(192.168.1.1 為本地端的 IP) 這表示當此連線保持開啟時,連線至 example.com:1234 都會直接導至本地端的 port 80。