【基于Seeed xiao ESP32S3 Sense的自动化HA鱼缸设计】

1.前言

基于Seeed xiao ESP32S3 Sense的自动化HA鱼缸

在当今物联网与智能家居科技日益发达的时代,将先进技术和传统养鱼艺术融合,创造出智能、自动化且极具观赏价值的鱼缸已成为一种创新趋势。SeeedStudio推出的Xiao ESP32-S3 Sense开发板以其卓越的性能和丰富的拓展性为这一设想提供了有力的技术支撑。这款开发板搭载了高性能的ESP32-S3芯片,集成了强大的处理能力、Wi-Fi和蓝牙双模无线通讯模块,并内嵌有OV2640摄像头,使其成为构建智能鱼缸的理想核心元件。
在这里插入图片描述
本文旨在探讨如何运用Seeed Xiao ESP32-S3 Cam开发板设计一款自动化、可接入Home Assistant(简称HA)的智能鱼缸系统。系统将集成多项功能,如自动投喂、环境监测(包括温度、湿度)、实时视频监控以及远程管理等,使鱼缸养护工作更加科学便捷,同时也增强了观赏体验和互动性。

1.1 立项目标

  1. 基于ESP32S3 Sense接入ESPHome实体化研究(涉及Camera/DHT/LED/Servo)
  2. 基于NodeRED+小爱自动化服务鱼缸管理研究(涉及自动语音播报温湿度、定时开灯、定时投饵)

通过精心设计和细致调试,我们将借助开源软硬件的优势,搭建起一套涵盖硬件组装、软件编程、云服务对接等多层面技术环节的智能鱼缸解决方案。在这个过程中,不仅体现了技术创新带来的生活乐趣,也展示了物联网技术在改善生活品质、提升宠物养护体验等方面的广泛应用前景。随着篇章的深入,读者将逐步了解如何利用Xiao ESP32-S3 Cam及其周边组件,结合Home Assistant的强大自动化能力,共同构建一个既实用又充满科技魅力的智能鱼缸系统。

1.2 系统设计流程图

在这里插入图片描述

系统设计流程图是一个用于描述HA自动化系统设计过程的流程图。在这个流程中,首先进行的是项目立项,然后进入系统设计阶段,包括结构设计和硬件模块设计。在硬件模块设计中,又包括硬件模块设计和软件模块设计。然后进行联合调试,如果调试成功,就进行系统设计修改,如果调试失败,就回到硬件模块设计进行更改,直到调试成功。最后,进行是总结并记录归档。

2. 关键技术

2.1 HA环境搭建

时隔一年,我又重新开始玩Homeassistant,发现其中奥妙无穷,惊喜不断。在我浅薄的认知中要学好嵌入式,必须玩过Homeassistant,并且玩出自己的名堂!因为这是最贴切实际的生活应用没有之一,每月更新使得唯有活水来;拥抱大千使得永葆青春的活力;鬼斧神工的操作精彩纷呈,可以堪称软件与硬件的完美落地!在2024年我会出一期完整的树莓派与Homeassistant不解之缘的开发教程,只需要简单的代码拼接和模块的堆叠,会在这里看到接地气(GPIO、PWM、UART等)的硬件和妙笔生花(自动化、语音识别、语音合成、chatgpt大语言模型等)的软件之间无机衔接,最终设计一个属于自己的智能家居系统Homeassistant。
在这里插入图片描述
参考教程:【树莓派安装Homeassistant及基本配置】

2.2 ESPHome设备接入

本 教程将逐步介绍如何将 Seeed Studio XIAO ESP32S3 与 Home Assistant 上运行的。
ESPHome 连接,并在将 Grove 模块连接到 XIAO ESP32S3 后发送传感器数据/控制设备。那么,让我们开始吧!
在这里插入图片描述
参考教程:【XIAO ESP32S3 sense 通过 ESPHome 与 Home Assistant 连接】

2.3 NodeRED自动化设计

上面实现HA环境配置和xiao ESP32S3 开发板实体信息接入ESPHome,接下来就需要设计相对应的自动化控制,其中关键在于NodeRED自动化设计。实现是Homeassistant 的Node-red插件之小爱同学语音功能开通,采用NodeRED节点流设计自动化控制流,实现播报任意带变量的文本🥳🥳🥳
在这里插入图片描述

参考教程:【Homeassistant 的Node-red插件之小爱同学语音功能开通】

3. 系统硬件

系统硬件由xiao esp32s3与树莓派400组成,树莓派400是主控服务器,xiao esp32s3是客户端,xiao esp32s3连接Camera/DHT/LED/Servo

名称信号端口功能
DHTGPIO8检测鱼缸外部温湿度
LEDGPIO21鱼缸照明
ServoGPI7鱼缸喂食器

在这里插入图片描述

3.1 Camera

围绕OV2640相机(XIAO ESP32S3 Sense)与鱼缸相结合的应用场景,我们可以设计一个智能鱼缸监控系统。并通过ESP32S3的Wi-Fi功能将视频流发送到云端服务器或本地HA设备,便于远程观察鱼儿的生活状态和鱼缸环境。

畅想:

  1. 自动化喂食:通过对鱼缸内情况进行分析,配合定时功能,可以实现自动化的定时定量喂食。
  2. 健康监测:长期记录并分析鱼类的行为特征,识别异常行为,提前发现潜在的健康问题。
  3. 水质预警:通过图像识别水质的变化,及时提醒用户更换滤材或采取其他水质维护措施。

