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

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

[新奇玩法] 我也来个电费插件(RN流)-浙江

  [复制链接]

0

主题

164

帖子

894

积分

高级会员

Rank: 4

积分
894
金钱
730
HASS币
0
发表于 2021-7-9 10:42:15 | 显示全部楼层
有南方电网的就完美了
回复

使用道具 举报

0

主题

9

帖子

335

积分

中级会员

Rank: 3Rank: 3

积分
335
金钱
326
HASS币
0
发表于 2021-7-12 21:35:50 | 显示全部楼层
楼主电费插件卡片样式美观  不知道能不能共享一下配置代码?
回复

使用道具 举报

41

主题

1288

帖子

5310

积分

论坛元老

Rank: 8Rank: 8

积分
5310
金钱
4017
HASS币
20
发表于 2021-7-12 22:56:37 | 显示全部楼层
有没有上海的,我抓包没抓到啥信息
折腾精神永存,感恩感谢论坛每一位愿意分享和帮助过我的大佬,论坛有你更精彩
回复

使用道具 举报

9

主题

157

帖子

2108

积分

金牌会员

Rank: 6Rank: 6

积分
2108
金钱
1951
HASS币
10
 楼主| 发表于 2021-7-13 10:23:06 | 显示全部楼层
wight3 发表于 2021-7-12 21:35
楼主电费插件卡片样式美观  不知道能不能共享一下配置代码?
type: grid
cards:
  - type: entities
    state_color: true
    show_header_toggle: false
    entities:
      - entity: sensor.dayelectricity
        type: custom:multiple-entity-row
        secondary_info: last-changed
        name: 昨日用电
        entities:
          - attribute: f
            name: 峰
          - attribute: g
            name: 谷
      - entity: sensor.dayelectricityprice
        type: custom:multiple-entity-row
        entities:
          - attribute: daypricef
            name: 峰
          - attribute: daypriceg
            name: 谷
        name: 昨日用电
      - entity: sensor.monthelectricity
        type: custom:multiple-entity-row
        name: 月度用电
        entities:
          - attribute: f
            name: 峰
          - attribute: g
            name: 谷
      - entity: sensor.monthelectricityprice
        type: custom:multiple-entity-row
        name: 月度用电
        entities:
          - attribute: monthpricef
            name: 峰
          - attribute: monthpriceg
            name: 谷
      - entity: sensor.yearelectricity
        name: 年度用电
      - type: custom:bar-card
        width: 45%
        height: 2em
        decimal: 0
        unit_of_measurement: '%'
        positions:
          icon: outside
          indicator: 'off'
          name: outside
        severity:
          - color: Green
            from: 0
            to: 25
          - color: Orange
            from: 26
            to: 50
          - color: Red
            from: 51
            to: 100
        entity_row: true
        entities:
          - entity: sensor.electricity_first
          - entity: sensor.electricity_second
      - type: custom:bar-card
        width: 45%
        height: 2em
        decimal: 0
        unit_of_measurement: 度
        positions:
          icon: outside
          indicator: 'off'
          name: outside
        severity:
          - color: '#303435'
            from: 11
            to: 100
          - color: '#6d2525'
            from: 0
            to: 10
        entity_row: true
        entities:
          - entity: sensor.electricity_thired
columns: 1
square: false
type: custom:apexcharts-card
graph_span: 30d
locale: zh-cn
all_series_config:
  stroke_width: 2
  opacity: 0.8
  type: line
header:
  show: true
  title: 用电情况
  show_states: true
  colorize_states: true
series:
  - entity: sensor.historyelectricity
    name: 峰用电
    data_generator: |
      return entity.attributes.history.map((peak, index) => {
        return [peak.DATETIME, peak.ZXYGZ2];
      });
  - entity: sensor.historyelectricity
    name: 谷用电
    data_generator: |
      return entity.attributes.history.map((peak, index) => {
        return [peak.DATETIME, peak.ZXYGZ4];
      });
  - entity: sensor.historyelectricity
    name: 全天用电
    data_generator: |
      return entity.attributes.history.map((peak, index) => {
        return [peak.DATETIME, peak.ZXYGZ];
      });

回复

使用道具 举报

0

主题

2

帖子

12

积分

新手上路

Rank: 1

积分
12
金钱
10
HASS币
0
发表于 2021-7-13 16:16:22 | 显示全部楼层
dscao 发表于 2021-7-1 09:47
https://bbs.hassbian.com/forum.php?mod=viewthread&tid=13414
也发个帖子分享了一下安徽的电费查询 ...

大佬,同是安徽,帖子等级不够看不了,能否修改下?
回复

使用道具 举报

0

主题

98

帖子

564

积分

高级会员

Rank: 4

积分
564
金钱
466
HASS币
0
发表于 2021-7-13 17:50:19 | 显示全部楼层
同浙江,感谢,折腾折腾看看
回复

使用道具 举报

0

主题

98

帖子

564

积分

高级会员

Rank: 4

积分
564
金钱
466
HASS币
0
发表于 2021-7-13 17:52:58 | 显示全部楼层
同浙江,感谢,折腾折腾看看
回复

使用道具 举报

0

主题

98

帖子

564

积分

高级会员

Rank: 4

积分
564
金钱
466
HASS币
0
发表于 2021-7-14 10:48:55 | 显示全部楼层

你好,请问你这个问题解决了吗?我这边也是一样的问题,同样是计算电费那步。
TypeError: Cannot read property 'f' of undefined
回复

使用道具 举报

0

主题

98

帖子

564

积分

高级会员

Rank: 4

积分
564
金钱
466
HASS币
0
发表于 2021-7-14 11:01:31 | 显示全部楼层
调试了一下,好像把计算模块里的playload改成data就好了
回复

使用道具 举报

0

主题

98

帖子

564

积分

高级会员

Rank: 4

积分
564
金钱
466
HASS币
0
发表于 2021-7-14 14:30:20 | 显示全部楼层
折腾一中午,终于好了,再次感谢楼主分享
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-4-26 15:22 , Processed in 0.193732 second(s), 36 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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