Giter VIP home page Giter VIP logo

custom-components's People

Contributors

thibmaek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

custom-components's Issues

Telemeter 2.0.0 custom component not working?

  • Home Assistant version: 0.89.2
  • Host: Raspberry Pi 3 B+
  • Home Assistant setup:
    • Hassbian / Raspbian
    • Docker
    • Hass.io
    • Python

I can't seem to get the Telemeter custom_component to work. I've followed the instructions in the README and this is my config:

- platform: telemeter
  name: "Telemeter"
  cookie: 'AMCV_[REDACTED]%40AdobeOrg'
  include_offpeak: true

In place of [REDACTED] was a series of 24 letters and digits. The error I get with this config is this:

ERROR (SyncWorker_18) [custom_components.telemeter.sensor] Could not decode received JSON: Expecting value: line 1 column 1 (char 0)
ERROR (MainThread) [homeassistant.components.sensor] telemeter: Error on device update!
Traceback (most recent call last):
  File "/config/custom_components/telemeter/sensor.py", line 144, in make_request
    data = response.json()
  File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 889, in json
    self.content.decode(encoding), **kwargs
  File "/usr/local/lib/python3.7/site-packages/simplejson/__init__.py", line 518, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.7/site-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/local/lib/python3.7/site-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 248, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 348, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  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/telemeter/sensor.py", line 157, in update
    response = self.make_request()
  File "/config/custom_components/telemeter/sensor.py", line 152, in make_request
    _LOGGER.error(data)
UnboundLocalError: local variable 'data' referenced before assignment

I then tried to troubleshoot it myself by adding data = {} on line 140, but then I got the following error instead:

ERROR (MainThread) [homeassistant.components.sensor] telemeter: Error on device update!
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 248, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 348, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  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/telemeter/sensor.py", line 165, in update
    response['usage_peak'] + response['usage_offpeak'])
TypeError: 'NoneType' object is not subscriptable

Disclaimer: I am a new user of this custom component so I have never been able to get this to work before.

I only found out about this via a recent retweet by the Home Assistant account. I was eager to start using it, but I was in the middle of migrating from a RPi 3 to an RPi 3 B+, and I had yet to upgrade from 0.87.1 to 0.89.2. Both of those tasks have been completed, and that's when I started trying to use this custom component.
I suspect something might be wrong with the information I'm supplying as the cookie, and the errors I'm seeing are a result of that.

Incorrect version requirement for requests_xml

Using the latest hass version 0.84.6 i get the following error in the log file

Dec 23 16:59:23 xxx.lan hass[689]: 2018-12-23 16:59:23 ERROR (Thread-9) [homeassistant.util.package] Unable to install package requests_xml==0.2.3: Could not find a version that satisfies the requirement requests_xml==0.2.3 (from versions: 0.2.1)
Dec 23 16:59:23 xxx.lan hass[689]: No matching distribution found for requests_xml==0.2.3

icon

DEFAULT_ICON = 'mdi:train' # TODO: icon
# This is a cookie obtained from the mijn.telenet.be webportal
CONF_COOKIE = 'credential'
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({


This issue was generated by todo based on a TODO comment in c5ccc6e. It's been assigned to @thibmaek because they committed the code.

How to install Telemeter

Replace the text between backticks with your config and tick off the relevant boxes (after creating the issue):

System details

  • Home Assistant version: 0.90.1
  • Host: Raspberry Pi 3 Model B+
  • Home Assistant setup:
    • Hassbian / Raspbian
    • Docker
    • Hass.io
      • HassOS
      • Other
    • Python

Hass.io

If you are using Hass.io, paste the output of following commands in the relevant code blocks. Otherwise you can delete this section:

hassio ha info

arch: armv7
boot: true
custom: false
image: homeassistant/raspberrypi3-homeassistant
last_version: 0.90.1
machine: raspberrypi3
port: 8123
ssl: false
version: 0.90.1
wait_boot: 600
watchdog: true

hassio os info

board: rpi3
version: "2.11"
version_cli: "9"
version_cli_latest: "9"
version_latest: "2.11"
core-ssh:~# hassio os info
board: rpi3
version: "2.11"
version_cli: "9"
version_cli_latest: "9"
version_latest: "2.11"

Issue

What happened:
telemeter: Error on device update!
18:17 custom_components/telemeter/sensor.py (ERROR)
Could not decode received JSON: Expecting value: line 1 column 1 (char 0)
18:17 custom_components/telemeter/sensor.py (ERROR)

What should have happened:

Possible suggestion:

Attachments

To help solve this issue, attach screenshots, logs, videos, gifs etc. below:

Better card for vrtnws

Just want to share that I have been able to have useful card with the following config using some custom cards below

https://github.com/thomasloven/lovelace-useful-markdown-card
https://github.com/ciotlosm/custom-lovelace/tree/master/entity-attributes-card

type: entities
show_header_toggle: false
entities:
  - content: |
      ##### vrtnws.be
      ### [[ sensor.vrt_nws ]]  
       ![vrtnws]([[ sensor.vrt_nws.attributes.picture ]])  
    type: 'custom:useful-markdown-card'
  - type: 'custom:entity-attributes-card'
    filter:
      include:
        - key: sensor.vrt_nws.details*
          name: ' '
    heading_name: ' '
    heading_state: ' '
  - content: |
      [Lees meer] [[ sensor.vrt_nws.attributes.link ]]      
    type: 'custom:useful-markdown-card'

which will give you this view, maybe more tweak are required regarding the title:
image

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.