总结来说,XIAO ESP32S3 Sense与OV2640相机的结合,可以打造一个功能丰富的智能鱼缸监控系统,不仅能提供实时监控功能,还能通过数据分析提升养鱼体验,实现智慧渔业管理。

3.2 DHT

由于鱼缸环境对于水温和湿度稳定性的要求较高,尤其是在饲养热带观赏鱼或者需要保持特定温湿度范围的情况下,DHT传感器成为必不可少的组件。DHT系列传感器包括但不限于DHT11(本文采用型号)和DHT22(也称为AM2302)等型号,它们均能够提供数字信号输出的温湿度测量结果,具有良好的性价比和稳定性。

畅想

  1. 温度监测与控制:DHT传感器可以实时监测鱼缸水体温度,以及周围空气的温度,这些数据对于维持鱼只生存所需的适宜温度至关重要。当温度超过或低于预设的舒适区间时,连接到传感器的控制系统会收到信号,进而启动加热器或冷却设备,自动调整鱼缸水温。
  2. 数据记录与报警:DHT传感器的数据可以被记录下来,形成历史曲线,帮助养鱼者了解鱼缸环境变化趋势。当温度或湿度出现异常波动时,可通过配套的电路和软件系统触发警报,及时通知养鱼者采取相应措施。

因此,将DHT传感器集成到智能鱼缸设计中,不仅有利于保证鱼缸内生物的健康,也有助于提高整个鱼缸系统的自动化程度和管理水平。例如,可以通过ESP32或其他微处理器平台轻松读取DHT传感器的数据,并实现上述功能。

3.3 LED

LED(Light Emitting Diode)与鱼缸的结合,主要体现在鱼缸照明和水生生物生长环境模拟方面。LED灯具有能耗低、寿命长、色彩丰富、亮度可调等特点,非常适合用于鱼缸照明及水草养殖。

畅想

  1. 照明效果:LED鱼缸灯可以根据不同种类的观赏鱼和水草的需求提供特定光谱的光线,比如热带鱼和水草需要蓝光和红光来模拟自然界的日照,促进生理活动和增强观赏效果。
  2. 节能和智能化:LED灯具的能效高,长期使用成本较低,而且很多现代的LED鱼缸灯支持定时开关和亮度调节,可以根据生物作息习惯模拟昼夜交替,甚至可以通过智能家居系统远程控制。

综上所述,LED技术在鱼缸领域扮演着重要的角色,不仅可以满足美学需求,更重要的是能满足鱼类和水生植物在光环境方面的生物学需求,是现代智能鱼缸生态系统不可或缺的一部分。

3.4 Servo

伺服电机(Servo Motor)在鱼缸自动喂食器中的应用是用于精确控制食物投放动作的装置。伺服电机能在特定角度范围内精准定位,这对于确保鱼饲料每次投放的适量非常关键。

在鱼缸自动喂食器中,伺服电机的工作原理如下:

  1. 投放机构:伺服电机通过传动机构(如齿轮、连杆等)连接到食物投放部件,如螺旋推进器或者滑槽等,当伺服电机接收到指令后,旋转到预设的角度,推动饲料颗粒进入鱼缸。
  2. 定时定量喂食:通过编程设定,自动喂食器能够在指定的时间点驱动伺服电机工作,使得投放机构释放预先设定好的饲料量。

总之,伺服电机喂食器与鱼缸相适应,实现了鱼缸自动喂食的精准化、智能化和远程可控化,大大提高了养鱼爱好者的便利性和观赏鱼的饲养质量。

4. 遇到的问题

  1. 小爱同学如何接入HA,每天定时执行任务。解决办法:【Homeassistant 的Node-red插件之小爱同学语音功能开通】
  2. xiao esp32s3如何接入ESPHome。解决办法:【XIAO ESP32S3 sense 通过 ESPHome 与 Home Assistant 连接】

5. 程序设计

程序设计主要是

  1. ESP32S3 Sense 接入ESPHome设备实体yaml代码设计
  2. NodeRED自动化控制流模块配置

5.1 ESPHome设备接入

ESP32S3 Sense 接入ESPHome设备的完整代码如下

