<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Zain’s Blog</title>
        <link>https://blog.izain.cn</link>
        <description>keep your mind</description>
        <lastBuildDate>Mon, 09 Nov 2026 11:05:51 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>zh-CN</language>
        <copyright>All rights reserved 2026, Zain</copyright>
        <item>
            <title><![CDATA[Yeelight 吸顶灯【凌动开关】怎么开：从抓包到接入 Home Assistant]]></title>
            <link>https://blog.izain.cn/yeelight-momentary-switch</link>
            <guid>https://blog.izain.cn/yeelight-momentary-switch</guid>
            <pubDate>Sun, 08 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[办法总比困难多～]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-4128eb6c92a58035ae4af802b6ce071f"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><blockquote class="notion-quote notion-block-4128eb6c92a580969cf2e7dff9d2710b"><div>说明：这是一篇可对外分享的独立复盘。家里实际配置的权威记录在 <a class="notion-link" href="https://app.notion.com/p/zaingg/%E7%81%AF%E5%85%89%E6%B8%85%E5%8D%95.md" target="_blank" rel="noopener noreferrer">灯光清单.md</a>，本文只讲方法和结论，示例中的设备 ID、token 都是占位符。</div></blockquote><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-4128eb6c92a58084a4c2d83a199eace7" data-id="4128eb6c92a58084a4c2d83a199eace7"><span><div id="4128eb6c92a58084a4c2d83a199eace7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4128eb6c92a58084a4c2d83a199eace7" title="1. 问题"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">1. 问题</span></span></h3><div class="notion-text notion-block-4128eb6c92a580529310ead58a8dc690">两台 Yeelight 吸顶灯（皎月 480 升级版 <code class="notion-inline-code">yeelink.light.ceiling15</code>）装了凌动开关面板，但：</div><ul class="notion-list notion-list-disc notion-block-4128eb6c92a580e5bc5ad4d2cc91e388"><li>米家 App 里找不到「凌动开关」选项</li></ul><ul class="notion-list notion-list-disc notion-block-4128eb6c92a580fbbd66f320e22214fb"><li>切到「默认样式 → 传统样式」也没有</li></ul><ul class="notion-list notion-list-disc notion-block-4128eb6c92a58082a319c6142111bf71"><li>只有 Yeelight 自己的 App 能开</li></ul><div class="notion-text notion-block-4128eb6c92a58035b1ddd5cab6c2b66a">灯本身是支持凌动的，问题只出在米家这边不显示入口。</div><div class="notion-text notion-block-4128eb6c92a58094b154fbf357c37df2">于是有两个担心：</div><ol start="1" class="notion-list notion-list-numbered notion-block-4128eb6c92a5800d891cd891453b6800" style="list-style-type:decimal"><li>米家为什么不显示？是不是不支持？</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-4128eb6c92a58068bcfbc70a48ce66bc" style="list-style-type:decimal"><li>万一 Yeelight App 哪天用不了，凌动还能不能开？</li></ol><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-4128eb6c92a58037ac1fe40be39c9e6b" data-id="4128eb6c92a58037ac1fe40be39c9e6b"><span><div id="4128eb6c92a58037ac1fe40be39c9e6b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4128eb6c92a58037ac1fe40be39c9e6b" title="2. 先给结论"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2. 先给结论</span></span></h3><table class="notion-simple-table notion-block-4128eb6c92a5807b84fccdcf0f45a68f"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-4128eb6c92a580f0b241c531dec67b14"><td class="" style="width:120px"><div class="notion-simple-table-cell">结论</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">说明</div></td></tr><tr class="notion-simple-table-row notion-block-4128eb6c92a580e5b127e81d751e8f92"><td class="" style="width:120px"><div class="notion-simple-table-cell">灯是支持的</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">皎月 480<b>升级版</b>（<code class="notion-inline-code">yeelink.light.ceiling15</code>）支持凌动，更老的初代皎月（<code class="notion-inline-code">ceiling3</code> / <code class="notion-inline-code">ceiling4</code>）不支持</div></td></tr><tr class="notion-simple-table-row notion-block-4128eb6c92a58055a123c27c4c49b558"><td class="" style="width:120px"><div class="notion-simple-table-cell">米家不显示 ≠ 不支持</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">凌动是米家<b>老 miIO 属性</b> <code class="notion-inline-code">smart_switch</code>，不在 MiOT spec 里；米家插件没渲染这个入口，但属性本身存在且可写</div></td></tr><tr class="notion-simple-table-row notion-block-4128eb6c92a580bda009fbd46bb6686e"><td class="" style="width:120px"><div class="notion-simple-table-cell">写入方式是 <code class="notion-inline-code">set_ps</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">set_ps [&quot;cfg_smart_switch&quot;, &quot;1&quot;]</code>，<code class="notion-inline-code">1</code> 开、<code class="notion-inline-code">0</code> 关</div></td></tr><tr class="notion-simple-table-row notion-block-4128eb6c92a580a893c3fb3e0130161a"><td class="" style="width:120px"><div class="notion-simple-table-cell">走小米开放网关</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">POST &lt;https://openapp.io.mi.com/openapp/device/rpc/&gt;&lt;did&gt;</code>，不是 Yeelight 自家云</div></td></tr><tr class="notion-simple-table-row notion-block-4128eb6c92a58043883ac08018507d12"><td class="" style="width:120px"><div class="notion-simple-table-cell">可以完全脱离 App</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">用 Home Assistant 里 <code class="notion-inline-code">xiaomi_home</code> 的 token 就能调这个网关</div></td></tr></tbody></table><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-4128eb6c92a58095adf2e1e7366e3e9a" data-id="4128eb6c92a58095adf2e1e7366e3e9a"><span><div id="4128eb6c92a58095adf2e1e7366e3e9a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4128eb6c92a58095adf2e1e7366e3e9a" title="3. 本次用的通道"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3. 本次用的通道</span></span></h3><table class="notion-simple-table notion-block-4128eb6c92a58024ad40ee6626dd0ce2"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-4128eb6c92a580e1b0ddeaf8af987ccc"><td class="" style="width:120px"><div class="notion-simple-table-cell">通道</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">需要什么</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">重置后还能用</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">副作用</div></td></tr><tr class="notion-simple-table-row notion-block-4128eb6c92a58027b98ffdb863f44109"><td class="" style="width:120px"><div class="notion-simple-table-cell">小米 openapp 云接口</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">任意已登录的小米系客户端 token</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>能</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">无</div></td></tr></tbody></table><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-4128eb6c92a5808cbb72cb07bbdcd41b" data-id="4128eb6c92a5808cbb72cb07bbdcd41b"><span><div id="4128eb6c92a5808cbb72cb07bbdcd41b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4128eb6c92a5808cbb72cb07bbdcd41b" title="4. 怎么抓到的"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4. 怎么抓到的</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-4128eb6c92a58087bbbec7dabb68de15" data-id="4128eb6c92a58087bbbec7dabb68de15"><span><div id="4128eb6c92a58087bbbec7dabb68de15" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4128eb6c92a58087bbbec7dabb68de15" title="4.1 环境"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4.1 环境</span></span></h4><ul class="notion-list notion-list-disc notion-block-4128eb6c92a580dfa2e1ead0ab5c27b3"><li>macOS + MuMu 模拟器（Android 12）</li></ul><ul class="notion-list notion-list-disc notion-block-4128eb6c92a580cbb3cecb2ee6ae8555"><li>安装 Yeelight App，用米家账号登录</li></ul><ul class="notion-list notion-list-disc notion-block-4128eb6c92a5809191ade839a75ff541"><li>Proxyman 做代理，模拟器 Wi-Fi 代理指向本机 <code class="notion-inline-code">9090</code></li></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-4128eb6c92a5802c8619c1fd866a70fa" data-id="4128eb6c92a5802c8619c1fd866a70fa"><span><div id="4128eb6c92a5802c8619c1fd866a70fa" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4128eb6c92a5802c8619c1fd866a70fa" title="4.2 证书这步最容易卡住"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4.2 证书这步最容易卡住</span></span></h4><div class="notion-text notion-block-4128eb6c92a58077a335ed3aa1d94b3f">Android 12 的「设置 → 安全」里如果只剩「安全状态 / SIM 卡锁定」，说明 ROM 把「加密与凭据」入口裁掉了，常规的「安装 CA 证书」根本走不到。</div><div class="notion-text notion-block-4128eb6c92a580369a4fd46c7a396f86">可行的做法是给模拟器 root，把证书塞进系统证书目录。但 <code class="notion-inline-code">/system</code> 是只读的，<code class="notion-inline-code">mount -o rw,remount</code> 会直接报 <code class="notion-inline-code">&#x27;/dev/block/sda1&#x27; is read-only</code>，所以改用 <b>bind mount</b>：</div><div class="notion-text notion-block-4128eb6c92a5801cb8f1e0de68b59cc4"><code class="notion-inline-code">mount --bind</code> 挂在重启后失效，需要重做；这也算一种安全的默认行为。</div><div class="notion-text notion-block-4128eb6c92a58028b3a7eacfe0c151e3">MuMu 开 root 可以用它的 CLI，不用点界面：</div><div class="notion-text notion-block-4128eb6c92a58036b9b8ee6301ff5280">重启后 adb 端口可能变（16384 → 16385），要重新 <code class="notion-inline-code">adb connect</code>。</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-4128eb6c92a580c09e8fd73433a9c0b4" data-id="4128eb6c92a580c09e8fd73433a9c0b4"><span><div id="4128eb6c92a580c09e8fd73433a9c0b4" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4128eb6c92a580c09e8fd73433a9c0b4" title="4.3 抓到的请求"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4.3 抓到的请求</span></span></h4><div class="notion-text notion-block-4128eb6c92a5807da7cddb025457fb46">在 App 里把开关拨一次，Proxyman 里能看到两条几乎一样的请求：</div><div class="notion-text notion-block-4128eb6c92a580b0b372ea547175e26b">响应是 base64 的 JSON：</div><div class="notion-text notion-block-4128eb6c92a580b68b96c8c6f6a21969">读状态用批量接口：</div><div class="notion-text notion-block-4128eb6c92a580aab784ef16457d93b4">属性顺序要和请求里的 <code class="notion-inline-code">params</code> 对应，返回值是数组。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-4128eb6c92a580df876cff5e91e04eff" data-id="4128eb6c92a580df876cff5e91e04eff"><span><div id="4128eb6c92a580df876cff5e91e04eff" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4128eb6c92a580df876cff5e91e04eff" title="5. 用 Home Assistant 当客户端"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5. 用 Home Assistant 当客户端</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-4128eb6c92a580b1b8f0f485f95aad0f" data-id="4128eb6c92a580b1b8f0f485f95aad0f"><span><div id="4128eb6c92a580b1b8f0f485f95aad0f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4128eb6c92a580b1b8f0f485f95aad0f" title="5.1 关键发现"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5.1 关键发现</span></span></h4><div class="notion-text notion-block-4128eb6c92a580f79215ca99cbcee9ba"><code class="notion-inline-code">openapp.io.mi.com</code> <b>不校验 </b><code class="notion-inline-code"><b>macKey</b></code>：随便填一个 27 位字符串也能通过，只认 <code class="notion-inline-code">clientId + accessToken</code>。</div><div class="notion-text notion-block-4128eb6c92a5809f8a47e053b8cf16f4">而 <code class="notion-inline-code">xiaomi_home</code> 集成本身就是小米官方客户端，它的 token 存在：</div><div class="notion-text notion-block-4128eb6c92a580f0be06da69c1ccf3a2">文件是「JSON + 末尾 32 字节二进制」的混合格式，解析时要截断。HA 会自动续期（<code class="notion-inline-code">expires_in</code> 约 43 分钟），所以每次运行现读即可，不硬编码。</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-4128eb6c92a5807e9b8df6e06bf33380" data-id="4128eb6c92a5807e9b8df6e06bf33380"><span><div id="4128eb6c92a5807e9b8df6e06bf33380" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4128eb6c92a5807e9b8df6e06bf33380" title="5.2 脚本"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5.2 脚本</span></span></h4><div class="notion-text notion-block-4128eb6c92a58082ab65c7e7ee4f5c16">保存为 <code class="notion-inline-code">/config/scripts/flex_switch.py</code>：</div><div class="notion-text notion-block-4128eb6c92a58099b856f0af2c35818b"><code class="notion-inline-code">clientId</code> 从 <code class="notion-inline-code">xiaomi_home/miot/const.py</code> 的 <code class="notion-inline-code">OAUTH2_CLIENT_ID</code> 取。</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-4128eb6c92a580d9b69df1aa08ac67b9" data-id="4128eb6c92a580d9b69df1aa08ac67b9"><span><div id="4128eb6c92a580d9b69df1aa08ac67b9" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4128eb6c92a580d9b69df1aa08ac67b9" title="5.3 变成 HA 开关"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5.3 变成 HA 开关</span></span></h4><div class="notion-text notion-block-4128eb6c92a580078449e468c5a87586"><code class="notion-inline-code">configuration.yaml</code>：</div><div class="notion-text notion-block-4128eb6c92a5804cb412e32f91111fa0"><code class="notion-inline-code">automations.yaml</code> 加一条，解决 HA 启动后状态不准：</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-4128eb6c92a580d1882dee624684fccb" data-id="4128eb6c92a580d1882dee624684fccb"><span><div id="4128eb6c92a580d1882dee624684fccb" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4128eb6c92a580d1882dee624684fccb" title="6. 踩过的坑"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">6. 踩过的坑</span></span></h3><table class="notion-simple-table notion-block-4128eb6c92a58082a856fd9124586de8"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-4128eb6c92a5806d80e1ffd031c23782"><td class="" style="width:120px"><div class="notion-simple-table-cell">坑</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">现象</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">处理</div></td></tr><tr class="notion-simple-table-row notion-block-4128eb6c92a580f98978e65880c76a45"><td class="" style="width:120px"><div class="notion-simple-table-cell">Android 12 无「加密与凭据」</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">设置里只有安全状态、SIM 卡锁定</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">root + bind mount 系统证书目录</div></td></tr><tr class="notion-simple-table-row notion-block-4128eb6c92a580e28086ec2f2bd31a0c"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">/system</code> 无法 remount</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">&#x27;/dev/block/sda1&#x27; is read-only</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">不要硬改，用 <code class="notion-inline-code">mount --bind</code></div></td></tr><tr class="notion-simple-table-row notion-block-4128eb6c92a580aaa3b2ceac0debec45"><td class="" style="width:120px"><div class="notion-simple-table-cell">代理设置重启丢失</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">settings get global http_proxy</code> 为 null</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">用 <code class="notion-inline-code">settings put global</code> 重设</div></td></tr><tr class="notion-simple-table-row notion-block-4128eb6c92a580db8da6cad82c06e2e1"><td class="" style="width:120px"><div class="notion-simple-table-cell">模拟器 adb 端口变化</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">device not found</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">重启后看 <code class="notion-inline-code">lsof</code> 或重新 <code class="notion-inline-code">adb connect</code></div></td></tr><tr class="notion-simple-table-row notion-block-4128eb6c92a580c7bc68f027bddd303f"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">value_template</code> 永远不成立</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">实体一直显示 off</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">脚本输出带换行，用 <code class="notion-inline-code">{{ value | trim == &#x27;1&#x27; }}</code></div></td></tr><tr class="notion-simple-table-row notion-block-4128eb6c92a58006affeffa45dc60e43"><td class="" style="width:120px"><div class="notion-simple-table-cell">重启后状态是 off</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">要等一个轮询周期才准</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">加 <code class="notion-inline-code">homeassistant start</code> 触发 <code class="notion-inline-code">update_entity</code> 的自动化</div></td></tr></tbody></table><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-4128eb6c92a58077914fc4780a134425" data-id="4128eb6c92a58077914fc4780a134425"><span><div id="4128eb6c92a58077914fc4780a134425" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4128eb6c92a58077914fc4780a134425" title="7. 边界与风险"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">7. 边界与风险</span></span></h3><ul class="notion-list notion-list-disc notion-block-4128eb6c92a580bab71edcc76734dfc6"><li><b>token 敏感</b>：<code class="notion-inline-code">accessToken</code> 等价于账号在小米云上的操作凭证；截图、抓包文件（HAR）用完即删，不要贴进文章或仓库。</li></ul><ul class="notion-list notion-list-disc notion-block-4128eb6c92a580fabc38d04b6e109647"><li><b>云接口是叠加不是替换</b>：<code class="notion-inline-code">openapp</code> 是米家 App 自己在用的通道，短期不会下线；但 Yeelight App/模拟器仍建议保留一份做兜底。</li></ul><ul class="notion-list notion-list-disc notion-block-4128eb6c92a58004b974d3e4669e0866"><li><b>设备重置会做什么</b>：<code class="notion-inline-code">smart_switch</code> 回默认。只要设备重新绑回同一个米家账号，云接口方案照常可用，不需要重装 App。</li></ul><ul class="notion-list notion-list-disc notion-block-4128eb6c92a580b09585cd7cc34aad53"><li><b>不适用于</b>：没有实现这个属性的灯具（比如只走蓝牙 Mesh 的筒灯），本方案无效。</li></ul><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-4128eb6c92a580878ff7e3dc911a8324" data-id="4128eb6c92a580878ff7e3dc911a8324"><span><div id="4128eb6c92a580878ff7e3dc911a8324" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4128eb6c92a580878ff7e3dc911a8324" title="8. 一句话总结"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">8. 一句话总结</span></span></h3><div class="notion-text notion-block-4128eb6c92a58078affec18c2050a54c">「米家看不到凌动开关」不是灯不支持，而是新版插件不渲染 miIO 老属性；真正的开关是 <code class="notion-inline-code">smart_switch</code>，用 <code class="notion-inline-code">set_ps</code> 写。拿到任意小米系客户端的 token 就能远程设它——包括 Home Assistant 自己的 <code class="notion-inline-code">xiaomi_home</code>，于是这件事就从「必须依赖某个旧 App」变成了「HA 里的开关」。</div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[解决钉钉在Clash启动后页面加载慢]]></title>
            <link>https://blog.izain.cn/dingtalk-load-slow-with-clash</link>
            <guid>https://blog.izain.cn/dingtalk-load-slow-with-clash</guid>
            <pubDate>Wed, 24 Apr 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[用开源的东西，应该考虑针对国情做一下适配。]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-d23debfdd43e4269a03ea05e2940ee81"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-text notion-block-13ea8eb519404a25a977fdd5af6bf1bd">macOS 版本的钉钉是我日常工作的协同工具，但是有一个毛病，在启动 clash 之后，钉钉中的某些页面加载的特别慢。完全关闭clash之后，就不会有这样的问题，为此我查看了一下 log 日志。</div><div class="notion-text notion-block-44b00be7e87f472c80713cc77d862ad1">发现一个叫做 <code class="notion-inline-code">Dt WebView Helper</code> 的进程，一直在请求<code class="notion-inline-code">https://dns.google</code>；这可以说明钉钉 webview 使用了 Google 的 DOH 作为 dns ，如果直连，由于被🧱会拒绝连接，然后默认走本地dns，网页打开很快，反而开启clash后，由于在gfw中，会走代理，可以访问，返回了国外ip，反而会导致网页打开特别慢，问题定位到了，就好解决，我们直接加上一个规则</div><div class="notion-text notion-block-d4d04c0a597941c789dbaca97c10f59a">让钉钉的 webview 直接走 <code class="notion-inline-code">DIRECT</code> ，这样就可以继续让由 <code class="notion-inline-code">Dt WebView Helper</code> 发起到 dns.google的请求拒绝连接，快速打开钉钉中的html页面。又不影响其他软件访问 <code class="notion-inline-code">https://dns.google</code> 。</div><div class="notion-blank notion-block-33a2b560500643449c6c5ef4741b21d1"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Emby 阿里云盘直链]]></title>
            <link>https://blog.izain.cn/emby-direct-play</link>
            <guid>https://blog.izain.cn/emby-direct-play</guid>
            <pubDate>Wed, 10 Apr 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[使用到 nginx 做 302 跳转，即可直连 alist、iptv 等等，达到不走 emby 服务器流量，不受上传带宽限制的效果。]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-e5992edbdf7b4a0886e74e7d7a7669a5"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-text notion-block-7fe96a1906c346aea814e4ebcd7dfa87">原理：使用到 nginx 做 302 跳转，即可直连 alist、iptv 等等，达到不走 emby 服务器流量，不受上传带宽限制的效果。</div><ul class="notion-list notion-list-disc notion-block-7bd136c7447e4ed299abf23d2bd874b8"><li>已适配 alist v3版本接口</li></ul><div class="notion-text notion-block-977cf831671f4081b6b378a197e430c7">相关文件地址：<a class="notion-link" href="https://github.com/psychopasss/emby302/" target="_blank" rel="noopener noreferrer">https://github.com/psychopasss/emby302/</a></div><ol start="1" class="notion-list notion-list-numbered notion-block-212b1cadd8ff4f43a8ecfb0334447dfa" style="list-style-type:decimal"><li>分别更改emby.conf、emby.js文件中的配置，有注释请自己查看。</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-aa7cb0fcf8484396a9334190d87b7c64" style="list-style-type:decimal"><li>在 docker-compose.yaml 文件同级目录，使用 <code class="notion-inline-code">docker-compose up -d</code>命令启动；</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-a1bc6b55ae564ca08d1d628ebcbd0b56" style="list-style-type:decimal"><li>访问你之前的emby服务地址，把端口改成8088，即可使用nginx代理的emby服务。</li></ol><div class="notion-blank notion-block-55569acae54a4172ad1fce58f6198071"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[macOS Emby 客户端破解]]></title>
            <link>https://blog.izain.cn/macos-emby-unlock</link>
            <guid>https://blog.izain.cn/macos-emby-unlock</guid>
            <pubDate>Tue, 15 Jun 2021 00:00:00 GMT</pubDate>
            <description><![CDATA[之前找的失效了，自己改了下。]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-7c7abcc3d719423aaf3fb8e04a394b9d"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-callout notion-red_background_co notion-block-c836525764954df4bfd161aafae84ccb"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="🤣">🤣</span></div><div class="notion-callout-text">iOS版本的emby，我是付费解锁的，但是macOS上只能恢复购买，而且还不成功，才出此下策，不然不能用啊，仅用于学术研究，如有侵权，联系我删除。<div class="notion-text notion-block-09d6fc8bd0c245aabf93666c732a98b2">版本更新之后，需要重新运行以上脚本。版本更新后，可能会导致脚本失效，请留言通知我。</div><div class="notion-text notion-block-d532d581a3ee471e92174fccbb25fda4">目前 Emby Client 版本 &lt;= 2.2.33 版本都支持解锁。</div></div></div><div class="notion-text notion-block-1b925c902df141c3b815eb44e2309b62">之前网上的流传的脚本，在最新的Emby版本上，已经不能使用了，看了下脚本内容，发现很简单，就是替换一段 js 代码，现在最新版本这部分 js 代码已经更改了，我稍微修改了下，发现可以正常解锁了，下面贴上地址。</div><div class="notion-blank notion-block-1fe8eb6c92a5800db307e955a2e0da74"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[deathscrolling]]></title>
            <link>https://blog.izain.cn/deathscrolling</link>
            <guid>https://blog.izain.cn/deathscrolling</guid>
            <pubDate>Tue, 16 May 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[what is deathscrolling？]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-a396837d86a44b22b1922139114103d3"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-text notion-block-405f3e6a21b64fdc8ff2e11f037fb217">The habit of getting stuck scrolling through an endless social media feed and no longer have the willpower to stop consuming content until you are exhausted. Similar to being in a death spiral.</div><div class="notion-text notion-block-c7bbadbdfd1b4fc0944d1e90b98f227b">习惯性的刷着没完没了的社交媒体，没有毅力停止消费内容，直到你筋疲力尽为止，就好像陷入了死亡漩涡。</div><div class="notion-text notion-block-b794a40d5c244ed787cf0556b08e5567">Symptoms include irritability, absent mindedness, selective hearing, tunnel vision, and a mind that has given up or given in to temptation.</div><div class="notion-text notion-block-fa085657a39e4c5da300c88d943d188b">症状包括易怒、健忘、选择性听觉、视野狭窄、容易放弃或屈服于诱惑。</div><div class="notion-text notion-block-469cd8d37a1c4c989753b43557860262">Is often caused by a desire to escape, or a desire for quick and easy pleasure.</div><div class="notion-text notion-block-9a7c6b05a4574b939605ca1bba973337">这种现象往往是由于想要逃避，或想要快速而轻松地获得快乐而引起的。</div><div class="notion-text notion-block-f8db0ec8796f41ae8a0e91cbd86bc23e">Often results in guilt, regret, and time purely wasted.</div><div class="notion-text notion-block-e391339107164702a1ca1b1909801545">这往往导致内疚、后悔和纯粹浪费了时间。</div><div class="notion-text notion-block-ee44e04a730b42fa9e391577a65320d1"><em>I can&#x27;t stop deathscrolling till </em><em><b>3am</b></em><em> when I just need to get some sleep!
