『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 12649|回复: 11

[教程系列] 万能Siri自定义各种问题答疑,或是实现其它api

[复制链接]

42

主题

523

帖子

2517

积分

金牌会员

Rank: 6Rank: 6

积分
2517
金钱
1989
HASS币
30
发表于 2019-1-31 20:36:53 | 显示全部楼层 |阅读模式
本帖最后由 czweb 于 2019-1-31 20:39 编辑

灵感来源于: https://bbs.hassbian.com/forum.p ... 6245&highlight=siri
把url地址指向node-red,可惜的是在锁屏状态下调用还需解锁

QQ20190131-201258.png QQ20190131-201346.png WechatIMG3.jpeg WechatIMG4.jpeg WechatIMG5.jpeg


[{"id":"af7ec596.7e52f8","type":"tab","label":"Siri测试","disabled":false,"info":""},{"id":"479fc7c1.073258","type":"http in","z":"af7ec596.7e52f8","name":"","url":"/siri","method":"get","upload":false,"swaggerDoc":"","x":120,"y":120,"wires":[["8aa1eeb0.f1814","e384e9d6.4716a8"]]},{"id":"fdaa18f5.e2e108","type":"switch","z":"af7ec596.7e52f8","name":"向Siri提问","property":"payload.cmd","propertyType":"msg","rules":[{"t":"eq","v":"你爸爸是谁","vt":"str"},{"t":"eq","v":"你妈妈是谁","vt":"str"},{"t":"eq","v":"你哥是谁","vt":"str"},{"t":"eq","v":"","vt":"str"},{"t":"eq","v":"","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":6,"x":480,"y":160,"wires":[["2b0b588c.63b768"],["f38931af.8457a"],["6af23390.8f325c"],[],[],["78391c09.993f64"]]},{"id":"8aa1eeb0.f1814","type":"debug","z":"af7ec596.7e52f8","name":"1","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","x":270,"y":60,"wires":[]},{"id":"e384e9d6.4716a8","type":"function","z":"af7ec596.7e52f8","name":"过滤特殊字符","func":"//去掉特殊字符\nfunction filterCode(str){\n    //过滤中英文单双引号以及空格(\\s)\n    var reg = /\\?+|\\?+|\\。+|\\s+/g;\n    var res = str.replace(reg,"");\n    return res;\n}\n\nvar newcmd = filterCode(msg.payload.cmd);\nmsg.payload.cmd = newcmd;\nreturn msg;","outputs":1,"noerr":0,"x":300,"y":140,"wires":[["fdaa18f5.e2e108","a5102b89.a6d3c8"]]},{"id":"75414d1b.1bf534","type":"http response","z":"af7ec596.7e52f8","name":"返回状态","statusCode":"200","headers":{},"x":960,"y":220,"wires":[]},{"id":"2b0b588c.63b768","type":"template","z":"af7ec596.7e52f8","name":"Siri将朗读内容:C大","field":"payload","fieldType":"msg","format":"json","syntax":"plain","template":""C大"","output":"str","x":700,"y":120,"wires":[["75414d1b.1bf534"]]},{"id":"78391c09.993f64","type":"template","z":"af7ec596.7e52f8","name":"Siri将朗读内容:不太明白","field":"payload","fieldType":"msg","format":"json","syntax":"plain","template":""不太明白"","output":"str","x":710,"y":280,"wires":[["75414d1b.1bf534"]]},{"id":"f38931af.8457a","type":"template","z":"af7ec596.7e52f8","name":"Siri将朗读内容:L大","field":"payload","fieldType":"msg","format":"json","syntax":"plain","template":""L大"","output":"str","x":700,"y":160,"wires":[["75414d1b.1bf534"]]},{"id":"6af23390.8f325c","type":"template","z":"af7ec596.7e52f8","name":"Siri将朗读内容:囧大","field":"payload","fieldType":"msg","format":"json","syntax":"plain","template":""囧大"","output":"str","x":700,"y":200,"wires":[[]]},{"id":"a5102b89.a6d3c8","type":"debug","z":"af7ec596.7e52f8","name":"2","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","x":470,"y":60,"wires":[]}]

评分

参与人数 1金钱 +10 收起 理由
+ 10 感谢楼主分享!

查看全部评分

回复

使用道具 举报

27

主题

2143

帖子

8932

积分

论坛元老

Rank: 8Rank: 8

积分
8932
金钱
6784
HASS币
30

论坛元老

发表于 2019-1-31 21:22:24 | 显示全部楼层
本帖最后由 情非殇 于 2019-1-31 21:24 编辑

手机siri感觉很鸡肋(锁屏问题),还是通过AppleWatch或者HomePod感觉比较实在好用一点。貌似AirPods2要有siri功能
回复

使用道具 举报

8

主题

870

帖子

5218

积分

论坛元老

Rank: 8Rank: 8

积分
5218
金钱
4348
HASS币
0
发表于 2019-1-31 22:17:55 | 显示全部楼层
嗯,siri现在还是蛮弱的
回复

使用道具 举报

8

主题

2073

帖子

6053

积分

论坛元老

流水无味

Rank: 8Rank: 8

积分
6053
金钱
3980
HASS币
145

灌水之王

发表于 2019-1-31 23:06:24 | 显示全部楼层
万能安卓党路过
回复

使用道具 举报

123

主题

4661

帖子

1万

积分

管理员

囧死

Rank: 9Rank: 9Rank: 9

积分
16410
金钱
11664
HASS币
45
发表于 2019-2-1 09:49:48 | 显示全部楼层
楼主会玩,有点意思
回复

使用道具 举报

10

主题

680

帖子

5652

积分

论坛元老

Rank: 8Rank: 8

积分
5652
金钱
4967
HASS币
50
发表于 2019-2-1 10:04:43 | 显示全部楼层
为什么囧大低了一辈
回复

使用道具 举报

175

主题

2967

帖子

7606

积分

超级版主

我就是六神

Rank: 8Rank: 8

积分
7606
金钱
4614
HASS币
398

活跃会员教程狂人灌水之王

QQ
发表于 2019-2-1 11:05:14 | 显示全部楼层
情非殇 发表于 2019-1-31 21:22
手机siri感觉很鸡肋(锁屏问题),还是通过AppleWatch或者HomePod感觉比较实在好用一点。貌似AirPods2要有s ...

applewatch的安防类组件还是需要解锁,比如cover lock这类的
回复

使用道具 举报

8

主题

690

帖子

4558

积分

论坛元老

Rank: 8Rank: 8

积分
4558
金钱
3863
HASS币
0
QQ
发表于 2019-2-7 23:06:00 | 显示全部楼层
过来看看
回复

使用道具 举报

10

主题

276

帖子

1190

积分

金牌会员

Rank: 6Rank: 6

积分
1190
金钱
914
HASS币
10
发表于 2019-12-10 09:45:26 | 显示全部楼层
这就是我想要的
回复

使用道具 举报

24

主题

608

帖子

3488

积分

元老级技术达人

积分
3488
金钱
2875
HASS币
0

卓越贡献

发表于 2019-12-10 10:55:55 来自手机 | 显示全部楼层
牛逼,感谢分享。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-25 22:18 , Processed in 0.154291 second(s), 37 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表