esphome:name: xiao-cam# friendly_name: xiao-camesp32:board: esp32-s3-devkitc-1framework:type: arduino# Enable logging
logger:# Enable Home Assistant API
api:encryption:key: "Fabc3YZ2bYG7x8WhupncrCMPqZuPMwxyeCPsgrbQIAI="ota:password: "412c844a7b10765fcd89954e7587e5af"wifi:ssid: "J09 502"password: "qwertyuiop111"# use_address: elkontrol1# use_address: elkontrol1.local# Enable fallback hotspot (captive portal) in case wifi connection failsap:ssid: "Xiao Fallback Hotspot1"password: "YpeK5OYS4Xej"captive_portal:
# Example configuration entry
external_components:- source:type: giturl: https://github.com/MichaKersloot/esphome_custom_componentscomponents: [ esp32_camera ]esp32_camera:external_clock:pin: GPIO10frequency: 20MHzi2c_pins:sda: GPIO40scl: GPIO39data_pins: [GPIO15, GPIO17, GPIO18, GPIO16, GPIO14, GPIO12, GPIO11, GPIO48]vsync_pin: GPIO38href_pin: GPIO47pixel_clock_pin: GPIO13# Image settingsname: My Camera# ...# Configuration for the status LED light
light:- platform: status_ledid: light0name: "Voice Assistant State"pin:number: GPIO21inverted: true# Configuration for I2S audio
i2s_audio:i2s_lrclk_pin: GPIO46 # Note: labeled as "useless"i2s_bclk_pin: GPIO42# Configuration for the microphone using I2S audio
microphone:- platform: i2s_audioid: echo_microphonei2s_din_pin: GPIO41adc_type: externalpdm: true# Configuration for the Voice Assistant
voice_assistant:microphone: echo_microphone# Configuration for the binary sensor (Boot Switch)
binary_sensor:    - platform: gpiopin: number: GPIO2mode:input: truepullup: truename: Boot Switchinternal: trueon_press:- voice_assistant.start:- light.turn_off: light0on_release:- voice_assistant.stop:- light.turn_on: light0# Example configuration entry (D2)
sensor:- platform: dhtpin: GPIO7temperature:name: "Temperature"humidity:name: "Humidity"update_interval: 5snumber:- platform: templatename: Servo Controlmin_value: -100max_value: 100step: 1set_action:then:- servo.write:id: my_servolevel: !lambda 'return x / 100.0;'# Example configuration entry
servo:- id: my_servooutput: pwm_output# Example output platform
# On ESP32, use ledc output
output:- platform: ledcid: pwm_outputpin: GPIO8frequency: 50 Hz

这段ESPhome配置文件描述了一台基于ESP32-S3芯片的设备(命名为"xiao-cam")的各种配置项,主要用于控制和监控鱼缸环境,并且整合了摄像、音频输入输出、LED指示灯、温湿度传感器以及伺服电机等功能。

  1. 基础配置:设备名为xiao-cam,ESP32框架选用arduino,主板类型为esp32-s3-devkitc-1。开启日志记录功能,并配置Home Assistant API以供远程访问,其中包含API加密密钥。Wi-Fi连接信息,包括SSID、密码,以及在Wi-Fi连接失败时启用的备用热点(captive portal)。
  2. 外部组件:从MichaKersloot的GitHub仓库拉取自定义组件,其中包括esp32_camera组件。
  3. 摄像头配置:配置ESP32-CAM模块的引脚分配和外接晶振频率,用于驱动OV2640摄像头。
  4. LED指示灯:创建一个状态LED灯,当语音助手激活或关闭时,改变LED状态。
  5. 麦克风与语音助手:使用I2S音频接口设置麦克风,用于拾音,并将麦克风绑定到语音助手服务。
  6. 二进制传感器(开机按钮):配置一个GPIO引脚作为开机按钮,按下时启动语音助手服务并关闭LED指示灯,松开时停止语音助手服务并打开LED指示灯。
  7. 温湿度传感器:使用DHT传感器采集鱼缸环境的温度和湿度,每5秒更新一次数据。
  8. 模板数值控制:创建一个虚拟数显控制器,用于调整伺服电机的角度,当数值改变时,将数值映射到伺服电机的控制水平。
  9. 伺服电机:配置一个伺服电机,通过PWM输出控制,这里的输出平台是ledc,也就是LED PWM控制器。
  10. 输出平台配置:设置一个LED PWM输出通道,用于驱动伺服电机,配置了输出频率为50Hz。

综上所述,这段配置文件旨在实现一个具备拍照、录音、语音唤醒、环境温湿度监测以及伺服电机控制等多种功能的智能鱼缸配件。通过ESP32-S3开发板,该设备能够接入家庭自动化系统,实现高度定制化的自动化控制。

5.2 NodeRED控制流

  1. 小爱同学语言播报,测试是否故障
    在这里插入图片描述
    Json代码
