Giter VIP home page Giter VIP logo

sensor.untappd's Introduction

sensor.untappd

GitHub Release License GitHub Activity Discord Community Forum Contributors Project Maintenances

IMPORTANT: https://insiders.untappd.com/ gotta pay to play for exporting api so dont consider this project alive anymore

Get Untappd last badge, check-in, wishlist and more in Home Assistant use the list-card by iantrich to display your wishlist in Lovelace.

To get started put /custom_components/untappd/ here: <config directory>/custom_components/untappd/

Example configuration.yaml:

sensor:
  - platform: untappd
    username: average_joe
    id: FSDJLKHDF786287UGHLE
    secret: FJKSDLHKS8337R6948F

Configuration variables:

key description
platform (Required) untappd
id (Required) Your Untappd API id.
secret (Required) Your Untappd API secret.
username (Required) The username of the Untappd user, you want updates for.

You will need to apply for an API from Untappd to use this.


Due to how custom_components are loaded, it is normal to see a ModuleNotFoundError error on first boot after adding this, to resolve it, restart Home-Assistant.

sensor.untappd's People

Contributors

frauhottelmann avatar iantrich avatar ikifar2012 avatar ktibow avatar ludeeus avatar pinkywafer avatar prestomation avatar swetoast avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sensor.untappd's Issues

Error with .0.94

I get the below error in my log after upgrading to .0.94. It was working fine for me with .0.93.2. I'm using v0.1.5 of Untapped

Error while setting up platform untappd
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, 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/untappd/sensor.py", line 64, in setup_platform
    add_devices([UntappdCheckinSensor(username, api_id, api_secret)])
  File "/config/custom_components/untappd/sensor.py", line 70, in __init__
    from pyuntappd import Untappd
ModuleNotFoundError: No module named 'pyuntappd'

Requirements not found

Version of Home Assistant and installation type

System Health

version core-2021.5.0
installation_type Home Assistant Supervised
dev false
hassio true
docker true
virtualenv false
python_version 3.8.9
os_name Linux
os_version 4.19.0-16-amd64
arch x86_64
timezone America/New_York
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 4525
Installed Version 1.12.3
Stage running
Available Repositories 846
Installed Repositories 31
Home Assistant Supervisor
host_os Debian GNU/Linux 10 (buster)
update_channel stable
supervisor_version supervisor-2021.04.3
docker_version 20.10.6
disk_total 181.1 GB
disk_used 13.9 GB
healthy true
supported true
supervisor_api ok
version_api ok
installed_addons File editor (5.3.0), Mosquitto broker (5.1.1), NGINX Home Assistant SSL proxy (3.0.1), Duck DNS (1.12.5), Samba share (9.3.1), AdGuard Home (4.0.0), MariaDB (2.3.0), WireGuard (0.5.1), Home Assistant Google Drive Backup (0.104.3), AppDaemon 4 (0.6.0), chrony (2.1.0), TasmoBackup (1.04.10), Glances (0.12.1), Visual Studio Code (3.3.1)

Configuration

#=====================================================================

Untapped for beer-card

#=====================================================================

  • platform: untappd
    username: walkabout32
    id: myIDfromUntappd
    secret: MySecretfromUntapped

Add your logs here.

Logger: homeassistant.components.hassio
Source: components/hassio/init.py:482
Integration: Home Assistant Supervisor (documentation, issues)
First occurred: 9:34:40 AM (1 occurrences)
Last logged: 9:34:40 AM

Platform error sensor.untappd - Requirements for untappd not found: ['pyuntappd==0.0.5'].

Describe the bug

This message shows up in the logs and the sensors aren't created. I have commented out the sensor in configuration.yaml and removed the integration from HACS, then Installed the integration which works fine until I re-add the sensor in the config.

Debug log


Add your logs here.

Logger: homeassistant.util.package
Source: util/package.py:96 
First occurred: 9:59:24 AM (1 occurrences) 
Last logged: 9:59:24 AM

