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

 找回密码
 立即注册
楼主: yylwhy

[技术探讨] 一个有关暖气(燃气炉)自动化控制的讨论

[复制链接]

0

主题

92

帖子

1609

积分

金牌会员

Rank: 6Rank: 6

积分
1609
金钱
1517
HASS币
0
发表于 2020-12-3 10:19:48 | 显示全部楼层
yylwhy 发表于 2020-12-2 20:16
这个ha里面的。
Generic Thermostat  这个是什么?

温控器本质就是一个开关+一个温度传感器的组合。
Generic Thermostat的功能也就是这个,把你放在燃气炉里的开关entity配置进去,再配置一个温度传感器就行了。它的控制方式是目标温度+上下阈值进行控制,到达“目标温度+上阈值”的时候关闭开关(停止制热),温度如果下降到“目标温度-下阈值”的时候就打开开关(开始制热)。主要是配置起来比较简单,比全程手撸自动化要容易得多
回复

使用道具 举报

0

主题

92

帖子

1609

积分

金牌会员

Rank: 6Rank: 6

积分
1609
金钱
1517
HASS币
0
发表于 2020-12-3 10:21:27 | 显示全部楼层
余歌唱晚 发表于 2020-12-2 22:42
这个好,我也在用 我觉得不错

老哥你的MixPad折腾得如何啦,之前在张大妈看到你的帖子了
回复

使用道具 举报

14

主题

660

帖子

3957

积分

论坛元老

Rank: 8Rank: 8

积分
3957
金钱
3292
HASS币
10
发表于 2020-12-4 11:30:50 | 显示全部楼层
hellkun 发表于 2020-12-3 10:21
老哥你的MixPad折腾得如何啦,之前在张大妈看到你的帖子了

当个情境开关没毛病……妥妥的
回复

使用道具 举报

9

主题

527

帖子

2350

积分

金牌会员

Rank: 6Rank: 6

积分
2350
金钱
1823
HASS币
0
 楼主| 发表于 2020-12-5 22:12:38 | 显示全部楼层
sirakawa 发表于 2020-12-2 21:09
基本还是每分钟判断就好了。低了就开高了就关。区间看自己习惯,我是前后0.5度。
需要多个传感器就加起来除 ...

能否共享一下代码 看看。。。这些个定时器是怎么玩的。。。

还有你那个温控器空置 的ui
回复

使用道具 举报

17

主题

798

帖子

5728

积分

论坛元老

Rank: 8Rank: 8

积分
5728
金钱
4925
HASS币
0
发表于 2020-12-6 09:21:29 | 显示全部楼层
本帖最后由 sirakawa 于 2020-12-6 09:38 编辑
yylwhy 发表于 2020-12-5 22:12
能否共享一下代码 看看。。。这些个定时器是怎么玩的。。。

还有你那个温控器空置 的ui ...

定时启动以及自动控制的核心基本下面这2个自动化。
模板一部分循环没搞定所以单独写的。。。。
看其他回答用通用温控器,不过这个主要在于时间段判断,用通用温控器也只是解决了哪个+-0.5度的判断那里。所以还是自己判断了。

其他的大部分的自动化其实不是用来控制暖气,而是用来防止在界面上输入错误的检查。
不过现在这是最近改的,各种检查还都没改完都不好用- -!


顺便,这个是暖气专用,多个温度设定找最高的温度,降温的没法用哈。。。