[{"id": "31531595a3887301","type": "tab","label": "小爱同学配置","disabled": false,"info": "","env": []},{"id": "01c4904dbc06f88c","type": "inject","z": "31531595a3887301","name": "","props": [{"p": "payload"},{"p": "topic","vt": "str"}],"repeat": "","crontab": "","once": false,"onceDelay": 0.1,"topic": "","payload": "","payloadType": "date","x": 260,"y": 120,"wires": [["5d641ec6b07a673c"]]},{"id": "95179cc4df24244c","type": "debug","z": "31531595a3887301","name": "debug 1","active": true,"tosidebar": true,"console": false,"tostatus": false,"complete": "false","statusVal": "","statusType": "auto","x": 820,"y": 120,"wires": []},{"id": "d03f58e01f4a16b3","type": "inject","z": "31531595a3887301","name": "","props": [{"p": "payload"},{"p": "topic","vt": "str"}],"repeat": "","crontab": "","once": false,"onceDelay": 0.1,"topic": "","payload": "","payloadType": "date","x": 220,"y": 220,"wires": [["a89d1daebe024134"]]},{"id": "8d8e1bd016c64e63","type": "debug","z": "31531595a3887301","name": "debug 2","active": true,"tosidebar": true,"console": false,"tostatus": false,"complete": "false","statusVal": "","statusType": "auto","x": 740,"y": 220,"wires": []},{"id": "5d641ec6b07a673c","type": "xiaoai-volume","z": "31531595a3887301","name": "","xiaoai": "c8dc251df8e97718","volume": "11","device": "","x": 460,"y": 120,"wires": [["95179cc4df24244c"],[]]},{"id": "a89d1daebe024134","type": "api-call-service","z": "31531595a3887301","name": "测试小爱同学","server": "9e5db24f.d50e5","version": 5,"debugenabled": false,"domain": "xiaomi_miot","service": "intelligent_speaker","areaId": [],"deviceId": [],"entityId": ["sensor.xiaomi_lx04_5e02_conversation"],"data": "{\"text\":\"你好鸭!欢迎来到智慧实验室,我是鹏鹏的小助手\"}","dataType": "jsonata","mergeContext": "","mustacheAltTags": false,"outputProperties": [{"property": "payload","propertyType": "msg","value": "测试小爱同学成功","valueType": "str"}],"queue": "none","x": 480,"y": 220,"wires": [["8d8e1bd016c64e63"]]},{"id": "6f985e77ba2239d8","type": "inject","z": "31531595a3887301","name": "触发器","props": [{"p": "payload"},{"p": "topic","vt": "str"}],"repeat": "","crontab": "","once": false,"onceDelay": 0.1,"topic": "","payload": "","payloadType": "date","x": 150,"y": 380,"wires": [["c87ec627c3d65acc"]]},{"id": "cdf9b42ee3b909ee","type": "debug","z": "31531595a3887301","name": "打印调试","active": true,"tosidebar": true,"console": false,"tostatus": false,"complete": "payload","targetType": "msg","statusVal": "","statusType": "auto","x": 1040,"y": 380,"wires": []},{"id": "c87ec627c3d65acc","type": "xiaoai-volume","z": "31531595a3887301","name": "","xiaoai": "c8dc251df8e97718","volume": "43","device": "","x": 320,"y": 380,"wires": [["06efbebf06c2e680"],["710be66d9ae5fa19"]]},{"id": "710be66d9ae5fa19","type": "api-call-service","z": "31531595a3887301","name": "小助手故障提醒","server": "41ef4b78.2e2ab4","version": 5,"debugenabled": false,"domain": "smtp","service": "notify","areaId": [],"deviceId": [],"entityId": [],"data": "{\t   \"message\":\"<b>当前智慧实验室小助手失效,请重新检测设备</b>\",\t   \"title\":\"消息来自HomeAssistant\",\t   \"email\":\"3126171871@qq.com\"\t}","dataType": "jsonata","mergeContext": "","mustacheAltTags": false,"outputProperties": [{"property": "payload","propertyType": "msg","value": "小助手故障提醒","valueType": "str"}],"queue": "none","x": 700,"y": 420,"wires": [["cdf9b42ee3b909ee"]]},{"id": "06efbebf06c2e680","type": "api-call-service","z": "31531595a3887301","name": "测试小爱同学","server": "9e5db24f.d50e5","version": 5,"debugenabled": false,"domain": "xiaomi_miot","service": "intelligent_speaker","areaId": [],"deviceId": [],"entityId": ["sensor.xiaomi_lx04_5e02_conversation"],"data": "{\"text\":\"你好鸭!欢迎来到智慧实验室,我是鹏鹏的小助手\"}","dataType": "jsonata","mergeContext": "","mustacheAltTags": false,"outputProperties": [{"property": "payload","propertyType": "msg","value": "测试小爱同学成功","valueType": "str"}],"queue": "none","x": 700,"y": 320,"wires": [["cdf9b42ee3b909ee"]]},{"id": "c8dc251df8e97718","type": "xiaoai-tts-configurator","name": "小爱"},{"id": "9e5db24f.d50e5","type": "server","name": "Home Assistant","addon": true},{"id": "41ef4b78.2e2ab4","type": "server","name": "Home Assistant","version": 5,"addon": true,"rejectUnauthorizedCerts": true,"ha_boolean": "y|yes|true|on|home|open","connectionDelay": true,"cacheJson": true,"heartbeat": false,"heartbeatInterval": "30","areaSelector": "friendlyName","deviceSelector": "friendlyName","entitySelector": "friendlyName","statusSeparator": "at: ","statusYear": "hidden","statusMonth": "short","statusDay": "numeric","statusHourCycle": "h23","statusTimeFormat": "h:m","enableGlobalContextStore": true}
]
  1. 喂鱼自动化,每天12点自动喂鱼
    在这里插入图片描述
    Json代码
