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

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

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

  [复制链接]

0

主题

7

帖子

62

积分

注册会员

Rank: 2

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

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

使用道具 举报

0

主题

6

帖子

55

积分

注册会员

Rank: 2

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

使用道具 举报

14

主题

133

帖子

1060

积分

金牌会员

Rank: 6Rank: 6

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

1.png 2.png
3.png

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

回复

使用道具 举报

1

主题

41

帖子

312

积分

中级会员

Rank: 3Rank: 3

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

...

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

使用道具 举报

2

主题

77

帖子

356

积分

中级会员

Rank: 3Rank: 3

积分
356
金钱
279
HASS币
0
发表于 2025-1-7 11:03:18 | 显示全部楼层
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

主题

22

帖子

242

积分

中级会员

Rank: 3Rank: 3

积分
242
金钱
220
HASS币
0
发表于 2025-1-7 11:43:43 | 显示全部楼层

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

使用道具 举报

2

主题

77

帖子

356

积分

中级会员

Rank: 3Rank: 3

积分
356
金钱
279
HASS币
0
发表于 2025-1-7 13:10:50 | 显示全部楼层
回复

使用道具 举报

2

主题

34

帖子

194

积分

注册会员

Rank: 2

积分
194
金钱
160
HASS币
0
发表于 2025-1-7 17:35:53 | 显示全部楼层
我运行出这个错误是什么意思
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

主题

63

帖子

303

积分

中级会员

Rank: 3Rank: 3

积分
303
金钱
240
HASS币
0
发表于 2025-1-7 19:34:48 | 显示全部楼层

这段代码放什么位置
回复

使用道具 举报

0

主题

63

帖子

303

积分

中级会员

Rank: 3Rank: 3

积分
303
金钱
240
HASS币
0
发表于 2025-1-7 19:42:48 | 显示全部楼层

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

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2025-3-4 22:50 , Processed in 1.325726 second(s), 33 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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