Unable to install package pyuntappd==0.0.5: WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1125)'))': /simple/pyuntappd/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1125)'))': /simple/pyuntappd/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1125)'))': /simple/pyuntappd/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1125)'))': /simple/pyuntappd/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1125)'))': /simple/pyuntappd/ ERROR: Could not find a version that satisfies the requirement pyuntappd==0.0.5 (from versions: none) ERROR: No matching distribution found for pyuntappd==0.0.5 WARNING: You are using pip version 20.2.4; however, version 20.3 is available. You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.

Dependabot couldn't find a requirements.txt for this project

Dependabot couldn't find a requirements.txt for this project.

Dependabot requires a requirements.txt to evaluate your project's current Python dependencies. It had expected to find one at the path: /requirements.txt.

If this isn't a Python project, or if it is a library, you may wish to disable updates for it from within Dependabot.

You can mention @dependabot in the comments below to contact the Dependabot team.

Possible to pull list other than Wishlist?

Firstly thanks for the amazing component! I use an Untappd list to track what I have in the fridge and I’d love to see this through home assistant. Is this possible at all?

No new applications for Untappd’s API access

Thank you for your interest in Untappd’s API. At this time, we are no longer accepting new applications for API access as we work to improve our review and support processes. We do not have a planned date to begin accepting new applications, so please check back soon.

If you are a current user of our API, check out your app section of this page for information about your app. If you had previously submitted a request for access, but do not see your application listed on your account, please check back later to see when we will be resuming applications.

https://untappd.com/api/register

So this isn’t supported any more?

I am guessing since it’s been almost 6 days since I posted my issue, and the issue from 6 months ago remains open, this isn’t supported any more with Home Assistant.

Component broken

Hi,

I'm getting the following error in my log. The sensors aren't created. I’m on HA 0.108.1.

Error while setting up untappd platform for sensor
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 178, 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/untappd/sensor.py”, line 64, in setup_platform
add_devices([UntappdCheckinSensor(username, api_id, api_secret)])
File “/config/custom_components/untappd/sensor.py”, line 85, in init
self.update()
File “/config/custom_components/untappd/sensor.py”, line 90, in update
self._apisecret, self._username)
File “/usr/local/lib/python3.7/site-packages/pyuntappd/init.py”, line 26, in get_last_activity
activity = get_last_activity[‘response’][‘checkins’][‘items’][0]
IndexError: list index out of range

Are multiple untappd users/sensors possible?

Just wondering if anyone has had any luck creating two untappd user sensors
I wanted to display the checkin/badge data of both me and my other half on a single page.

I only get the sensors created for the first user:

Untappd API Sensors

  • platform: untappd
    name: untappd_user1
    username: !secret untappd_username1
    id: !secret untappd_id
    secret: !secret untappd_secret

  • platform: untappd
    name: untappd_user2
    username: untappd_username2
    id: !secret untappd_id
    secret: !secret untappd_secret

data[id] can not be found?

Downloaded the raw component in custom_components/sensor/untappd.py but after restarting (several times) it keeps giving the error below (Invalid Config)

Invalid config for [sensor.untappd]: required key not provided @ data['id']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.untappd/

Running Home Assistant on Pi with 0.74

Error while setting up untappd platform for sensor

Hi,

I'm receiving the following error in Home Assistant.
The entities aren't created.
This is my config:

sensor:
  - platform: untappd
    username: XXXXX
    id: XXXXXXX
    secret: XXXXX

And here is my log:

