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

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

[插件集成] 2024 Homeassistant 国家电网电费获取

  [复制链接]

0

主题

7

帖子

58

积分

注册会员

Rank: 2

积分
58
金钱
51
HASS币
0
发表于 前天 20:15 | 显示全部楼层
billzlw 发表于 2025-1-6 12:54
我也想知道过七日和每月电量如何变成实体

之前的版本好像有问题,你删除文件夹重新来一遍就好了
回复

使用道具 举报

0

主题

3

帖子

28

积分

新手上路

Rank: 1

积分
28
金钱
25
HASS币
0
发表于 前天 23:10 | 显示全部楼层
有没有add-on 详细教程啊,小白学起来好累
回复

使用道具 举报

13

主题

130

帖子

1032

积分

金牌会员

Rank: 6Rank: 6

积分
1032
金钱
902
HASS币
0
发表于 昨天 09:54 | 显示全部楼层
本帖最后由 gmmy1979 于 2025-1-7 10:00 编辑
fenglingbear 发表于 2024-12-26 14:13
设置----加载项----加载项商店右下角----selenium_electricity,下载好了,然后按开发者提示添加yaml,重 ...

1.png 2.png
3.png

老大帮忙看下啥原因呢,都是按步骤来的,但显示未知是啥情况呢。

回复

使用道具 举报

1

主题

36

帖子

248

积分

中级会员

Rank: 3Rank: 3

积分
248
金钱
212
HASS币
0
发表于 昨天 10:39 | 显示全部楼层
gmmy1979 发表于 2025-1-7 09:54
老大帮忙看下啥原因呢,都是按步骤来的,但显示未知是啥情况呢。

...

一样的问题,addon日志里面看到都获取到了,但是放到卡片里面都是显示unknown
回复

使用道具 举报

2

主题

75

帖子

322

积分

中级会员

Rank: 3Rank: 3

积分
322
金钱
247
HASS币
0
发表于 昨天 11:03 | 显示全部楼层
gmmy1979 发表于 2025-1-7 09:54
老大帮忙看下啥原因呢,都是按步骤来的,但显示未知是啥情况呢。

...
template:
  - trigger:
      - platform: event
        event_type: "state_changed"
        event_data: 
          entity_id: sensor.electricity_95598
    sensor:
      - name: electricity_charge_balance_entity
        unique_id: electricity_charge_balance_entity
        state: "{{ states('sensor.electricity_95598') }}"
        unit_of_measurement: "CNY"
        device_class: monetary

      - name: electricity_balance_is_pay_entity
        unique_id: electricity_balance_is_pay_entity
        state: "{{ state_attr('sensor.electricity_95598', 'is_pay') }}"
 
      - name: last_electricity_usage_entity
        unique_id: last_electricity_usage_entity
        state: "{{ state_attr('sensor.electricity_95598', 'last_electricity_usage') }}"
        state_class: measurement
        unit_of_measurement: "kWh"

      - name: yearly_electricity_usage_entity
        unique_id: yearly_electricity_usage_entity
        state: "{{ state_attr('sensor.electricity_95598', 'yearly_electricity_usage') }}"
        state_class: measurement
        unit_of_measurement: "kWh"

      - name: yearly_electricity_charge_entity
        unique_id: yearly_electricity_charge_entity
        state: "{{ state_attr('sensor.electricity_95598', 'yearly_electricity_charge') }}"
        unit_of_measurement: "CNY"
        device_class: monetary
        
      - name: electricity_need_pay
        unique_id: electricity_need_pay
        state: "{{ state_attr('sensor.electricity_95598', 'need_pay') }}"
        unit_of_measurement: "CNY"
        device_class: monetary
        
      - name: thismonth_electricity_usage_entity
        unique_id: thismonth_electricity_usage_entity
        state: "{{ state_attr('sensor.electricity_95598', 'thismonth_electricity_usage') }}"
        state_class: measurement
        unit_of_measurement: "kWh"
        
      - name: electricity_last_date_entity
        unique_id: electricity_last_date_entity
        state: "{{ state_attr('sensor.electricity_95598', 'last_date') }}"


回复

使用道具 举报

1

主题

16

帖子

180

积分

注册会员

Rank: 2

积分
180
金钱
164
HASS币
0
发表于 昨天 11:43 | 显示全部楼层

