Enigma2 receivers integration

Just a quick update.
I’ve finished the notify component for enigma :slight_smile:
It is possible to send messages to the enigma boxes using the notify component.

messagetext=Text of Message
messagetype= [0= Yes/No, 1= Info, 2=Message, 3=Attention]
timeout=Can be empty or the Number of seconds the Message should disappear after.

I will try to release it until the end of the week :slight_smile:

notify_dreambox

2 Likes

Thanks for your help. I use OE 2.5 and GP 3.3 on that dreambox. I looked in the webinterface and found these details:

Device Name: dm520
Dreambox OS Version: 4.3.1r27-2018-03-20
Image Version: Experimental 2017-01-02
Frontprocessor Version: VNone
Webinterface Version: 1.8.0

I also executed the curl command and this is the result:

<html>                                                                          
  <head><title>412 - Precondition failed!</title></head>                        
  <body>                                                                        
    <h1>Precondition failed!</h1>                                               
    <p>sessionid is missing, invalid or expired!</p>                            
  </body>                                                                       
</html>

Thank you!

Latest OpenWebIf version is 1.3.1 :slight_smile:

I changed the component and added the headers to the request.
Try now to see if it works.

I will commit the update in the next minutes (together with the notify component)

Hi Cinzas,

I tried it again and it gives the same result as before: HTTP Error 412: Precondition Failed.

You also said that the latest OpenWebIf version is 1.3.1, but I got a version of 1.8.0, so I guess i’m using an other webinterface than OpenWebIf? Or am I using a beta version?

I also tried the notifications on the other dreamboxes that do work and it works wonderfully! Thank you for this component.

Cheers

Good to know

I’m not using the notifications :slight_smile:

Regarding openwebif, you can find the changelog here: https://github.com/E2OpenPlugins/e2openplugin-OpenWebif/blob/master/CHANGES.md

So I wonder which version of OpenWebif you’re using.
Can you post a screenshot of the webinterface ? And the about link ?

I did a bit of digging and it turns out that the dreamboxes I have run different plugins than your setup, because I have an other webinterface installed than the OpenWebIf. I also cannot install the OpenWebIf because it used the old standard of installing plugins through ipk packages instead of deb packages.

I checked the link you provided and the OpenWebIf interace is totally different than the one I am using, but somehow your component still works on some of my dreamboxes so I guess there has to be some similarities.

Here are three pictures of my webinterface of a dreambox that does work (has the same software as the dreambox that doesn’t work, I dunno why):

Webinterface dreambox livingroom

Webinterface device info page dreambox livingroom

Webinterface about page dreambox livingroom

Hmmm

I would like to install that image in one of my boxes just to try it.
But it’s strange it is working in some but not in the others :face_with_raised_eyebrow:

Yeah right?! Like it should work on both, or not work on both… I also encountered another error with a dreambox I recently placed outside in my garden to watch tv on, this one got the same image as my dreambox in my bed room which works 100% with your component… The error thrown is different, it doesn’t throw the http 412 condition failed but another one. The weird thing is that it doesn’t always behave like this, so sometimes I get this error in my log every single minute, and sometimes it just works like it should and doesn’t throw an error. It feels like the error is thrown more often when the dreambox is turned off.

Update for media_player.terras_dreambox fails

Traceback (most recent call last):
  File "/home/hass/.homeassistant/custom_components/media_player/enigma.py", line 152, in request_call
    return self._opener.open(uri, timeout=self._timeout).read().decode('UTF8')
  File "/usr/local/lib/python3.6/urllib/request.py", line 532, in open
    response = meth(req, response)
  File "/usr/local/lib/python3.6/urllib/request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/lib/python3.6/urllib/request.py", line 570, in error
    return self._call_chain(*args)
  File "/usr/local/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.6/urllib/request.py", line 650, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 204, in async_update_ha_state
    yield from self.async_device_update()
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 327, in async_device_update
    yield from self.hass.async_add_job(self.update)
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/util/__init__.py", line 319, in wrapper
    result = method(*args, **kwargs)
  File "/home/hass/.homeassistant/custom_components/media_player/enigma.py", line 193, in update
    xml = self.request_call('/web/epgservicenow?sRef=' + reference)
  File "/home/hass/.homeassistant/custom_components/media_player/enigma.py", line 154, in request_call
    _LOGGER.exception("Enigma: [request_call] - Error connecting to remote enigma %s: %s ", self._host, HTTPError.code)
AttributeError: type object 'HTTPError' has no attribute 'code'

If you need any help with finding or installing the right image I can try to help!

Cheers

Anyone else getting these errors? I am running 69b.0.3 and has just happened since the beta install.

2018-05-11 09:36:39 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.media_player.enigma. Make sure all dependencies are installed

Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/loader.py”, line 86, in get_component
module = importlib.import_module(path)
File “/usr/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 955, in _find_and_load_unlocked
File “”, line 665, in _load_unlocked
File “”, line 678, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/home/homeassistant/.homeassistant/custom_components/media_player/enigma.py”, line 15, in
from bs4 import BeautifulSoup
ModuleNotFoundError: No module named ‘bs4’

Hi

Check the readme :slight_smile:

Install BeautifoulSoup:

$ python3 -m pip install BeautifoulSoup4

yep had already done that

python3 -m pip install BeautifoulSoup4
Collecting BeautifoulSoup4
Could not find a version that satisfies the requirement BeautifoulSoup4 (from versions: )
No matching distribution found for BeautifoulSoup4

I had to create another VE for HA, so not sure what problem is with the new VE

I had the same issue. Just try: python3.6 -m pip install BeautifoulSoup4

BTW: greate job! Thank you cinzas.

Hi. thanks… just confirming the install has to run in the Virtual Environment of HA?

That’s correct :slight_smile:

I love this idea

1 Like

Still getting “Could not find a version that satisfies the requirement BeautifoulSoup4 (from versions: )
No matching distribution found for BeautifoulSoup4” running “python3.6 -m pip install BeautifoulSoup4”

Try:

pip install beautifulsoup4

:wink:

I have similar problem some one run on Hassbian?

I am a newbie at Home Assistant (I was using OpenHab). Yesterday I installed hass.io just to try your enigma2 integration (I was looking for an implementation for OpenHab, with no success). However, after copying enimapy to /config/custom_components/media_player/ and /config/custom_components/notify/ and including the configuration examples (with my profile) that you include in GitHub, I obtain the following error:

SyntaxError: invalid syntax
Fatal error while loading config: invalid syntax (enigma.py, line 7)
Failed config
General Errors:
- invalid syntax (enigma.py, line 7)

Maybe the problem is the BeautifulSoup module. Any idea how to install it in hass.io?

Thanks in advance!

Hi

You put the files in the wrong folder.
From the README.

To use the media_player custom component, place the file enigma.py from the folder media_player inside your folder ~/.homeassistant/custom_components/media_player To use the notify custom component, place the file enigma.py from the folder media_player inside your folder ~/.homeassistant/custom_components/notify

The custom components directory is inside your Home Assistant configuration directory.

You need to install (if not yet) the BeautifoulSoup module for Pyhton.