我这个360摄像机用了很久了,大概是最早的一批用户,经历了水滴直播从无到有再到关闭的风风雨雨。
360摄像机不像传统摄像头厂商的产品有开放 rtsp,也没有破解的固件可以刷,只能使用官方 app。可以预见的将来也不会开放,完全没有希望接入 Home Assistant 。
使用 Weblink 组件接入 URL Scheme
这里提供一个曲线救国的方法,使用 Weblink 组件通过 URL Scheme 打开 app,算是抛砖引玉。
Weblink 组件只支持 http 和 https 协议的链接,直接使用 URL Scheme 会出错,所以通过 html 网页进行中转。
weblink: entities: - name: 360 Camera url: /local/360_camera.html icon: mdi:webcam
360_camera.html 放在 www 文件夹中,html 代码如下:
<head> <meta http-equiv="refresh" content="0;url=shuidilive://view"> </head>
点击上图中的链接,会跳转到 360 摄像机的 app。不同浏览器略有不同,可能会有“是否打开”的提示,推荐使用 Chrome。Android 和 iOS 都是支持 URL Scheme 的。
录了一个小视频作为演示,戳这里查看。
如何确定 URL Scheme
如果不知道 app 的 URL Scheme,就只能自己动手解决了。这里主要针对 Android,iOS 就不说了,不是很熟悉。
首先反编译 apk 安装包, 然后打开 AndroidManifest.xml,查找以下黄色背景的代码。
例1,小蚁摄像机
<intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.BROWSABLE"/> <data android:scheme="ants"/> </intent-filter>
例2,360摄像机
<intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.BROWSABLE"/> <data android:host="view" android:scheme="shuidilive"/> </intent-filter>
最后自行领悟一下。
PS
URL Scheme 在 Home Assistant 中还有其他用途。
举个具体的例子,我家中客厅只有 360 摄像机,通过人体传感器布防,如果检测到有人,通过 IFTTT 发送带 URL Scheme 链接的通知到手机,点击通知直接打开 360 摄像机 app 查看家中情况。