thibmaek / custom-components Goto Github PK
View Code? Open in Web Editor NEW⭐️ Custom components for Home Assistant
⭐️ Custom components for Home Assistant
0.89.2
Raspberry Pi 3 B+
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.
custom-components/sensor/telemeter.py
Lines 85 to 86 in c5ccc6e
TODO
comment in c5ccc6e. It's been assigned to @thibmaek because they committed the code.custom-components/sensor/vrtnws.py
Lines 114 to 117 in 4309094
TODO
comment in 4309094. It's been assigned to @thibmaek because they committed the code.custom-components/sensor/telemeter.py
Lines 63 to 68 in c5ccc6e
TODO
comment in c5ccc6e. It's been assigned to @thibmaek because they committed the code.custom-components/sensor/vrtnws.py
Lines 31 to 36 in 4309094
TODO
comment in 4309094. It's been assigned to @thibmaek because they committed the code.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
custom-components/sensor/telemeter.py
Lines 54 to 59 in c5ccc6e
TODO
comment in c5ccc6e. It's been assigned to @thibmaek because they committed the code.custom-components/sensor/telemeter.py
Lines 20 to 25 in c5ccc6e
TODO
comment in c5ccc6e. It's been assigned to @thibmaek because they committed the code.Replace the text between backticks with your config and tick off the relevant boxes (after creating the issue):
0.90.1
Raspberry Pi 3 Model B+
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"
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:
To help solve this issue, attach screenshots, logs, videos, gifs etc. below:
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:
custom-components/sensor/vrtnws.py
Lines 169 to 174 in 4309094
TODO
comment in 4309094. It's been assigned to @thibmaek because they committed the code.A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.