请选择 进入手机版 | 继续访问电脑版

『瀚思彼岸』» 智能家居第一站

 找回密码
 立即注册
查看: 406|回复: 7

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

[复制链接]

35

主题

424

帖子

1874

积分

金牌会员

Rank: 6Rank: 6

积分
1874
金钱
1445
HASS币
20
发表于 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


[AppleScript] 纯文本查看 复制代码
[{"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 收起 理由
Jones + 10 感谢楼主分享!

查看全部评分

回复

使用道具 举报

9

主题

580

帖子

2117

积分

金牌会员

Rank: 6Rank: 6

积分
2117
金钱
1537
HASS币
0
发表于 2019-1-31 21:22:24 | 显示全部楼层
本帖最后由 情非殇 于 2019-1-31 21:24 编辑

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

使用道具 举报

6

主题

557

帖子

1883

积分

金牌会员

Rank: 6Rank: 6

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

使用道具 举报

5

主题

1066

帖子

3105

积分

论坛元老

流水无味

Rank: 8Rank: 8

积分
3105
金钱
2039
HASS币
145

灌水之王

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

使用道具 举报

98

主题

3113

帖子

1万

积分

管理员

囧死

Rank: 9Rank: 9Rank: 9

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

使用道具 举报

6

主题

324

帖子

1884

积分

金牌会员

Rank: 6Rank: 6

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

使用道具 举报

114

主题

1537

帖子

2922

积分

金牌会员

我就是六神

Rank: 6Rank: 6

积分
2922
金钱
1385
HASS币
258

活跃会员灌水之王

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

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

使用道具 举报

3

主题

332

帖子

1150

积分

金牌会员

Rank: 6Rank: 6

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

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2019-4-20 13:01 , Processed in 0.496695 second(s), 41 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

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