[{"id": "13c9e0ee685611ac","type": "tab","label": "喂鱼自动化","disabled": false,"info": "","env": []},{"id": "2ee71350eab9a05b","type": "inject","z": "13c9e0ee685611ac","name": "","props": [{"p": "payload"},{"p": "topic","vt": "str"}],"repeat": "","crontab": "00 12 * * *","once": true,"onceDelay": 0.1,"topic": "","payload": "","payloadType": "date","x": 260,"y": 100,"wires": [["fd353374c78d82f8"]]},{"id": "87a1d11f9c89367d","type": "debug","z": "13c9e0ee685611ac","name": "debug 3","active": false,"tosidebar": true,"console": false,"tostatus": false,"complete": "false","statusVal": "","statusType": "auto","x": 1060,"y": 380,"wires": []},{"id": "2e6d7d5839debb53","type": "api-call-service","z": "13c9e0ee685611ac","name": "舵机90度","server": "41ef4b78.2e2ab4","version": 5,"debugenabled": false,"domain": "number","service": "set_value","areaId": ["ke_ting"],"deviceId": ["dc2bd470f44cfb196986ae81f0c54a1b"],"entityId": ["number.servo_control"],"data": "{\"value\":100}","dataType": "jsonata","mergeContext": "","mustacheAltTags": false,"outputProperties": [{"property": "payload","propertyType": "msg","value": "舵机90度","valueType": "str"}],"queue": "none","x": 800,"y": 100,"wires": [["508e5a9410e2423c"]]},{"id": "a81f43e407aa0c35","type": "api-call-service","z": "13c9e0ee685611ac","name": "舵机0度","server": "41ef4b78.2e2ab4","version": 5,"debugenabled": false,"domain": "number","service": "set_value","areaId": ["ke_ting"],"deviceId": ["dc2bd470f44cfb196986ae81f0c54a1b"],"entityId": ["number.servo_control"],"data": "{\"value\":-100}","dataType": "jsonata","mergeContext": "","mustacheAltTags": false,"outputProperties": [{"property": "payload","propertyType": "msg","value": "舵机0度","valueType": "str"}],"queue": "none","x": 400,"y": 220,"wires": [["7a2b85ccb60380df"]]},{"id": "45dbf177629c65d5","type": "api-call-service","z": "13c9e0ee685611ac","name": "舵机90度","server": "41ef4b78.2e2ab4","version": 5,"debugenabled": false,"domain": "number","service": "set_value","areaId": ["ke_ting"],"deviceId": ["dc2bd470f44cfb196986ae81f0c54a1b"],"entityId": ["number.servo_control"],"data": "{\"value\":100}","dataType": "jsonata","mergeContext": "","mustacheAltTags": false,"outputProperties": [{"property": "payload","propertyType": "msg","value": "舵机90度","valueType": "str"}],"queue": "none","x": 860,"y": 220,"wires": [["c595f13eb99d5d01"]]},{"id": "d4dce4fd5a1de16d","type": "api-call-service","z": "13c9e0ee685611ac","name": "舵机0度","server": "41ef4b78.2e2ab4","version": 5,"debugenabled": false,"domain": "number","service": "set_value","areaId": ["ke_ting"],"deviceId": ["dc2bd470f44cfb196986ae81f0c54a1b"],"entityId": ["number.servo_control"],"data": "{\"value\":-100}","dataType": "jsonata","mergeContext": "","mustacheAltTags": false,"outputProperties": [{"property": "payload","propertyType": "msg","value": "舵机0度","valueType": "str"}],"queue": "none","x": 480,"y": 380,"wires": [["07266ceecfd9a08f"]]},{"id": "508e5a9410e2423c","type": "delay","z": "13c9e0ee685611ac","name": "","pauseType": "delay","timeout": "5","timeoutUnits": "seconds","rate": "1","nbRateUnits": "1","rateUnits": "second","randomFirst": "1","randomLast": "5","randomUnits": "seconds","drop": false,"allowrate": false,"outputs": 1,"x": 1060,"y": 100,"wires": [["a81f43e407aa0c35"]]},{"id": "c595f13eb99d5d01","type": "delay","z": "13c9e0ee685611ac","name": "","pauseType": "delay","timeout": "5","timeoutUnits": "seconds","rate": "1","nbRateUnits": "1","rateUnits": "second","randomFirst": "1","randomLast": "5","randomUnits": "seconds","drop": false,"allowrate": false,"outputs": 1,"x": 1180,"y": 220,"wires": [["d4dce4fd5a1de16d"]]},{"id": "7a2b85ccb60380df","type": "delay","z": "13c9e0ee685611ac","name": "","pauseType": "delay","timeout": "5","timeoutUnits": "seconds","rate": "1","nbRateUnits": "1","rateUnits": "second","randomFirst": "1","randomLast": "5","randomUnits": "seconds","drop": false,"allowrate": false,"outputs": 1,"x": 640,"y": 220,"wires": [["45dbf177629c65d5"]]},{"id": "07266ceecfd9a08f","type": "api-call-service","z": "13c9e0ee685611ac","name": "结束喂鱼","server": "41ef4b78.2e2ab4","version": 5,"debugenabled": false,"domain": "xiaomi_miot","service": "intelligent_speaker","areaId": [],"deviceId": [],"entityId": ["sensor.xiaomi_lx04_5e02_conversation"],"data": "{\"text\":\"小爱同学已经喂鱼成功啦\"}","dataType": "jsonata","mergeContext": "","mustacheAltTags": false,"outputProperties": [{"property": "payload","propertyType": "msg","value": "结束喂鱼","valueType": "str"}],"queue": "none","x": 800,"y": 380,"wires": [["87a1d11f9c89367d"]]},{"id": "fd353374c78d82f8","type": "api-call-service","z": "13c9e0ee685611ac","name": "开始喂鱼","server": "41ef4b78.2e2ab4","version": 5,"debugenabled": false,"domain": "xiaomi_miot","service": "intelligent_speaker","areaId": [],"deviceId": [],"entityId": ["sensor.xiaomi_lx04_5e02_conversation"],"data": "{\"text\":\"小爱同学开始喂鱼啦\"}","dataType": "jsonata","mergeContext": "","mustacheAltTags": false,"outputProperties": [{"property": "payload","propertyType": "msg","value": "测试小爱同学成功","valueType": "str"}],"queue": "none","x": 460,"y": 100,"wires": [["2e6d7d5839debb53"]]},{"id": "41ef4b78.2e2ab4","type": "server","name": "Home Assistant","version": 5,"addon": true,"rejectUnauthorizedCerts": true,"ha_boolean": "y|yes|true|on|home|open","connectionDelay": true,"cacheJson": true,"heartbeat": false,"heartbeatInterval": "30","areaSelector": "friendlyName","deviceSelector": "friendlyName","entitySelector": "friendlyName","statusSeparator": "at: ","statusYear": "hidden","statusMonth": "short","statusDay": "numeric","statusHourCycle": "h23","statusTimeFormat": "h:m","enableGlobalContextStore": true}
]
  1. 开灯自动化
    在这里插入图片描述
    Json代码
