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

 找回密码
 立即注册
查看: 23034|回复: 36

[经验分享] 壁挂太阳能热水器与燃气热水器协同使用的自动化思考

[复制链接]

76

主题

1364

帖子

1万

积分

元老级技术达人

积分
18842
金钱
17438
HASS币
290
发表于 2021-2-28 00:35:47 | 显示全部楼层 |阅读模式
#### 需求:装修时没细考虑,壁挂式太阳能保留了,增加了燃气热水器。水管中这两个设备是并列关系,需要用哪一个就要跑过去打开角阀,不用的就要关掉角阀。一个在厨房,一个在阳台,使用一段时间发现真是不方便。有时天气好太阳能能达到60度左右,但冬天洗澡的话也就洗一个人多点,后面的还是要换成燃气的。如果只用燃气又感觉太阳能的热水浪费了。
ha的自动化能很好的解决以上问题,前期的硬件工作是关键。


#### 设备现状:
燃气热水器断电时是打开状态,则通电时保持打开状态。这样就不需要有什么改装,只要通断电就能开关热水器。太阳能热水器通电就能显示温度值,通不能电不影响使用。

平面图.png

先后购买了两个常闭型电动阀(通电打开,断电关闭)、两个米家蓝牙mesh墙壁插座。电源打开则对应管道的阀门就打开,电源关闭对应管理的阀门也就关闭。

#### 安装效果图:

燃气热水器:
IMG_7012.HEIC.JPG.JPG

IMG_7013.HEIC.JPG.JPG


太阳能热水器:
IMG_7004.HEIC.JPG.JPG

IMG_7006.HEIC.JPG.JPG



#### 基本需求:
1、打开太阳能热水器,自动关闭燃气热水器。
2、打开燃气热水器,自动关闭太阳能热水器。

ha自动化:
- id: '161435528888888'
  alias: 燃气热水器与太阳能互控
  description: ''
  trigger:
  - platform: state
    entity_id: switch.28d1272b27be_switch
    to: 'on'
  - platform: state
    entity_id: switch.28d12736597a_switch
    to: 'on'
  condition: []
  action:
  - choose:
    - conditions:
      - condition: template
        value_template: '{{ trigger.entity_id == "switch.28d1272b27be_switch" }}'
      - condition: state
        state: 'on'
        entity_id: switch.28d12736597a_switch
        for: '30'
      sequence:
      - service: switch.turn_off
        data: {}
        entity_id: switch.28d12736597a_switch
    - conditions:
      - condition: template
        value_template: '{{ trigger.entity_id == "switch.28d12736597a_switch" }}'
      - condition: state
        entity_id: switch.28d1272b27be_switch
        state: 'on'
        for: '30'
      sequence:
      - service: switch.turn_off
        data: {}
        entity_id: switch.28d1272b27be_switch
    default: []
  mode: single


有人回到家就自动打开太阳能,如果需要切换可以利用一个hassmart的多余开关或者小米开关等触发切换。

#### 进阶需求:
1、基本需要保留
2、太阳能温度低于30度时自动切换燃气热水器,并且标记 input“使用太阳能”为off。
3、需要使用热水时打开一个开关,根据 input“使用太阳能"的值决定打开太阳能还是打开燃气。
4、每天14:00和18:00分别标记 input“使用太阳能”为on。

这个需要将太阳能的温度值接入到ha中,为了不破坏电器(其实是不会弄),采用ssocr来识别。

IMG_7008.HEIC.JPG.JPG

IMG_7014.PNG.JPG

1DDF4A51-7C44-4292-84A7-2DE2F6B2D901.png

这个比较麻烦,调试参数重启了n次系统
本例代码:
image_processing:
  - platform: seven_segments
    x_position: 0
    y_position: 0
    width: 640
    height: 480    
    threshold: 60
    digits: 2
    extra_arguments: -f white
    source:
      - entity_id: camera.esp32cam