# ------------------------------------------------------------------------------#
# 定时启动暖气
# 如果当前已经是手动模式,则不执行
# ------------------------------------------------------------------------------#
- alias: "Heating Auto TurnOn By Time"
  id: "heating_auto_turnon_by_time"
  trigger:
    # 每1分钟执行
    - platform: time_pattern
      minutes: "/1"
      seconds: "10"
  variables:
    # 判断是否需要定时启动,需要启动返回 需要启动的时长,不需要则返回0
    openDuration: >-
      {# # 初始化 # #}
      {% set openDuration = "0" %}

      {% if is_state("input_boolean.heating_boolean_timer_exec_switch_1","on") %}
        {% if states("input_datetime.heating_time_timer_exec_start_time_1") == (states("sensor.time") + ":00") %}
          {% set openDuration = states("input_number.heating_number_timer_exec_open_duration_1") %}
        {% endif %}
      {% endif %}

      {% if is_state("input_boolean.heating_boolean_timer_exec_switch_2","on") %}
        {% if states("input_datetime.heating_time_timer_exec_start_time_2") == (states("sensor.time") + ":00") %}
          {% set openDuration = states("input_number.heating_number_timer_exec_open_duration_2") %}
        {% endif %}
      {% endif %}

      {% if is_state("input_boolean.heating_boolean_timer_exec_switch_3","on") %}
        {% if states("input_datetime.heating_time_timer_exec_start_time_3") == (states("sensor.time") + ":00") %}
          {% set openDuration = states("input_number.heating_number_timer_exec_open_duration_3") %}
        {% endif %}
      {% endif %}

      {% if is_state("input_boolean.heating_boolean_timer_exec_switch_4","on") %}
        {% if states("input_datetime.heating_time_timer_exec_start_time_4") == (states("sensor.time") + ":00") %}
          {% set openDuration = states("input_number.heating_number_timer_exec_open_duration_4") %}
        {% endif %}
      {% endif %}

      {# # 返回结果 # #}
      {{ openDuration }}

  condition:
    # 打开状态
    - condition: state
      entity_id: input_boolean.heating_boolean_on_off_1
      state: "on"
      # 自动模式
    - condition: state
      entity_id: input_boolean.heating_boolean_manual_1
      state: "off"
      # 没有倒计时
    - condition: state
      entity_id: input_number.heating_number_open_duration
      state: "0.0"
      # 判断是否需要定时启动
    - condition: template
      value_template: "{{ ( openDuration | float > 0.0 ) }}"


  action:
    # - service: notify.persistent_notification
    #   data:
    #     title: "定时启动暖气"
    #     message: "{{ states('sensor.time') }} 启动暖气 {{ openDuration }} 分"
    # 启动暖气
    - service: input_number.set_value
      data:
        entity_id: input_number.heating_number_open_duration
        value: "{{ openDuration }}"

# ------------------------------------------------------------------------------#
# 打开暖气
# ------------------------------------------------------------------------------#
- alias: "Heating Mode2 Auto Control"
  id: "heating_mode2_auto_control"
  trigger:
    # 每1分钟执行
    - platform: time_pattern
      minutes: "/1"
      seconds: "19"
      # 调整时间/温度执行
    - platform: state
      entity_id:
        - input_boolean.heating_boolean_on_off_1
        - input_boolean.heating_boolean_manual_1
        - input_boolean.heating_boolean_mode2_group_1_switch_1
        - input_boolean.heating_boolean_mode2_group_1_switch_2
        - input_boolean.heating_boolean_mode2_group_1_switch_3
        - input_boolean.heating_boolean_mode2_group_1_switch_4
        - input_boolean.heating_boolean_mode2_group_1_switch_5
        - input_boolean.heating_boolean_mode2_group_2_switch_1
        - input_boolean.heating_boolean_mode2_group_2_switch_2
        - input_boolean.heating_boolean_mode2_group_2_switch_3
        - input_boolean.heating_boolean_mode2_group_2_switch_4
        - input_boolean.heating_boolean_mode2_group_2_switch_5
        - input_datetime.heating_time_mode2_group_1_start_1
        - input_datetime.heating_time_mode2_group_1_start_2
        - input_datetime.heating_time_mode2_group_1_start_3
        - input_datetime.heating_time_mode2_group_1_start_4
        - input_datetime.heating_time_mode2_group_1_start_5
        - input_datetime.heating_time_mode2_group_2_start_1
        - input_datetime.heating_time_mode2_group_2_start_2
        - input_datetime.heating_time_mode2_group_2_start_3
        - input_datetime.heating_time_mode2_group_2_start_4
        - input_datetime.heating_time_mode2_group_2_start_5
        - input_datetime.heating_time_mode2_group_1_end_1
        - input_datetime.heating_time_mode2_group_1_end_2
        - input_datetime.heating_time_mode2_group_1_end_3
        - input_datetime.heating_time_mode2_group_1_end_4
        - input_datetime.heating_time_mode2_group_1_end_5
        - input_datetime.heating_time_mode2_group_2_end_1
        - input_datetime.heating_time_mode2_group_2_end_2
        - input_datetime.heating_time_mode2_group_2_end_3
        - input_datetime.heating_time_mode2_group_2_end_4
        - input_datetime.heating_time_mode2_group_2_end_5
        - input_number.heating_number_mode2_group_1_temp_1
        - input_number.heating_number_mode2_group_1_temp_2
        - input_number.heating_number_mode2_group_1_temp_3
        - input_number.heating_number_mode2_group_1_temp_4
        - input_number.heating_number_mode2_group_1_temp_5
        - input_number.heating_number_mode2_group_2_temp_1
        - input_number.heating_number_mode2_group_2_temp_2
        - input_number.heating_number_mode2_group_2_temp_3
        - input_number.heating_number_mode2_group_2_temp_4
        - input_number.heating_number_mode2_group_2_temp_5
  variables:
    # 星期几
    varWeekDay: >-
      {{ now().isoweekday() }}

    # 工作日/休息日
    varGroup: >-
      {# # 初始化 # #}
      {% set numGroup = "0" %}

      {# # 工作日 # #}
      {% if is_state("input_boolean.heating_boolean_group_1_week_" + varWeekDay | string,"on") %}
        {% set numGroup = "1" %}
      {% endif %}

      {# # 休息日 # #}
      {% if is_state("input_boolean.heating_boolean_group_2_week_" + varWeekDay | string,"on") %}
        {% set numGroup = "2" %}
      {% endif %}

      {# # 返回数据 # #}
      {{ numGroup }}

    # 温度
    varTemperature: >-
      {# # 初始化 # #}
      {% set numTemp = 0.0 %}

      {# # 循环5个时间段 # #}

        {# # 时间段启动 # #}
        {% if is_state("input_boolean.heating_boolean_mode2_group_" + varGroup | string + "_switch_1","on") %}
          {# # 开始<结束 # #}
          {% if states("input_datetime.heating_time_mode2_group_" + varGroup | string + "_start_1") < states("input_datetime.heating_time_mode2_group_" + varGroup | string + "_end_1") %}
            {# # 开始<=现在时间<结束 # #}
            {% if states('sensor.time') >= (state_attr("input_datetime.heating_time_mode2_group_" + varGroup | string + "_start_1",'timestamp') | int | timestamp_custom('%H:%M', False)) %}
              {% if states('sensor.time') < (state_attr("input_datetime.heating_time_mode2_group_" + varGroup | string + "_end_1",'timestamp') | int | timestamp_custom('%H:%M', False)) %}
                {# # 如果设定温度更高 # #}
                {% if states("input_number.heating_number_mode2_group_" + varGroup | string + "_temp_1") | float > numTemp | float %}
                  {# # 设定温度 # #}
                  {% set numTemp = states("input_number.heating_number_mode2_group_" + varGroup | string + "_temp_1") | float %}
                {% endif %}
              {% endif %}
            {% endif %}
          {% endif %}
        {% endif %}

        {# # 时间段启动 # #}
        {% if is_state("input_boolean.heating_boolean_mode2_group_" + varGroup | string + "_switch_2","on") %}
          {# # 开始<结束 # #}
          {% if states("input_datetime.heating_time_mode2_group_" + varGroup | string + "_start_2") < states("input_datetime.heating_time_mode2_group_" + varGroup | string + "_end_2") %}
            {# # 开始<=现在时间<结束 # #}
            {% if states('sensor.time') >= (state_attr("input_datetime.heating_time_mode2_group_" + varGroup | string + "_start_2",'timestamp') | int | timestamp_custom('%H:%M', False)) %}
              {% if states('sensor.time') < (state_attr("input_datetime.heating_time_mode2_group_" + varGroup | string + "_end_2",'timestamp') | int | timestamp_custom('%H:%M', False)) %}
                {# # 如果设定温度更高 # #}
                {% if states("input_number.heating_number_mode2_group_" + varGroup | string + "_temp_2") | float > numTemp | float %}
                  {# # 设定温度 # #}
                  {% set numTemp = states("input_number.heating_number_mode2_group_" + varGroup | string + "_temp_2") | float %}
                {% endif %}
              {% endif %}
            {% endif %}
          {% endif %}
        {% endif %}

        {# # 时间段启动 # #}
        {% if is_state("input_boolean.heating_boolean_mode2_group_" + varGroup | string + "_switch_3","on") %}
          {# # 开始<结束 # #}
          {% if states("input_datetime.heating_time_mode2_group_" + varGroup | string + "_start_3") < states("input_datetime.heating_time_mode2_group_" + varGroup | string + "_end_3") %}
            {# # 开始<=现在时间<结束 # #}
            {% if states('sensor.time') >= (state_attr("input_datetime.heating_time_mode2_group_" + varGroup | string + "_start_3",'timestamp') | int | timestamp_custom('%H:%M', False)) %}
              {% if states('sensor.time') < (state_attr("input_datetime.heating_time_mode2_group_" + varGroup | string + "_end_3",'timestamp') | int | timestamp_custom('%H:%M', False)) %}
                {# # 如果设定温度更高 # #}
                {% if states("input_number.heating_number_mode2_group_" + varGroup | string + "_temp_3") | float > numTemp | float %}
                  {# # 设定温度 # #}
                  {% set numTemp = states("input_number.heating_number_mode2_group_" + varGroup | string + "_temp_3") | float %}
                {% endif %}
              {% endif %}
            {% endif %}
          {% endif %}
        {% endif %}

        {# # 时间段启动 # #}
        {% if is_state("input_boolean.heating_boolean_mode2_group_" + varGroup | string + "_switch_4","on") %}
          {# # 开始<结束 # #}
          {% if states("input_datetime.heating_time_mode2_group_" + varGroup | string + "_start_4") < states("input_datetime.heating_time_mode2_group_" + varGroup | string + "_end_4") %}
            {# # 开始<=现在时间<结束 # #}
            {% if states('sensor.time') >= (state_attr("input_datetime.heating_time_mode2_group_" + varGroup | string + "_start_4",'timestamp') | int | timestamp_custom('%H:%M', False)) %}
              {% if states('sensor.time') < (state_attr("input_datetime.heating_time_mode2_group_" + varGroup | string + "_end_4",'timestamp') | int | timestamp_custom('%H:%M', False)) %}
                {# # 如果设定温度更高 # #}
                {% if states("input_number.heating_number_mode2_group_" + varGroup | string + "_temp_4") | float > numTemp | float %}
                  {# # 设定温度 # #}
                  {% set numTemp = states("input_number.heating_number_mode2_group_" + varGroup | string + "_temp_4") | float %}
                {% endif %}
              {% endif %}
            {% endif %}
          {% endif %}
        {% endif %}

        {# # 时间段启动 # #}
        {% if is_state("input_boolean.heating_boolean_mode2_group_" + varGroup | string + "_switch_5","on") %}
          {# # 开始<结束 # #}
          {% if states("input_datetime.heating_time_mode2_group_" + varGroup | string + "_start_5") < states("input_datetime.heating_time_mode2_group_" + varGroup | string + "_end_5") %}
            {# # 开始<=现在时间<结束 # #}
            {% if states('sensor.time') >= (state_attr("input_datetime.heating_time_mode2_group_" + varGroup | string + "_start_5",'timestamp') | int | timestamp_custom('%H:%M', False)) %}
              {% if states('sensor.time') < (state_attr("input_datetime.heating_time_mode2_group_" + varGroup | string + "_end_5",'timestamp') | int | timestamp_custom('%H:%M', False)) %}
                {# # 如果设定温度更高 # #}
                {% if states("input_number.heating_number_mode2_group_" + varGroup | string + "_temp_5") | float > numTemp | float %}
                  {# # 设定温度 # #}
                  {% set numTemp = states("input_number.heating_number_mode2_group_" + varGroup | string + "_temp_5") | float %}
                {% endif %}
              {% endif %}
            {% endif %}
          {% endif %}
        {% endif %}

      {# # 返回数据 # #}
      {{ numTemp }}

    # Service
    varService: >-
      {# # 初始化 # #}
      {% set varService = "" %}

      {# # 有设定温度 # #}
      {% if varTemperature | float > 0.0 %}
        {# # 判断是否启动燃气炉 # #}
        {% if states('sensor.heating_temperature') | float < ( varTemperature | float - 0.5 ) %}
          {% set varService = "turn_on" %}
        {% endif %}
        {# # 判断是否关闭燃气炉 # #}
        {% if states('sensor.heating_temperature') | float > ( varTemperature | float + 0.5 ) %}
          {% set varService = "turn_off" %}
        {% endif %}
      {% endif %}

      {# # 返回结果 # #}
      {{ varService }}

  condition:
    # 打开状态
    - condition: state
      entity_id: input_boolean.heating_boolean_on_off_1
      state: "on"
      # 自动模式
    - condition: state
      entity_id: input_boolean.heating_boolean_manual_1
      state: "off"
      # 暖气关闭
    # - condition: state
    #   entity_id: switch.cooking_room_heating
    #   state: "off"
    # 判断是否需要控制暖气
    - condition: template
      value_template: >-
        {# # 初始化 # #}
        {% set isHeating = False %}

        {# # 需要打开 and 暖气现在关闭 # #}
        {% if varService == 'turn_on' and is_state("switch.cooking_room_heating","off") %}
          {% set isHeating = True %}
        {% endif %}

        {# # 需要关闭 and 暖气现在打开 # #}
        {% if varService == 'turn_off' and is_state("switch.cooking_room_heating","on") %}
          {% set isHeating = True %}
        {% endif %}

        {# # 返回结果 # #}
        {{ isHeating }}

  action:
    # - service: notify.persistent_notification
    #   data:
    #     title: "var"
    #     message: "Group:{{ varGroup }} Temp:{{ varTemperature }} Service:{{ varService }}"
    - service: "switch.{{ varService }}"
      data:
        entity_id: switch.cooking_room_heating





评分

参与人数 1金钱 +10 收起 理由
yylwhy + 10 多谢分享。能否传附件,代码要该好多空格.

查看全部评分

回复

使用道具 举报

17

主题

798

帖子

5728

积分

论坛元老

Rank: 8Rank: 8

积分
5728
金钱
4925
HASS币
0
发表于 2020-12-6 09:31:38 | 显示全部楼层
本帖最后由 sirakawa 于 2020-12-6 09:33 编辑

UI的话,直接YAML贴上来这样。
- type: vertical-stack
  cards:

  - type: horizontal-stack
    cards:

    - type: sensor
      name: "温度"
      entity: sensor.heating_temperature
      graph: line
      icon: mdi:home-thermometer-outline

    - type: glance
      title: 传感器
      entities:
        - entity: sensor.heating_temp_sensor_count
        - entity: sensor.time
          name: 时间
        - entity: binary_sensor.cooking_room_heating_status
          double_tap_action: 
            action: call-service
            service: switch.toggle
            service_data:
              entity_id: switch.cooking_room_heating

  - type: entities
    title: 温控器控制
    show_header_toggle: false
    entities:
      - entity: input_boolean.heating_boolean_on_off_1
      - entity: input_boolean.heating_boolean_manual_1
        # type: "custom:secondaryinfo-entity-row"
        # secondary_info: "[[ (input_boolean.heating_boolean_manual_1.last_changed | int | timestamp_custom('%H:%M', False)) ]]"
      - entity: input_number.heating_number_temp_manual_1
      - entity: input_number.heating_number_open_duration
      # - sensor.heating_timer_remaining
      # - input_number.heating_number_save_temp_manual

  - type: custom:vertical-stack-in-card
    cards:

    - type: markdown
      content: >-
        <font size='5'>定时启动</font>

    - type: horizontal-stack
      cards:

      - type: glance
        columns: 3
        entities:
          - entity: input_boolean.heating_boolean_timer_exec_switch_1
            name: "开关"
            icon: "mdi:numeric-1-circle-outline"
          - entity: input_datetime.heating_time_timer_exec_start_time_1
            name: "启动时间"
          - entity: input_number.heating_number_timer_exec_open_duration_1
            name: "持续时间"
      - type: glance
        columns: 3
        entities:
          - entity: input_boolean.heating_boolean_timer_exec_switch_2
            name: "开关"
            icon: "mdi:numeric-2-circle-outline"
          - entity: input_datetime.heating_time_timer_exec_start_time_2
            name: "启动时间"
          - entity: input_number.heating_number_timer_exec_open_duration_2
            name: "持续时间"

    - type: horizontal-stack
      cards:

      - type: glance
        columns: 3
        show_name: false
        entities:
          - entity: input_boolean.heating_boolean_timer_exec_switch_3
            icon: "mdi:numeric-3-circle-outline"
          - entity: input_datetime.heating_time_timer_exec_start_time_3
          - entity: input_number.heating_number_timer_exec_open_duration_3
      - type: glance
        columns: 3
        show_name: false
        entities:
          - entity: input_boolean.heating_boolean_timer_exec_switch_4
            icon: "mdi:numeric-4-circle-outline"
          - entity: input_datetime.heating_time_timer_exec_start_time_4
          - entity: input_number.heating_number_timer_exec_open_duration_4




- type: vertical-stack
  cards:


  - type: glance
    title: 工作日设定
    columns: 7
    show_header_toggle: false
    entities:
    - entity: input_boolean.heating_boolean_group_1_week_1
      icon: mdi:numeric-1-box
    - entity: input_boolean.heating_boolean_group_1_week_2
      icon: mdi:numeric-2-box
    - entity: input_boolean.heating_boolean_group_1_week_3
      icon: mdi:numeric-3-box
    - entity: input_boolean.heating_boolean_group_1_week_4
      icon: mdi:numeric-4-box
    - entity: input_boolean.heating_boolean_group_1_week_5
      icon: mdi:numeric-5-box
    - entity: input_boolean.heating_boolean_group_1_week_6
      icon: mdi:numeric-6-box
    - entity: input_boolean.heating_boolean_group_1_week_7
      icon: mdi:numeric-7-box


    # MODE2
  - type: custom:vertical-stack-in-card
    cards:

    - type: glance
      columns: 4
      entities:
        - entity: input_boolean.heating_boolean_mode2_group_1_switch_1
          name: "开关"
          icon: "mdi:numeric-1-circle-outline"
        - entity: input_datetime.heating_time_mode2_group_1_start_1
          name: "开始时间"
        - entity: input_datetime.heating_time_mode2_group_1_end_1
          name: "结束时间"
        - entity: input_number.heating_number_mode2_group_1_temp_1
          name: "温度"

    - type: glance
      show_name: false
      columns: 4
      entities:
        - entity: input_boolean.heating_boolean_mode2_group_1_switch_2
          icon: "mdi:numeric-2-circle-outline"
        - entity: input_datetime.heating_time_mode2_group_1_start_2
        - entity: input_datetime.heating_time_mode2_group_1_end_2
        - entity: input_number.heating_number_mode2_group_1_temp_2

    - type: glance
      show_name: false
      columns: 4
      entities:
        - entity: input_boolean.heating_boolean_mode2_group_1_switch_3
          icon: "mdi:numeric-3-circle-outline"
        - entity: input_datetime.heating_time_mode2_group_1_start_3
        - entity: input_datetime.heating_time_mode2_group_1_end_3
        - entity: input_number.heating_number_mode2_group_1_temp_3

    - type: glance
      show_name: false
      columns: 4
      entities:
        - entity: input_boolean.heating_boolean_mode2_group_1_switch_4
          icon: "mdi:numeric-4-circle-outline"
        - entity: input_datetime.heating_time_mode2_group_1_start_4
        - entity: input_datetime.heating_time_mode2_group_1_end_4
        - entity: input_number.heating_number_mode2_group_1_temp_4

    - type: glance
      show_name: false
      columns: 4
      entities:
        - entity: input_boolean.heating_boolean_mode2_group_1_switch_5
          icon: "mdi:numeric-5-circle-outline"
        - entity: input_datetime.heating_time_mode2_group_1_start_5
        - entity: input_datetime.heating_time_mode2_group_1_end_5
        - entity: input_number.heating_number_mode2_group_1_temp_5

- type: vertical-stack
  cards:


  - type: glance
    title: 休息日设定
    columns: 7
    show_header_toggle: false
    entities:
    - entity: input_boolean.heating_boolean_group_2_week_1
      icon: mdi:numeric-1-box
    - entity: input_boolean.heating_boolean_group_2_week_2
      icon: mdi:numeric-2-box
    - entity: input_boolean.heating_boolean_group_2_week_3
      icon: mdi:numeric-3-box
    - entity: input_boolean.heating_boolean_group_2_week_4
      icon: mdi:numeric-4-box
    - entity: input_boolean.heating_boolean_group_2_week_5
      icon: mdi:numeric-5-box
    - entity: input_boolean.heating_boolean_group_2_week_6
      icon: mdi:numeric-6-box
    - entity: input_boolean.heating_boolean_group_2_week_7
      icon: mdi:numeric-7-box

    # MODE2
  - type: custom:vertical-stack-in-card
    cards:

    - type: glance
      columns: 4
      entities:
        - entity: input_boolean.heating_boolean_mode2_group_2_switch_1
          name: "开关"
          icon: "mdi:numeric-1-circle-outline"
        - entity: input_datetime.heating_time_mode2_group_2_start_1
          name: "开始时间"
        - entity: input_datetime.heating_time_mode2_group_2_end_1
          name: "结束时间"
        - entity: input_number.heating_number_mode2_group_2_temp_1
          name: "温度"

    - type: glance
      show_name: false
      columns: 4
      entities:
        - entity: input_boolean.heating_boolean_mode2_group_2_switch_2
          icon: "mdi:numeric-2-circle-outline"
        - entity: input_datetime.heating_time_mode2_group_2_start_2
        - entity: input_datetime.heating_time_mode2_group_2_end_2
        - entity: input_number.heating_number_mode2_group_2_temp_2

    - type: glance
      show_name: false
      columns: 4
      entities:
        - entity: input_boolean.heating_boolean_mode2_group_2_switch_3
          icon: "mdi:numeric-3-circle-outline"
        - entity: input_datetime.heating_time_mode2_group_2_start_3
        - entity: input_datetime.heating_time_mode2_group_2_end_3
        - entity: input_number.heating_number_mode2_group_2_temp_3

    - type: glance
      show_name: false
      columns: 4
      entities:
        - entity: input_boolean.heating_boolean_mode2_group_2_switch_4
          icon: "mdi:numeric-4-circle-outline"
        - entity: input_datetime.heating_time_mode2_group_2_start_4
        - entity: input_datetime.heating_time_mode2_group_2_end_4
        - entity: input_number.heating_number_mode2_group_2_temp_4

    - type: glance
      show_name: false
      columns: 4
      entities:
        - entity: input_boolean.heating_boolean_mode2_group_2_switch_5
          icon: "mdi:numeric-5-circle-outline"
        - entity: input_datetime.heating_time_mode2_group_2_start_5
        - entity: input_datetime.heating_time_mode2_group_2_end_5
        - entity: input_number.heating_number_mode2_group_2_temp_5
回复

使用道具 举报

0

主题

201

帖子

2709

积分

金牌会员

Rank: 6Rank: 6

积分
2709
金钱
2508
HASS币
0
发表于 2020-12-8 13:50:28 来自手机 | 显示全部楼层
sirakawa 发表于 2020-12-2 21:09
基本还是每分钟判断就好了。低了就开高了就关。区间看自己习惯,我是前后0.5度。
需要多个传感器就加起来除 ...

你好这个是什么定时器能否分享下,谢谢。
回复

使用道具 举报

9

主题

527

帖子

2350

积分

金牌会员

Rank: 6Rank: 6

积分
2350
金钱
1823
HASS币
0
 楼主| 发表于 2020-12-8 17:18:45 | 显示全部楼层
点来点去 发表于 2020-12-8 13:50
你好这个是什么定时器能否分享下,谢谢。

https://www.home-assistant.io/integrations/generic_thermostat/


说的这个吧
回复

使用道具 举报

1

主题

83

帖子

1001

积分

金牌会员

Rank: 6Rank: 6

积分
1001
金钱
918
HASS币
0
发表于 2021-8-12 16:55:23 | 显示全部楼层
sirakawa 发表于 2020-12-6 09:21
定时启动以及自动控制的核心基本下面这2个自动化。
模板一部分循环没搞定所以单独写的。。。。
看其他回答 ...

大佬,请问这这两个代码怎么用?我把控制代码添加到自动化后,再把ui添加到lovelace,但是全是黄色的感叹号,并没有实体可以用,比如input_boolean.heating_boolean_on_off_1之类的
回复

使用道具 举报

105

主题

2954

帖子

1万

积分

超级版主

智能家居&单板滑雪痴迷爱好者

Rank: 8Rank: 8

积分
12103
金钱
9084
HASS币
460

教程狂人突出贡献

发表于 2021-8-12 19:21:56 | 显示全部楼层
建议还是用ha自带的“Generic Thermostat”组件,然后用自动化控制这个虚拟温控器的目标温度和开关,远比自己撸自动化要简洁,也不容易出错。

当然,如果有专用的温控器硬件,支持ha的话也是很好的选择。
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-23 04:36 , Processed in 0.090943 second(s), 32 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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