[{"id": "10765693b6bcfeaf","type": "tab","label": "开灯自动化","disabled": false,"info": "","env": []},{"id": "3eca89300da6a067","type": "api-call-service","z": "10765693b6bcfeaf","name": "开灯","server": "9e5db24f.d50e5","version": 5,"debugenabled": false,"domain": "light","service": "turn_on","areaId": ["ke_ting"],"deviceId": ["dc2bd470f44cfb196986ae81f0c54a1b"],"entityId": ["light.voice_assistant_state"],"data": "","dataType": "jsonata","mergeContext": "","mustacheAltTags": false,"outputProperties": [{"property": "payload","propertyType": "msg","value": "开灯","valueType": "str"}],"queue": "none","x": 810,"y": 300,"wires": [["d4b489b84d3a1a11"]]},{"id": "d16b213857492fcb","type": "time-range-switch","z": "10765693b6bcfeaf","name": "","lat": "","lon": "","startTime": "07:28","endTime": "12:28","startOffset": 0,"endOffset": 0,"x": 550,"y": 320,"wires": [["784f9bc1adca590d"],["3eca89300da6a067"]]},{"id": "784f9bc1adca590d","type": "api-call-service","z": "10765693b6bcfeaf","name": "关灯","server": "9e5db24f.d50e5","version": 5,"debugenabled": false,"domain": "light","service": "turn_off","areaId": ["ke_ting"],"deviceId": ["dc2bd470f44cfb196986ae81f0c54a1b"],"entityId": ["light.voice_assistant_state"],"data": "","dataType": "jsonata","mergeContext": "","mustacheAltTags": false,"outputProperties": [{"property": "payload","propertyType": "msg","value": "关灯","valueType": "str"}],"queue": "none","x": 790,"y": 400,"wires": [["d4b489b84d3a1a11"]]},{"id": "d4b489b84d3a1a11","type": "debug","z": "10765693b6bcfeaf","name": "debug 5","active": true,"tosidebar": true,"console": false,"tostatus": false,"complete": "false","statusVal": "","statusType": "auto","x": 1000,"y": 360,"wires": []},{"id": "56a173656eee3993","type": "inject","z": "10765693b6bcfeaf","name": "","props": [{"p": "payload"},{"p": "topic","vt": "str"}],"repeat": "","crontab": "0 7-13 * * *","once": false,"onceDelay": 0.1,"topic": "","payload": "","payloadType": "date","x": 370,"y": 320,"wires": [["d16b213857492fcb"]]},{"id": "1ff3db3ea7622884","type": "inject","z": "10765693b6bcfeaf","name": "","props": [{"p": "payload"},{"p": "topic","vt": "str"}],"repeat": "","crontab": "","once": false,"onceDelay": 0.1,"topic": "","payload": "","payloadType": "date","x": 650,"y": 220,"wires": [["3eca89300da6a067"]]},{"id": "6c19a3bec41654a6","type": "inject","z": "10765693b6bcfeaf","name": "","props": [{"p": "payload"},{"p": "topic","vt": "str"}],"repeat": "","crontab": "","once": false,"onceDelay": 0.1,"topic": "","payload": "","payloadType": "date","x": 650,"y": 460,"wires": [["784f9bc1adca590d"]]},{"id": "9e5db24f.d50e5","type": "server","name": "Home Assistant","addon": true}
]

6. 效果展示

实物图制作

在这里插入图片描述
主视图
在这里插入图片描述
侧视图

6.1 HA界面

在这里插入图片描述
这个概览界面显示小爱同学和ESP32S3 Sense设备接入情况

  1. 滑动Servo control控制喂食
  2. 点击Voice Assistant State鱼缸补光
  3. 查看当前鱼缸外围温湿度
  4. 通过My Camera实时摸鱼

6.2 NodeRED自动化

设计每天12定时喂鱼,喂鱼效果如下,下面是滑动Servo control-100~100
在这里插入图片描述

测试小爱同学,点击触发就可让小爱同学发声
在这里插入图片描述

7. 总结

