Giter VIP home page Giter VIP logo

home-assistant-szep-kartya's Introduction

OTP SZÉP Kártya Home Assistant component

hacs_badge

Custom component for Home Assistant that tracks SZÉP Kártya account balance.

The state of the sensor is the sum of all sub-balances, but each sub-balance is exposed as a property.

Screenshot

Installation

  1. Install HACS
  2. Add this as a custom repository to HACS (https://github.com/ofalvai/home-assistant-szep-kartya)
  3. Install from the integrations list
  4. Add YAML config to configuration.yaml (see below)
  5. Restart Home Assistant

Configuration

sensor:
  - platform: szep_kartya
    card_number: !secret card_number
    card_code: !secret card_code
    name: SZÉP Kártya
    scan_interval:
      hours: 4

card_number: The last 8 digits of the card number (after the 61013242 prefix). Make sure to represent the number as string to avoid removing zeroes from the beginning.

card_code: "Telekód" (by default the last 3 digits of card number). Make sure to represent the number as string to avoid removing zeroes from the beginning.

name (optional): Friendly name of the sensor

scan_interval: Define an interval of a few hours (instead of the default 30 seconds). The API gives a captcha challenge if polled too frequently.

home-assistant-szep-kartya's People

Contributors

elmerenges avatar ofalvai avatar wrt54g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

home-assistant-szep-kartya's Issues

No entity

Ezeket a lépéseket követtem:

  1. HACS telepítés
  2. A custom repository HACS-hez hozzáadás (https://github.com/ofalvai/home-assistant-szep-kartya)
  3. Integrations listából telepítés
  4. configuration.yaml-ban az alábbi sorok hozzáadása:
    sensor:
  • platform: szep_kartya
    card_number: 12345678 (a kártyaszámom utolsó 8 száma)
    card_code: 678 (a kártyaszámom utolsó 3 száma)
    name: SZÉP Kártya
    scan_interval:
    hours: 4
  1. Home Assistant újraindítás

Ennek ellenére nincs entitás.

HA Core: core-2021.11.4
HA OS: Home Assistant OS 7.0
HACS: 1.19.3
Home Assistant SZÉP kártya integration: 1.0.2 and 1.0.3

Kérlek nézd meg, tudod javítani?

Frissítés:
2022.01.18.
Valakítől (akinek régebb óta meg van a v1.0.3) megkaptam a fájljait, felülírtam a HACS-ből letöltött fájlokkal, és úgy már nekem is működik (Fejlesztői eszközök ->Állapotok ott sensor.otp_szep_kartya).
Nem tudom, hogy miben különbözik a HACS által letöltött, és a kapott között, de nálam csak a második opció oldotta meg.

no entity!

Hi! I installed, I entered the configuration but
there is no entity. Can you help?

Error while setting up platform szep_kartya

Sun Jan 19 2020 18:11:16 GMT+0100 (közép-európai téli idő)
Error while setting up platform szep_kartya
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 158, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/szep_kartya/sensor.py", line 45, in setup_platform
sensor.update()
File "/config/custom_components/szep_kartya/sensor.py", line 92, in update
self.fetch_balance()
File "/config/custom_components/szep_kartya/sensor.py", line 116, in fetch_balance
self.balance_vendeglatas = parse_balance(response_json[1]['szamla_osszeg7'])
TypeError: list indices must be integers or slices, not str

Hello!
Egy pár napja ez a hibaüzenet fogad, ami korábban tökéletesen beolvasta az összegeket.
Tudsz segíteni? :)

Köszi!

Error while setting up szep_kartya platform for sensor

Egy ideje nem működik a szenzor.
Ez a hibaüzenet:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/szep_kartya/sensor.py", line 48, in setup_platform
    sensor.update()
  File "/config/custom_components/szep_kartya/sensor.py", line 95, in update
    self.fetch_balance()
  File "/config/custom_components/szep_kartya/sensor.py", line 122, in fetch_balance
    self.balance_vendeglatas = parse_balance(response_json[1]['szamla_osszeg7'])
TypeError: string indices must be integers

Error while setting up szep_kartya platform for sensor

Home Assistant Core: 2023.1.2

It used to work in previous major version 2022.12.9.

2023-01-09 09:39:48.391 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up szep_kartya platform for sensor
Traceback (most recent call last):
  File "/home/pi/ha_venv3_9/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/pi/homeassistant_conf/custom_components/szep_kartya/sensor.py", line 48, in setup_platform
    sensor.update()
  File "/home/pi/homeassistant_conf/custom_components/szep_kartya/sensor.py", line 94, in update
    self.scrape_tokens()
  File "/home/pi/homeassistant_conf/custom_components/szep_kartya/sensor.py", line 101, in scrape_tokens
    script_tag_text = soup.find('script', text=re.compile('ajax_token')).string
AttributeError: 'NoneType' object has no attribute 'string'

Error while setting up platform szep_kartya

HASS 0.101.3 throws this error for a card_number different from 896747 (in fact for a 8-digit card_number):

2019-11-15 17:49:40 ERROR (MainThread) [homeassistant.config] Invalid config for [sensor.szep_kartya]: length of value must be at least 8 for dictionary value @ data['card_number']. Got 896747. (See /home/pi/homeassistant_conf/sensors/mkb_szepkartya.yaml, line 0). Please check the docs at https://home-assistant.io/integrations/sensor.szep_kartya/

Nem működik HA 2023.9.1-el

HA 2023.8.4-el még jól működött (mutatta a teljes és a Szálláshely zsebet), azonban HA 2023.9.1 óta az összesítő szenzor nem elérhető, a Szállászseb értékre ismeretlent mutat.
(A mobil SZÉP kártya alkalmazással lekérhető az egyenleg).

Mi lehet az oka?
Van rá lehetőség korrigálni?

Frissítve: valamiért "be volt ragadva", HA újraindítás óta az összesítő már jól működik.

Error while setting up szep_kartya platform for sensor

Amikor a sensor.yaml -be beírtam a szükséges adatokat, majd újraindítom, akkor ez a hiba van a HA log-ban:

image

image

(konténerben fut a Home Assistant)
Home Assistant Core 2022.6.7
HACS: 1.25.5
Python Version | 3.9.12
app verzió: v1.0.4

MKB Szépkártya

Nem lenne kedved átportolni, hogy MKB is lekérdezhető legyen?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.