title: Energi
path: energi
icon: mdi:flash
type: sections

sections:

  # ⚡ Strømpris
  - type: grid
    cards:
      - type: heading
        heading: Strømpris

      - type: tile
        entity: sensor.energi_data_service
        name: Nuværende pris (kr/kWh)

      - type: history-graph
        title: Strømpris sidste 24 timer
        entities:
          - sensor.energi_data_service
        hours_to_show: 24
        refresh_interval: 60


  # 🏠 Hjemmets energiforbrug
  - type: grid
    cards:
      - type: heading
        heading: Forbrug

      - type: sensor
        entity: sensor.home_energy_usage
        name: Aktuelt forbrug

      - type: history-graph
        title: Forbrug sidste 24 timer
        entities:
          - sensor.home_energy_usage
        hours_to_show: 24
        refresh_interval: 60

      - type: history-graph
        title: Forbrug sidste 7 dage
        entities:
          - sensor.home_energy_usage
        hours_to_show: 168
        refresh_interval: 300


  # 🔋 Batteri / lager
  - type: grid
    cards:
      - type: heading
        heading: Batteri

      - type: sensor
        entity: sensor.home_battery_level
        name: Batteri %

      - type: sensor
        entity: sensor.home_battery_charge
        name: Ladehastighed


  # 💡 Automations / kontrol
  - type: grid
    cards:
      - type: heading
        heading: Automations

      - type: button
        name: Stop opladning Tesla
        icon: mdi:car-electric
        tap_action:
          action: call-service
          service: tesla.stop_charge
          target:
            entity_id: vacuum.snowywhite

      - type: button
        name: Start opladning Tesla
        icon: mdi:car-electric
        tap_action:
          action: call-service
          service: tesla.start_charge
          target:
            entity_id: vacuum.snowywhite

      - type: button
        name: Tænd/Sluk tungt forbrug
        icon: mdi:flash
        tap_action:
          action: toggle
          entity: switch.heavy_load