这是我第五次参加嵌入式相关的网上比赛活动
● 第一次是RT-Thread的【基于RT-Thread+RA6M4的智能鱼缸系统设计之鱼我所欲也】活动,作品是2022年暑假做的获得第六名,还是比较开心!
● 第二次2023年寒假做的是【基于MAX7800羽毛板语音控制ESP8266小车】,成绩还不错第七名,让对小车车的可玩性又近了一步!
● 第三次2023年春做的【基于腾讯云的CH32V307开发板远程机械臂小车】,由于图床引用CSDN导致最后评审没有显示出来,最后获得安慰奖!
● 第四次2023年冬做的【FastBond2阶段2——基于ESP32C3开发的简易IO调试设备 - 电子森林 (eetree.cn) 】 ,最终获得三等奖,再接再厉哦!
● 第五次实现了【基于LicheePi-4A的 人脸识别系统软件设计】,人脸识别系统软件设计和调试全流程,加深了对tkinter GUI设计思路,对LicheePi-4A 国产单板计算机更有信心,最终获得参与奖!

这一次我又回到最开始,用HA重新做了一遍,发现代码量减少许多,对智能家居有更深刻认识啦!😘😘😘
建议:

  1. 希望硬禾与Seeed多多合作定期举办博客活动,让更加优质的国产嵌入式生态做大做强;
  2. 期待硬禾平台推出更多有质量有意义持续性的创客活动!
    非常硬禾举行寒假在家一起练活动,大家都为这个国内嵌入式生态出一份力,只要努力认真做了都会有所收获,期盼这些作品在将来某一天为构建美好未来贡献一份微博之力!

我后期会持续更新我测评的一系列国内开发板测评,并且会积极参加有质量的玄铁杯活动🛹🛹🛹每天都一点点结合实际需求联动丰富生活,从而实现对外部世界进行充分的感知,尽最大努力认识这个有机与无机的环境,科学地合理地进行创作和发挥效益,然后为人类社会发展贡献一点微薄之力。🤣🤣🤣

🥳🥳🥳再次非常感谢硬禾的相关组织者支持等等🥳🥳🥳期待这一次的成绩哟!

参考文献:

  1. 【树莓派安装Homeassistant及基本配置】
  2. 【XIAO ESP32S3 sense 通过 ESPHome 与 Home Assistant连接】
  3. 【Homeassistant的Node-red插件之小爱同学语音功能开通】

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/752454.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

command failed: npm install --loglevel error --legacy-peer-deps

在使用vue create xxx创建vue3项目的时候报错。 解决方法&#xff0c;之前使用的https://registry.npm.taobao.org 证书过期更换镜像地址即可 操作如下&#xff1a; 1.cd &#xff5e;2.执行rm .npmrc3. sudo npm install -g cnpm --registryhttp://registry.npmmirror.com…

基于高斯模型的运动目标检测(车辆检测),Matlab实现

博主简介&#xff1a; 专注、专一于Matlab图像处理学习、交流&#xff0c;matlab图像代码代做/项目合作可以联系&#xff08;QQ:3249726188&#xff09; 个人主页&#xff1a;Matlab_ImagePro-CSDN博客 原则&#xff1a;代码均由本人编写完成&#xff0c;非中介&#xff0c;提供…

Vue3:标签的ref属性用法

一、情景说明 我们在写前端页面的时候&#xff0c;肯定会遇到获取DOM内容的情况。 以往&#xff0c;我们是用原生的js方法去获取&#xff0c;如document.getXxxx 但是&#xff0c;这中方法会有个问题&#xff0c;如果父组件和子组件的id相同&#xff0c;则会出错。 在Vue3中&…

ASP.NET 服务器控件

目录 一、使用的软件 1、下载 2、新建文件&#xff08;写一个简单的web网页&#xff09; 二、相关知识点 1、Web窗体网页的组件 &#xff08;1&#xff09;可视化组件 &#xff08;2&#xff09;用户接口逻辑 2、Web Form网页的代码模型 &#xff08;1&#xff09;单文件…

《硬件历险》之Mac抢救出现问题的时间机器硬盘中的数据

本文虽然使用“抢救”一词&#xff0c;但是运气比较好&#xff0c;远没有达到访问和修改底层的信息来抢救的地步。如果你是需要通过访问和修改底层信息来抢救数据&#xff0c;建议阅读刘伟的《数据恢复技术深度揭秘&#xff08;第二版&#xff09;》或者寻找专业人士的帮助。 《…

视频基础知识(一) 视频编码 | H.26X 系列 | MPEG 系列 | H.265

文章目录 一、视频编码二、 H.26X 系列1、H.2612、H.2633、H.2643.1 I帧3.2 P帧3.3 B帧 4、H.265 三、 MPEG 系列1、MPEG-12、MPEG-23、MPEG-44、MPEG-7 &#x1f680; 个人简介&#xff1a;CSDN「博客新星」TOP 10 &#xff0c; C/C 领域新星创作者&#x1f49f; 作 者&…

微信小程序调用百度智能云API(菜品识别)

一、注册后生成应用列表创建应用 二、找到当前所需使用的api菜品识别文档 三、点链接看实例代码 这里需要使用到如下几个参数&#xff08;如下&#xff09;&#xff0c;其他的参数可以不管 client_id &#xff1a; 就是创建应用后的API Keyclient_secret&#xff1a; 就是创建…

GAN及其衍生网络中生成器和判别器常见的十大激活函数(2024最新整理)