sensor:
  - platform: template
    sensors:
      taiyannengwendu:
        value_template: "{{ states('image_processing.sevensegment_ocr_esp32cam') }}"
        friendly_name: '太阳能温度'
        unit_of_measurement: '°C'


这个测试没问题后,自动化就可以做了





- id: '1614361998512'
  alias: 洗澡时选用太阳能关闭则打开天然气
  description: ''
  trigger:
  - platform: state
    entity_id: input_boolean.xuan_yong_tai_yang_neng
    to: 'off'
  condition:
  - condition: state
    entity_id: binary_sensor.e4aaec34d5e2_contact
    state: 'off'
    for: '120'
  - condition: state
    entity_id: input_boolean.athome
    state: 'on'
  - condition: state
    entity_id: light.hassmartweishengjiandeng
    state: 'on'
  action:
  - service: switch.turn_on
    data: {}
    entity_id: switch.28d1272b27be_switch
  mode: single
- id: '1614400275701'
  alias: 每天重置选择太阳能
  description: ''
  trigger:
  - platform: time
    at: '14:00:00'
  - platform: time
    at: '18:00:00'
  condition:
  - condition: state
    entity_id: input_boolean.xuan_yong_tai_yang_neng
    state: 'off'
  action:
  - service: input_boolean.turn_on
    data: {}
    entity_id: input_boolean.xuan_yong_tai_yang_neng
  mode: single
- id: '1614400878432'
  alias: 太阳能温度低于30度时取消选用太阳能
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.taiyannengwendu
    below: '30'
    for: '10'
  condition: []
  action:
  - service: input_boolean.turn_off
    data: {}
    entity_id: input_boolean.xuan_yong_tai_yang_neng
  mode: single


最后用多余的一个hassmart开关做在卫生间中操作的关联开关:
- id: '1613889412561'
  alias: 浴室镜开关关联热水开关
  description: ''
  trigger:
  - platform: state
    entity_id: switch.hassmartweishengyushideng
    to: 'on'
  - platform: state
    entity_id: switch.hassmartweishengyushideng
    to: 'off'
  condition: []
  action:
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - choose:
    - conditions:
      - condition: state
        entity_id: switch.hassmartweishengyushideng
        state: 'on'
      - condition: state
        state: 'off'
        entity_id: switch.28d12736597a_switch
      - condition: state
        entity_id: switch.28d1272b27be_switch
        state: 'off'
      sequence:
      - choose:
        - conditions:
          - condition: state
            entity_id: input_boolean.xuan_yong_tai_yang_neng
            state: 'on'
          sequence:
          - service: switch.turn_on
            data: {}
            entity_id: switch.28d12736597a_switch
          - service: automation.turn_on
            data: {}
            entity_id: automation.tai_yang_neng_wen_du_di_yu_30du_shi_qu_xiao_xuan_yong_tai_yang_neng
        default:
        - service: switch.turn_on
          data: {}
          entity_id: switch.28d1272b27be_switch
    - conditions:
      - condition: state
        entity_id: switch.hassmartweishengyushideng
        state: 'off'
      sequence:
      - service: switch.turn_off
        data: {}
        entity_id: switch.28d1272b27be_switch
      - service: switch.turn_off
        data: {}
        entity_id: switch.28d12736597a_switch
    default: []
  mode: single


还可以增加小米开关等设备作为开关设置在需要用水的地方,用热水时就不要到处跑了。

太阳能电源打开时功率4W至5W,燃气热水器电源打开时功率约2W。不需要用时就关掉两个,需要用时就自动判断开启对应的电源或都切换电源。

发帖子当一个记录和经验分享,可能有些错漏之处。
回复

使用道具 举报

33

主题

2027

帖子

5229

积分

论坛元老

Rank: 8Rank: 8

积分
5229
金钱
3202
HASS币
60
QQ
发表于 2021-2-28 00:45:21 | 显示全部楼层
请收下我的膝盖
我不生产技术,我只是技术的搬运工。
回复

