ARC-MX / sgcc_electricity_new

HomeAssistant 国家电网电费查询
Apache License 2.0
86 stars 11 forks source link

大佬可以贴一下HA里数据展示的代码吗? #15

Open HiMyCocoo opened 4 days ago

HiMyCocoo commented 4 days ago

即下面这个,自己写的感觉很丑想学习下,谢谢 https://github.com/ARC-MX/sgcc_electricity_new/blob/master/assets/image-20230731111757106.png?raw=true

ARC-MX commented 3 days ago
type: vertical-stack
cards:
  - type: custom:mini-graph-card
    entities:
      - entity: sensor.last_electricity_usage_entity
        name: 国网每日用电量
        aggregate_func: first
        show_state: true
        show_points: true
    group_by: date
    hour24: true
    hours_to_show: 240
  - type: horizontal-stack
    cards:
      - graph: none
        type: sensor
        entity: sensor.month_electricity_charge_entity
        detail: 1
        name: 上月电费
        icon: ''
        unit: 元
      - graph: none
        type: sensor
        entity: sensor.month_electricity_usage_entity
        detail: 1
        name: 上月用电量
        unit: 度
        icon: mdi:lightning-bolt-outline
  - type: horizontal-stack
    cards:
      - graph: none
        type: sensor
        entity: sensor.electricity_charge_balance_entity
        detail: 1
        name: 电费余额
        icon: mdi:cash-100
        unit: 元
      - graph: none
        type: sensor
        entity: sensor.last_electricity_usage_entity
        detail: 1
        name: 昨日用电量
        unit: 度
        icon: ''
HiMyCocoo commented 17 hours ago
type: vertical-stack
cards:
  - type: custom:mini-graph-card
    entities:
      - entity: sensor.last_electricity_usage_entity
        name: 国网每日用电量
        aggregate_func: first
        show_state: true
        show_points: true
    group_by: date
    hour24: true
    hours_to_show: 240
  - type: horizontal-stack
    cards:
      - graph: none
        type: sensor
        entity: sensor.month_electricity_charge_entity
        detail: 1
        name: 上月电费
        icon: ''
        unit: 元
      - graph: none
        type: sensor
        entity: sensor.month_electricity_usage_entity
        detail: 1
        name: 上月用电量
        unit: 度
        icon: mdi:lightning-bolt-outline
  - type: horizontal-stack
    cards:
      - graph: none
        type: sensor
        entity: sensor.electricity_charge_balance_entity
        detail: 1
        name: 电费余额
        icon: mdi:cash-100
        unit: 元
      - graph: none
        type: sensor
        entity: sensor.last_electricity_usage_entity
        detail: 1
        name: 昨日用电量
        unit: 度
        icon: ''

大佬,请问我的实体都正常建立了,但是为什么卡片中显示实体不可用呢?

image image image