目录 1. Sigmoid 激活函数 2. Tanh 激活函数 3. ReLU 激活函数 4. LeakyReLU 激活函数 5. ELU 激活函数 6. SELU 激活函数 7. GELU 激活函数 8. SoftPlus 激活函数 9. Swish 激活函数 10. Mish 激活函数 激活函数(activation function)的作用是对网络提取到的特征信…

鸿蒙开发实战:【Faultloggerd部件】

theme: z-blue 简介 Faultloggerd部件是OpenHarmony中C/C运行时崩溃临时日志的生成及管理模块。面向基于 Rust 开发的部件&#xff0c;Faultloggerd 提供了Rust Panic故障日志生成能力。系统开发者可以在预设的路径下找到故障日志&#xff0c;定位相关问题。 架构 Native In…

21 OpenCV 直方图均衡化

文章目录 直方图概念均衡的目的equalizeHist 均衡化算子示例 直方图概念 图像直方图&#xff0c;是指对整个图像像在灰度范围内的像素值(0~255)统计出现频率次数&#xff0c;据此生成的直方图&#xff0c;称为图像直方图-直方图。直方图反映了图像灰度的分布情况。 均衡的目的…

Ypay源支付2.8.8免授权聚合免签系统

本帖最后由 renleixiaoxu 于 2024-3-15 09:46 编辑 产品介绍 XPay是专为个人站长打造的聚合免签系统&#xff0c;拥有卓越的性能和丰富的功能。采用全新轻量化的界面UI&#xff0c;让您可以更加方便快捷地解决 知识付费和运营赞助的难题。同时&#xff0c;它基于高性能的Thin…

Unity在UGUI上通过绘制网格顶点自由画线

该插件的实现是使用UI组件的绘图API来动态生成和修改几何形状&#xff0c;可自由动态更改画线的粗细、拐角圆滑度、颜色&#xff0c;自由增减节点&#xff0c;不额外增加gameobject&#xff0c;并且在原生的UGUI上以ScreenSpace-Overlay的状态下&#xff0c;显示效果如下所示 …

数学建模-邢台学院

文章目录 1、随机抽取的号码在总体的排序2、两端间隔对称模型 1、随机抽取的号码在总体的排序 10个号码从小到大重新排列 [ x 0 , x ] [x_0, x] [x0​,x] 区间内全部整数值 ~ 总体 x 1 , x 2 , … , x 10 总体的一个样本 x_1, x_2, … , x_{10} ~ 总体的一个样本 x1​,x2​,……

ffmpeg 滤镜实现不同采样率多音频混音

音频混音在音视频开发中是十分重要的一个环节,所谓音频混音就是将所有需要混音的数据相加得到混音数据,然后通过某个算法进行非法数据的处理;例如相加数值超过最大值,最小值等! 在实际的音频开发中,要实现混音的流程如下: 因此我们的编码实现就分为五部分:寻找…

【机器学习300问】37、什么是迁移学习?

一、什么是迁移学习&#xff1f; &#xff08;1&#xff09;它的出现是为了解决什么问题&#xff1f; 迁移学习是为了解决深度学习中由于数据不足导致的学习效果受限以及跨领域知识的有效利用等问题而发展起来的一种重要技术手段。 ① 缺少训练数据 在许多实际应用中&#xf…

【GPT-SOVITS-05】SOVITS 模块-残差量化解析

说明&#xff1a;该系列文章从本人知乎账号迁入&#xff0c;主要原因是知乎图片附件过于模糊。 知乎专栏地址&#xff1a; 语音生成专栏 系列文章地址&#xff1a; 【GPT-SOVITS-01】源码梳理 【GPT-SOVITS-02】GPT模块解析 【GPT-SOVITS-03】SOVITS 模块-生成模型解析 【G…

C++程序函数的重载和函数模板

在C中&#xff0c;函数也可以重载。C允许在同一作用域中用同一函数名定义多个函数&#xff0c;这些函数的参数个数和参数类型不相同&#xff0c;这些同名的函数用来实现不同的功能&#xff0c;这就是函数的重载。 函数的重载的函数体是完全相同的&#xff0c;只是形参和类型不同…

嵌入式学习之Linux系统编程篇笔记——系统编程初探

配套视频学习链接&#xff1a;https://www.bilibili.com/video/BV1zV411e7Cy?p2&vd_sourced488bc722b90657aaa06a1e8647eddfc 目录 Linux系统编程的基本认识 什么是Linux系统编程? 什么是系统编程 系统编程的作用 怎么学习Linux系统编程? Linux系统编程基本程序框…

读者交流群

自开设公众号以来&#xff0c;收到众多读者的关注&#xff0c;所以我很高兴在这里向大家推荐加入我的技术交流群。如果你对Java和Go语言有兴趣&#xff0c;想要与其他同好分享经验和知识&#xff0c;那么这个读者群将是一个理想的选择。 在这个读者群中&#xff0c;我们有机会与…

知识积累(五):Transformer 家族的学习笔记

文章目录 1. RNN1.1 缺点 2. Transformer2.1 组成2.2 Encoder2.2.1 Input Embedding&#xff08;嵌入层&#xff09;2.2.2 位置编码2.2.3 多头注意力2.2.4 Add & Norm 2.3 Decoder2.3.1 概览2.3.2 Masked multi-head attention 2.4 Transformer 模型的训练和推理2.4.1 训练…