重新去仓库看一下最新的configuration.yaml说明,之前的实体名称有错误应该是,重新复制过来改一下试试
回复

使用道具 举报

2

主题

75

帖子

322

积分

中级会员

Rank: 3Rank: 3

积分
322
金钱
247
HASS币
0
发表于 昨天 13:10 | 显示全部楼层
回复

使用道具 举报

2

主题

27

帖子

122

积分

注册会员

Rank: 2

积分
122
金钱
95
HASS币
0
发表于 昨天 17:35 | 显示全部楼层
我运行出这个错误是什么意思
sgcc_electricity        | 2025-01-07 17:31:48  [ERROR   ] ---- Homeassistant REST API invoke failed, reason is HTTPConnectionPool(host='192.168.10.251', port=8123): Max retries exceeded with url: /api/states/sensor.electricity_charge_balance_5501 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ac94aa5cdd0>: Failed to establish a new connection: [Errno 111] Connection refused'))
sgcc_electricity        | 2025-01-07 17:31:48  [INFO    ] ---- Homeassistant sensor sensor.electricity_charge_balance_5501 state updated: 117.88 CNY
sgcc_electricity        | 2025-01-07 17:31:48  [ERROR   ] ---- Homeassistant REST API invoke failed, reason is HTTPConnectionPool(host='192.168.10.251', port=8123): Max retries exceeded with url: /api/states/sensor.last_electricity_usage_5501 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ac94aa7b6d0>: Failed to establish a new connection: [Errno 111] Connection refused'))
sgcc_electricity        | 2025-01-07 17:31:48  [INFO    ] ---- Homeassistant sensor sensor.last_electricity_usage_5501 state updated: 2.42 kWh
sgcc_electricity        | 2025-01-07 17:31:48  [ERROR   ] ---- Homeassistant REST API invoke failed, reason is HTTPConnectionPool(host='192.168.10.251', port=8123): Max retries exceeded with url: /api/states/sensor.yearly_electricity_usage_5501 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ac94aa4cc90>: Failed to establish a new connection: [Errno 111] Connection refused'))
sgcc_electricity        | 2025-01-07 17:31:48  [INFO    ] ---- Homeassistant sensor sensor.yearly_electricity_usage_5501 state updated: 2286 kWh
sgcc_electricity        | 2025-01-07 17:31:48  [ERROR   ] ---- Homeassistant REST API invoke failed, reason is HTTPConnectionPool(host='192.168.10.251', port=8123): Max retries exceeded with url: /api/states/sensor.yearly_electricity_charge_5501 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ac94aa86290>: Failed to establish a new connection: [Errno 111] Connection refused'))
sgcc_electricity        | 2025-01-07 17:31:48  [INFO    ] ---- Homeassistant sensor sensor.yearly_electricity_charge_5501 state updated: 1195.02 CNY
sgcc_electricity        | 2025-01-07 17:31:48  [ERROR   ] ---- Homeassistant REST API invoke failed, reason is HTTPConnectionPool(host='192.168.10.251', port=8123): Max retries exceeded with url: /api/states/sensor.month_electricity_usage_5501 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ac94aa84f10>: Failed to establish a new connection: [Errno 111] Connection refused'))
sgcc_electricity        | 2025-01-07 17:31:48  [INFO    ] ---- Homeassistant sensor sensor.month_electricity_usage_5501 state updated: 112 kWh
sgcc_electricity        | 2025-01-07 17:31:48  [ERROR   ] ---- Homeassistant REST API invoke failed, reason is HTTPConnectionPool(host='192.168.10.251', port=8123): Max retries exceeded with url: /api/states/sensor.month_electricity_charge_5501 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ac94aa7a710>: Failed to establish a new connection: [Errno 111] Connection refused'))
回复

使用道具 举报

0

主题

31

帖子

153

积分

注册会员

Rank: 2

积分
153
金钱
122
HASS币
0
发表于 昨天 19:34 | 显示全部楼层

这段代码放什么位置
回复

使用道具 举报

0

主题

31

帖子

153

积分

注册会员

Rank: 2

积分
153
金钱
122
HASS币
0
发表于 昨天 19:42 | 显示全部楼层

仓库数据都获取成功,怎么加卡片,全报错
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2025-1-8 11:24 , Processed in 0.117513 second(s), 33 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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