使用道具 举报

27

主题

2103

帖子

8548

积分

论坛元老

Rank: 8Rank: 8

积分
8548
金钱
6440
HASS币
30

论坛元老

发表于 2021-2-28 09:31:19 | 显示全部楼层
用啥摄像头,直接爆改太阳能热水器的控制面板呀,这样我以后可以直接抄作业了
回复

使用道具 举报

1

主题

94

帖子

1005

积分

金牌会员

Rank: 6Rank: 6

积分
1005
金钱
911
HASS币
0
发表于 2021-2-28 14:09:06 | 显示全部楼层
能不能直接在控制器上面取呢
回复

使用道具 举报

19

主题

598

帖子

4081

积分

版主

Rank: 7Rank: 7Rank: 7

积分
4081
金钱
3468
HASS币
40
发表于 2021-2-28 15:21:54 | 显示全部楼层
太阳能控制器上,找出温度传感器的两根线,接到esp32的模数转换针脚上。可以直接计算出温度的数值
回复

使用道具 举报

12

主题

199

帖子

1885

积分

金牌会员

Rank: 6Rank: 6

积分
1885
金钱
1686
HASS币
10
发表于 2021-2-28 18:33:42 | 显示全部楼层
你这思路跟我惊人的相似,我还没有弄好,水桶温度我是通过ds18b20读取的,从下面打开盖板,里面有个空洞,把温度传感器放里面就行了,也可以直接把水桶的传感器拆下来,我用的是snoff 刷tamota固件读取温度,我在太阳能板上还加了一个温度传感器,我没时间弄
回复

使用道具 举报

175

主题

2956

帖子

7555

积分

超级版主

我就是六神

Rank: 8Rank: 8

积分
7555
金钱
4574
HASS币
398

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

QQ
发表于 2021-2-28 18:55:55 | 显示全部楼层
智能家居服务生活实例
回复

使用道具 举报

19

主题

689

帖子

3472

积分

论坛元老

Rank: 8Rank: 8

积分
3472
金钱
2778
HASS币
20
发表于 2021-2-28 18:56:16 | 显示全部楼层
https://bbs.hassbian.com/thread-10152-1-1.html,看看我这个,超级简单无技术含量的燃气热水器与太阳能热水器自动切换,小白都会搞
回复

使用道具 举报

76

主题

1364

帖子

1万

积分

元老级技术达人

积分
18842
金钱
17438
HASS币
290
 楼主| 发表于 2021-3-1 00:19:16 | 显示全部楼层
本帖最后由 dscao 于 2021-3-1 00:32 编辑
ms2 发表于 2021-2-28 18:56
https://bbs.hassbian.com/thread-10152-1-1.html,看看我这个,超级简单无技术含量的燃气热水器与太阳能热 ...

你那帖子我之前也细读过,如果是要上水的太阳能,就很适合。但我这个是壁挂式太阳能,管道方式不一样,装修时没有做像你那样的三通来切换,只能后续用两个电动阀代替手动的角阀,所以有了这个思路。


IMG_7007.HEIC.JPG.JPG
回复

使用道具 举报

76

主题

1364

帖子

1万

积分

元老级技术达人

积分
18842
金钱
17438
HASS币
290
 楼主| 发表于 2021-3-1 00:25:25 | 显示全部楼层
本帖最后由 dscao 于 2021-3-1 00:30 编辑
lighu36 发表于 2021-2-28 18:33
你这思路跟我惊人的相似,我还没有弄好,水桶温度我是通过ds18b20读取的,从下面打开盖板,里面有个空洞, ...

能通过传感器识别会更稳定。但我没敢拆水桶,还有传感器是放进水能中的水里面的吗?那会不会破坏密封性。现在用esp32cam摄像头通过ssocr识别起来时不时会出现“未知”,不过大部分时间还是正确的。这两天测试发现基本也不影响自动化的判断。
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-15 15:07 , Processed in 0.453172 second(s), 36 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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