Error while setting up untappd platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 184, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/untappd/sensor.py", line 64, in setup_platform
    add_devices([UntappdCheckinSensor(username, api_id, api_secret)])
  File "/config/custom_components/untappd/sensor.py", line 85, in __init__
    self.update()
  File "/config/custom_components/untappd/sensor.py", line 89, in update
    result = self._untappd.get_last_activity(self._apiid,
  File "/usr/local/lib/python3.8/site-packages/pyuntappd/__init__.py", line 26, in get_last_activity
    activity = get_last_activity['response']['checkins']['items'][0]
KeyError: 'checkins'

I hope you can help me.

Thanks in advance!

Not working anymore?

Version of Home Assistant and installation type

core-2021.8.3

Version of the custom_component

0.1.6

Configuration

sensor:
  - platform: untappd
    username: Naesstrom
    id: !secret untappd_ID
    secret: !secret untappd_Secret

### Templating for the untappd lovelace card (https://sharethelove.io/picture-elements-cards/untappd-card)
  - platform: template
    sensors:
      untappd_badge:
       value_template: "Recent Badge: {{ states.sensor.untappd_last_badge_naesstrom.attributes.badge }} (Level {{ states.sensor.untappd_last_badge_naesstrom.attributes.level }})"

  - platform: template
    sensors:
      untappd_beer:
       value_template: "Recent Beer: {{ states.sensor.untappd_last_check_in_naesstrom.attributes.beer }} ({{ states.sensor.untappd_last_check_in_naesstrom.attributes.abv }})"

  - platform: template
    sensors:
      untappd_followings:
#       unit_of_measurement: followers
       value_template: "{{ states.sensor.untappd_last_check_in_naesstrom.attributes.followings }}"
       entity_picture_template: "https://www.shareicon.net/data/32x32/2016/09/23/833751_people_512x512.png"

  - platform: template
    sensors:
      untappd_checked:
#       unit_of_measurement: checkins
       value_template: "{{ states.sensor.untappd_last_check_in_naesstrom.attributes.checkins }}"
       entity_picture_template: "https://www.shareicon.net/data/128x128/2015/05/30/46550_check_32x32.png"

  - platform: template
    sensors:
      untappd_total_beers:
#       unit_of_measurement: beers
       value_template: "{{ states.sensor.untappd_last_check_in_naesstrom.attributes.total_beers }}"
       entity_picture_template: "https://www.shareicon.net/data/32x32/2016/09/26/834858_drink_512x512.png"


  - platform: template
    sensors:
      untappd_total_badges:
#       unit_of_measurement: badges
       value_template: "{{ states.sensor.untappd_last_check_in_naesstrom.attributes.total_badges }}"
       entity_picture_template: "https://www.shareicon.net/data/32x32/2016/07/10/794103_miscellaneous_512x512.png"

Describe the bug

A clear and concise description of what the bug is.

Debug log

Logger: homeassistant.components.sensor
Source: custom_components/untappd/sensor.py:94
Integration: Sensor (documentation, issues)
First occurred: August 12, 2021, 5:20:05 PM (1 occurrences)
Last logged: August 12, 2021, 5:20:05 PM

Error while setting up untappd platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/untappd/sensor.py", line 67, in setup_platform
    add_devices([UntappdCheckinSensor(username, api_id, api_secret)])
  File "/config/custom_components/untappd/sensor.py", line 90, in __init__
    self.update()
  File "/config/custom_components/untappd/sensor.py", line 94, in update
    result = self._untappd.get_last_activity(
  File "/usr/local/lib/python3.9/site-packages/pyuntappd/__init__.py", line 26, in get_last_activity
    activity = get_last_activity['response']['checkins']['items'][0]
TypeError: list indices must be integers or slices, not str

Logger: homeassistant.helpers.template
Source: helpers/template.py:1417
First occurred: August 12, 2021, 5:20:13 PM (16534 occurrences)
Last logged: 3:15:01 PM

Template variable error: 'None' has no attribute 'attributes' when rendering 'Recent Beer: {{ states.sensor.untappd_last_check_in_naesstrom.attributes.beer }} ({{ states.sensor.untappd_last_check_in_naesstrom.attributes.abv }})'
Template variable error: 'None' has no attribute 'attributes' when rendering '{{ states.sensor.untappd_last_check_in_naesstrom.attributes.followings }}'
Template variable error: 'None' has no attribute 'attributes' when rendering '{{ states.sensor.untappd_last_check_in_naesstrom.attributes.checkins }}'
Template variable error: 'None' has no attribute 'attributes' when rendering '{{ states.sensor.untappd_last_check_in_naesstrom.attributes.total_beers }}'
Template variable error: 'None' has no attribute 'attributes' when rendering '{{ states.sensor.untappd_last_check_in_naesstrom.attributes.total_badges }}'

Error: - Platform not found: sensor.untappd

I'm getting the same error message as Naesstrom. Has there been a fix?

To clarify: I'm not certain that my issue is exactly the same. I have three available sensors for Untappd. They are: sensor.untappd_last_badge_garnern2, sensor.untappd_last_check_in_garnern2, and sensor.untappd_wishlist_garnern2. There are no other Untappd sensors.

Error after setting up untappd platform for sensor

Version of Home Assistant and installation type

Version: 2020.12.1 (current) 0.118.5 (initial)
OS: Home Assistant OS 5.8

Version of the custom_component

Installed Version: 0.1.5 (Installed through HACS)

Describe the bug

After installing the sensor, adding the sensor YAML information to my config I restarted HA. After the restart the error below was logged. I searched for a possible solution and the suggestion was done to add some extra beers to my Untappd account (my existing Untappd account had already 100 beers checked in). I did some checkins in the past week and today the sensor was still not there. I restarted HA again but still ending up with the error below. In my dashboard on Untappd I can see that HA is executing requests so the sensor is able to contact, authenticate and use the API but fails on getting the last activities.

Another issue with the same message was already closed but since this issue is not resolved by checking in another beers I'm recreating this issue.

Debug log


Logger: homeassistant.components.sensor
Source: custom_components/untappd/sensor.py:89
Integration: Sensor (documentation, issues)
First occurred: 1:07:09 PM (1 occurrences)
Last logged: 1:07:09 PM

Error while setting up untappd platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 199, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/untappd/sensor.py", line 64, in setup_platform
    add_devices([UntappdCheckinSensor(username, api_id, api_secret)])
  File "/config/custom_components/untappd/sensor.py", line 85, in __init__
    self.update()
  File "/config/custom_components/untappd/sensor.py", line 89, in update
    result = self._untappd.get_last_activity(self._apiid,
  File "/usr/local/lib/python3.8/site-packages/pyuntappd/__init__.py", line 26, in get_last_activity
    activity = get_last_activity['response']['checkins']['items'][0]
KeyError: 'checkins'


difference in updater and readme

Just found out that the updater says a different local path than the installation notes in the readme:

custom_updater.json:
"local_location": "/custom_components/sensor/untappd.py",

against readme.md:
To get started put /custom_components/untappd/sensor.py here: /custom_components/untappd/sensor.py

Also in the custom_updater.json:
"remote_location": "https://raw.githubusercontent.com/custom-components/sensor.untapped/master/custom_components/sensor/untappd.py",
Should be changed to: https://raw.githubusercontent.com/custom-components/sensor.untapped/master/custom_components/untappd/sensor.py

Maybe the entire structure has to be changed but ill leave that up to you.

Fails after some time

Initially everything worked fine but now I'm getting:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/sensor/untappd.py", line 60, in setup_platform
    add_devices([UntappdCheckinSensor(username, api_id, api_secret)])
  File "/home/homeassistant/.homeassistant/custom_components/sensor/untappd.py", line 81, in __init__
    self.update()
  File "/home/homeassistant/.homeassistant/custom_components/sensor/untappd.py", line 86, in update
    self._apisecret, self._username)
  File "/srv/homeassistant/lib/python3.5/site-packages/pyuntappd/__init__.py", line 26, in get_last_activity
    activity = get_last_activity['response']['checkins']['items'][0]
TypeError: list indices must be integers or slices, not str

Can anybody help me with this?

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.