</em><em><b>You need to stop</b></em><em> deathscrolling and be </em><em><b>present</b></em><em> dude</em></div><div class="notion-text notion-block-a88e9887d9ba466d977098bf29afa209">当我需要睡觉的时候，我无法停止死亡滚动直到凌晨3点!
朋友，你不能再继续死亡滚动了，我们要活在当下。</div><div class="notion-text notion-block-7b3d0fcf265648ecb75fb1b0a757e70b"><b>by Raergur November 11, 2020</b></div><div class="notion-text notion-block-61bbf74274464d018c5edfafd35e2e17"><b>Raergur </b>写于 2020年11月11号</div><div class="notion-blank notion-block-b3238c6967da4a0d807105a974e9e488"> </div><div class="notion-text notion-block-4ac3540940ce4229beae1b411b877c48">via <a class="notion-link" href="https://www.urbandictionary.com/define.php?term=deathscrolling" target="_blank" rel="noopener noreferrer">https://www.urbandictionary.com/define.php?term=deathscrolling</a></div><div class="notion-blank notion-block-5369b5049cae4c32b06226bb15dbd8f8"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[vscode 是否有保留的必要]]></title>
            <link>https://blog.izain.cn/vs-code</link>
            <guid>https://blog.izain.cn/vs-code</guid>
            <pubDate>Mon, 20 Jul 2020 00:00:00 GMT</pubDate>
            <description><![CDATA[经过了下了删，删了下，最终在我心目中 vscode 的定位]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-072e7b830166467e8c0c866ec104bc5c"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-text notion-block-4d0c53fa4b9a49a3b4de520f01022941">2022-08-24 更新：</div><div class="notion-text notion-block-5bed3551f9b04b43a9be4171b6a68623">vscode终于在我电脑上稳固下来了，sublime正式被卸载，原因主要是因为300MB的日志文件sublime卡的不行，vscode还可以顶得住，当然也缺少了部分功能，不过能看是最主要的，vscode文件夹管理也不错，用来做工作内容记录挺好，编辑器自带的代码格式化，是一个比notion优秀、很重要的点。搭配上群晖的drive同步，解决了家里公司两地同步问题，用起来还是比较舒服的。</div><hr class="notion-hr notion-block-0c8a8ef603c74cab83bd3dc5ccf99eae"/><div class="notion-text notion-block-db26dacc618a462685eaec7903debbdd">说实话，我一直不太喜欢vscode，作为文本编辑器，它没有sublime快，简单。
作为IDE，它没有WebStorm、IDEA好用。
一直找不到它在我电脑上的定位，每次都是下了又删。</div><div class="notion-blank notion-block-ee2db0c9f8f2475fa02b1a752941fe50"> </div></main></div>]]></content:encoded>
        </item>
    </channel>
</rss>