Node Red使用小爱TTS 自动播报 图文教程

以下分享是群里各位大佬耐心指导下完成的!!!!

家里新装房子,浴缸在2楼,本来主卧也放在2楼,但是每天爬楼梯好累,就搬到1楼住了。
所以泡澡不知道水满没有,一直去看是很累的,现在看了这个,就会让你很轻松了!

需要设备:
1.一台可以运行node red的机器,各种NAS和PI,这个略过。
2.米家多功能网关+水浸传感器。(PS:如果新装房子还未竣工,可以考虑使用两个电磁水阀,接混水阀的冷热水,配合恒温龙头,水位达到指定位置可以自动关水。)

实现流程:
1.安装Node Red。额,这个自己找找教程吧,我的是群辉Docker安装的。
2.安装xiaoai TTS节点,在节点管理,安装里面搜索xiaoai,选择下面图片的节点


安装成功左边会多这两个东西。
4
3.测试小爱节点是否成功接入,成功接入会有成功获取某某设备的提示。
2
点那支笔
3
输入自己的用户名和密码
这是测试流程,选择中间的设备列表,把你自己的账号密码填进去,填好以后记得要保存和更新。

点击部署,然后点时间戳,就会成功获取设备。
这是测试节点:

[{"id":"975cbf2e.40c2b","type":"tab","label":"流程3","disabled":false,"info":""},{"id":"360e8ef9.c82a12","type":"inject","z":"975cbf2e.40c2b","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":80,"wires":[["3f0d481d.c38ee8"]]},{"id":"3f0d481d.c38ee8","type":"xiaoai-devices","z":"975cbf2e.40c2b","name":"小爱音箱","xiaoai":"dbd3bf2b.a4321","x":260,"y":80,"wires":[["625b7b69.5004e4"]]},{"id":"625b7b69.5004e4","type":"debug","z":"975cbf2e.40c2b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":430,"y":80,"wires":[]},{"id":"dbd3bf2b.a4321","type":"xiaoai-tts-configurator","z":"","name":"小爱音箱","username":"yourname","password":"yourpassword"}]

4.通过米家多功能网关将水浸传感器接入node red。我是安装了HA然后安装HA的插件接入的,不知道还有没有其他方法。
5.填写水浸传感器状态变为on,即浸水状态,小爱语音TTS播报洗澡水放好的信息。这是洗澡水OK的节点

[{"id":"fc787aaa.53e298","type":"tab","label":"浴缸OK","disabled":false,"info":""},{"id":"da0c0cc0.6912a","type":"server-state-changed","z":"fc787aaa.53e298","name":"水浸传感器","server":"1bfd4f2a.a1d621","version":1,"entityidfilter":"binary_sensor.water_leak_sensor_158d000343da4a","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":80,"y":60,"wires":[["c87026ff.a3bf28"],[]]},{"id":"c87026ff.a3bf28","type":"xiaoai-tts","z":"fc787aaa.53e298","name":"洗澡水OK播报","xiaoai":"dbd3bf2b.a4321","tts":"主人你的洗澡水已经放好了,请您准备沐浴了哦!","device":"","x":280,"y":60,"wires":[["cb822dc8.ca009"],[]]},{"id":"cb822dc8.ca009","type":"debug","z":"fc787aaa.53e298","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":490,"y":60,"wires":[]},{"id":"1bfd4f2a.a1d621","type":"server","z":"","name":"black","legacy":false,"hassio":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true},{"id":"dbd3bf2b.a4321","type":"xiaoai-tts-configurator","z":"","name":"小爱音箱","username":"yourname","password":"yourpassword"}]

对了,要把节点的用户密码改为你的才能用,另外,把用于浴缸的水浸传感器联动报警关闭,不然每次网关都会警铃大作,很煞风景的!
7.jpg

感谢群友分享,学习