Skip to content
This repository was archived by the owner on Mar 19, 2023. It is now read-only.
This repository was archived by the owner on Mar 19, 2023. It is now read-only.

Alternatywne rozwiązanie na odczyt licznika #9

Description

@catgiggle

Hej. Chciałbym podrzucić moje rozwiązanie na odczyt stanu licznika z Energi. Bardzo podobne, ale wydaje mi się, że trochę prostsze w implementacji/konfiguracji. Pewnie też ma swoje wady, sam oceń. Rozwiązanie nie wymaga niczego prócz dodania do HA (np. przez HACS) integracji HA Multiscrape (https://github.com/danieldotnl/ha-multiscrape) i ustawienia poniższej konfiguracji

multiscrape:
  - resource: https://mojlicznik.energa-operator.pl/dp/UserData.do
    scan_interval: 3600
    form_submit:
      resource: "https://mojlicznik.energa-operator.pl/dp/UserLogin.do"
      select: "form#loginForm"
      submit_once: True
      resubmit_on_error: True
      input:
        j_username: "xxx@gmail.com"
        j_password: "admin123"
    sensor:
      - unique_id: consumed_energy_total
        name: Consumed energy total
        select: 'div#right > table > tr:nth-of-type(1) > td.last'
        value_template: "{{ value|regex_replace('[^0-9,]', '')|replace(',', '.')|float }}"
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        on_error:
          value: last
      - unique_id: donated_energy_total
        name: Donated energy total
        select: 'div#right > table > tr:nth-of-type(3) > td.last'
        value_template: "{{ value|regex_replace('[^0-9,]', '')|replace(',', '.')|float }}"
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        on_error:
          value: last

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions