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

[基础教程] 家庭智能电表方案esp8266

 火.. [复制链接]

7

主题

156

回帖

1410

积分

金牌会员

积分
1410
金钱
1247
HASS币
0
发表于 2024-4-3 11:12:00 | 显示全部楼层
我这个数据算准吗? 微信图片_20240403101959.png
回复

使用道具 举报

175

主题

2601

回帖

8683

积分

元老级技术达人

积分
8683
金钱
5902
HASS币
30
 楼主| 发表于 2024-4-3 12:04:45 | 显示全部楼层
fenglou777 发表于 2024-4-3 11:12
我这个数据算准吗?

很准了,我100元不到的电费,就会误差2块
回复

使用道具 举报

9

主题

53

回帖

349

积分

中级会员

积分
349
金钱
287
HASS币
0
发表于 2024-10-14 18:03:20 | 显示全部楼层
正需要,找哪家买?
回复

使用道具 举报

175

主题

2601

回帖

8683

积分

元老级技术达人

积分
8683
金钱
5902
HASS币
30
 楼主| 发表于 2024-10-14 18:46:18 | 显示全部楼层
cdsinyh 发表于 2024-10-14 18:03
正需要,找哪家买?

咸鱼自己找找
回复

使用道具 举报

4

主题

48

回帖

454

积分

中级会员

积分
454
金钱
402
HASS币
0
发表于 2025-5-14 10:51:16 | 显示全部楼层
大佬,图片中那个当前阶梯情况百分比是怎么搞的?
回复

使用道具 举报

9

主题

53

回帖

349

积分

中级会员

积分
349
金钱
287
HASS币
0
发表于 2025-5-14 11:28:45 | 显示全部楼层
如何进入固件代码?
回复

使用道具 举报

175

主题

2601

回帖

8683

积分

元老级技术达人

积分
8683
金钱
5902
HASS币
30
 楼主| 发表于 2025-5-14 11:35:51 | 显示全部楼层
fanjiayun 发表于 2025-5-14 10:51
大佬,图片中那个当前阶梯情况百分比是怎么搞的?

自己写代码计算


{% if states("sensor.jin_nian_dian_liang") | float <= 2760 %}
           {{ (states("sensor.jin_nian_dian_liang") |round/2760*100)|round}}%、0%、0%
          {% elif states("sensor.jin_nian_dian_liang") | float >2760  and states("sensor.jin_nian_dian_liang") | float <= 4800 %}
          100%、{{ ((states("sensor.jin_nian_dian_liang") |round-2760)/2040*100)|round}}%、0%
          {% elif states("sensor.jin_nian_dian_liang") | float > 4800 %}
          100%、100%、{{(states("sensor.jin_nian_dian_liang") |round-4800)}}度
          {% endif %}


回复

使用道具 举报

175

主题

2601

回帖

8683

积分

元老级技术达人

积分
8683
金钱
5902
HASS币
30
 楼主| 发表于 2025-5-14 11:36:24 | 显示全部楼层
cdsinyh 发表于 2025-5-14 11:28
如何进入固件代码?

没有看懂意思
回复

使用道具 举报

4

主题

48

回帖

454

积分

中级会员

积分
454
金钱
402
HASS币
0
发表于 2025-5-14 11:55:17 | 显示全部楼层

感谢感谢
回复

使用道具 举报

4

主题

48

回帖

454

积分

中级会员

积分
454
金钱
402
HASS币
0
发表于 2025-5-15 14:34:35 | 显示全部楼层
本帖最后由 fanjiayun 于 2025-5-15 14:35 编辑
alias: 电价阶梯自动切换
description: 根据当前月份、用电量阶梯和峰谷时段自动切换电价
triggers:
  - entity_id: sensor.dang_qian_jie_ti
    trigger: state
  - at: "07:00:00"
    trigger: time
  - at: "23:00:00"
    trigger: time
