树莓派+HomeAssistant打造智能语音管家

采用github大佬的开源智能语音交互使用hass插件通过mqtt控制esp8266设备
本人小白会以小白的方式一步一步进行
首先先到github上安装叮当 手动还是 镜像自己选择
硬件设备:树莓派、esp8266继电器模块、seeed raspberry pi 双麦克风扩展板、usb音响、吸顶灯、32g内存卡、读卡器
安装中遇到的问题在常见问题中自助
还有一点就是内存卡尽量选择16g以上质量稍微好点的不然很可能会出现一些奇奇怪怪的问题
安装好后先测试一下麦克风可音响是否都正常工作了具体看其中的 “配置”
安装完成可以正常工作后 开始安装homeassistant
简单粗暴 sudo pip3 install homeassistant
完成后 hass
过程有点慢静静等待 我在安装过程中老是会卡在一个地方(check your config什么的)我不知道为什么 需要终止掉重新hass才可以继续请知道的大佬告知
安装完成后打开网页输入xxx.xxx.xxx.xxx:8123 访问homeassistant
出现类似这个画面就算是安装成功了
接下来要做的就是要搭建mqtt
先来安装mosquito
wget http://mosquitto.org/files/source/mosquitto-1.5.tar.gz
解压
tar zxfv mosquitto-1.5.tar.gz
进入目录
cdmosquitto-1.5
编译
make
安装
sudo make install
安装后打开服务
sudo systemctl start mosquitto
之后开始配置hass你可以选择两种方式1是直接wincp打开.homeassistant文件夹中的configuration.yaml开搞2.通过建立samba服务来编辑
homeassistant: # name of the location where home assistant is running name: home # location required to calculate the time the sun rises and sets latitude: 34.6836 longitude: 113.5325 # impacts weather/sunrise data (altitude above sea level in meters) elevation: 0 # metric for metric, imperial for imperial unit_system: metric # pick yours from here: http://en.wikipedia.org/wiki/list_of_tz_database_time_zones time_zone: asia/shanghai # customization file customize: !include customize.yaml# show links to resources in log and frontendintroduction:# enables the frontendfrontend:# enables configuration uiconfig:http: # secrets are defined in the file secrets.yaml # api_password: !secret http_password # uncomment this if you are using ssl/tls, running in docker container, etc. # base_url: example.duckdns.org:8123# checks for available updates# note: this component will send some information about your system to# the developers to assist with development of home assistant.# for more information, please see:# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/updater: # optional, allows home assistant developers to focus on popular components. # include_used_components: true# discover some devices automaticallydiscovery: # allows you to issue voice commands from the frontend in enabled browsersconversation:# enables support for tracking state changes over timehistory:# view all events in a logbooklogbook:# enables a map showing the location of tracked devicesmap:# track the sunsun:mqtt: broker: 192.168.1.110 port: 1883 client_id: home-assistant-1 keepalive: 60 username: pi password: raspberry protocol: 3.1.1switch: platform: mqtt name: sonoff_woshi_4 state_topic: home/bed_room/4/stat command_topic: home/bed_room/4 qos: 1 payload_on: on payload_off: off retain: true # weather predictionsensor: - platform: darksky api_key: 1c53178f89697fa08b20575f9c0ef0c1 # 在forecast.io网站注册并获得,然后填写好 monitored_conditions: - summary - icon #- nearest_storm_distance #- nearest_storm_bearing #- precip_type #- precip_intensity #- precip_probability - temperature - apparent_temperature #- dew_point - wind_speed - wind_bearing - cloud_cover - humidity #- pressure - visibility #- ozone #- minutely_summary #- hourly_summary #- daily_summary - temperature_max - temperature_min #- apparent_temperature_max #- apparent_temperature_min #- precip_intensity_max # text to speechtts: - platform: google# cloudcloud:group: !include groups.yamlautomation: !include automations.yamlscript: !include scripts.yaml
仅供参考
之后还要编辑.homeassistant中customize.yaml
switch.sonoff_woshi_4: friendly_name: 灯 dingdang: {开灯:on, 开灯:turn_on, 关灯:off, 关灯:turn_off}sensor.dark_sky_apparent_temperature: friendly_name: 环境温度 dingdang: [查看环境温度, 当前环境温度, 环境温度]
编辑完成后保存 打开网页进入homeassistant
重启hass服务当然在putty重启也一样
稍等重新开启后你会看到一个灯 和一个开关按钮至此homeassistant就配置完毕了
接下来开始给esp8266烧写固件
由于图方便直接tb买了sonoff的那个也考虑到是直接接到220上买了还是方便我不愿意去碰电源模块什么的别问我为什么
总而言之 你也可以自己做一个 8266 的继电器
以这个为例 直接上链接https://bbs.feng.com/read-htm-tid-10878311.html 教程很详细 一步一步跟着做
固件配置烧写完成后 打开homeassistant 点击开关按钮 点灯成功
ok
之后打开叮当的配置文件将homeassistant插件添加上去
cd .dingdang
nano profile.yml
根据配置修改添加到 最后面插件
修改后保存退出
下面再次运行叮当
直接唤醒后“帮我开灯”
叮当:执行成功

常见的恒流源电路及作为有源负载的应用
一加8系列将全系标配5G 价格上涨成定局
Dialog DA1469x发布:支持蓝牙5.1寻向功能,可实现厘米级实时定位
区块链编程语言Move和共识协议LibraBFT介绍
无线充电接收SOC芯片IP6832介绍
树莓派+HomeAssistant打造智能语音管家
科学家发现极可能存在外星生命的天体,距地球约200光年的一颗“超级地球”
关于双频WiFi模块,你了解么?
嵌入式系统的知识平台与平台模式详解
Manz 亚智科技G10.5面板湿制程设备交付出货 创下了国产化的里程碑
MATLAB学习笔记之模糊算法3
爱立信彭俊江:5G业务其实只是演示或预商用,并不是真正的商用
基础厂商尝试降低WiMAX 基站成本
植株养分测定仪的仪器特点是什么
功率半导体原理和功能介绍
磁性元件峰会将于2020年9月11日在苏州太湖国际会议酒店举办
聚酰亚胺PCB
企业智能化之路需理,盲目追逐风口只会伤害企业自身的发展
50V 3A直流稳压电源电路图
随着汽车不断增多,车用显示器市场需求持续快速成长