conditions: []
actions:
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ 5 < now().month < 11 }}"
          - condition: state
            entity_id: sensor.dang_qian_jie_ti
            state: "1"
          - condition: time
            after: "07:00:00"
            before: "23:00:00"
        sequence:
          - data:
              option: peak
            target:
              entity_id:
                - select.daily_use
                - select.monthly_use
                - select.yearly_use
            action: select.select_option
      - conditions:
          - condition: template
            value_template: "{{ 5 < now().month < 11 }}"
          - condition: state
            entity_id: sensor.dang_qian_jie_ti
            state: "1"
          - condition: time
            after: "23:00:00"
            before: "07:00:00"
        sequence:
          - data:
              option: offpeak
            target:
              entity_id:
                - select.daily_use
                - select.monthly_use
                - select.yearly_use
            action: select.select_option
      - conditions:
          - condition: template
            value_template: "{{ 5 < now().month < 11 }}"
          - condition: state
            entity_id: sensor.dang_qian_jie_ti
            state: "2"
          - condition: time
            after: "07:00:00"
            before: "23:00:00"
        sequence:
          - data:
              option: peak2
            target:
              entity_id:
                - select.daily_use
                - select.monthly_use
                - select.yearly_use
            action: select.select_option
      - conditions:
          - condition: template
            value_template: "{{ 5 < now().month < 11 }}"
          - condition: state
            entity_id: sensor.dang_qian_jie_ti
            state: "2"
          - condition: time
            after: "23:00:00"
            before: "07:00:00"
        sequence:
          - data:
              option: offpeak2
            target:
              entity_id:
                - select.daily_use
                - select.monthly_use
                - select.yearly_use
            action: select.select_option
      - conditions:
          - condition: template
            value_template: "{{ 5 < now().month < 11 }}"
          - condition: state
            entity_id: sensor.dang_qian_jie_ti
            state: "3"
          - condition: time
            after: "07:00:00"
            before: "23:00:00"
        sequence:
          - data:
              option: peak3
            target:
              entity_id:
                - select.daily_use
                - select.monthly_use
                - select.yearly_use
            action: select.select_option
      - conditions:
          - condition: template
            value_template: "{{ 5 < now().month < 11 }}"
          - condition: state
            entity_id: sensor.dang_qian_jie_ti
            state: "3"
          - condition: time
            after: "23:00:00"
            before: "07:00:00"
        sequence:
          - data:
              option: offpeak3
            target:
              entity_id:
                - select.daily_use
                - select.monthly_use
                - select.yearly_use
            action: select.select_option
      - conditions:
          - condition: template
            value_template: "{{ not (5 < now().month < 11) }}"
          - condition: state
            entity_id: sensor.dang_qian_jie_ti
            state: "4"
          - condition: time
            after: "07:00:00"
            before: "23:00:00"
        sequence:
          - data:
              option: peak4
            target:
              entity_id:
                - select.daily_use
                - select.monthly_use
                - select.yearly_use
            action: select.select_option
      - conditions:
          - condition: template
            value_template: "{{ not (5 < now().month < 11) }}"
          - condition: state
            entity_id: sensor.dang_qian_jie_ti
            state: "4"
          - condition: time
            after: "23:00:00"
            before: "07:00:00"
        sequence:
          - data:
              option: offpeak4
            target:
              entity_id:
                - select.daily_use
                - select.monthly_use
                - select.yearly_use
            action: select.select_option
      - conditions:
          - condition: template
            value_template: "{{ not (5 < now().month < 11) }}"
          - condition: state
            entity_id: sensor.dang_qian_jie_ti
            state: "5"
          - condition: time
            after: "07:00:00"
            before: "23:00:00"
        sequence:
          - data:
              option: peak5
            target:
              entity_id:
                - select.daily_use
                - select.monthly_use
                - select.yearly_use
            action: select.select_option
      - conditions:
          - condition: template
            value_template: "{{ not (5 < now().month < 11) }}"
          - condition: state
            entity_id: sensor.dang_qian_jie_ti
            state: "5"
          - condition: time
            after: "23:00:00"
            before: "07:00:00"
        sequence:
          - data:
              option: offpeak5
            target:
              entity_id:
                - select.daily_use
                - select.monthly_use
                - select.yearly_use
            action: select.select_option
      - conditions:
          - condition: template
            value_template: "{{ not (5 < now().month < 11) }}"
          - condition: state
            entity_id: sensor.dang_qian_jie_ti
            state: "6"
          - condition: time
            after: "07:00:00"
            before: "23:00:00"
        sequence:
          - data:
              option: peak6
            target:
              entity_id:
                - select.daily_use
                - select.monthly_use
                - select.yearly_use
            action: select.select_option
      - conditions:
          - condition: template
            value_template: "{{ not (5 < now().month < 11) }}"
          - condition: state
            entity_id: sensor.dang_qian_jie_ti
            state: "6"
          - condition: time
            after: "23:00:00"
            before: "07:00:00"
        sequence:
          - data:
              option: offpeak6
            target:
              entity_id:
                - select.daily_use
                - select.monthly_use
                - select.yearly_use
            action: select.select_option
    default:
      - data:
          title: 电价切换异常
          message: 未匹配到有效的电价阶梯条件
        action: persistent_notification.create
mode: single
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )

GMT+8, 2025-6-3 00:27 , Processed in 0.121268 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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