Enigma2 receivers integration

I turned of the enigma2 box and restarted HA. When HA restarted I turned on the box. When it loaded up the circle would spin for about 2 seconds then off for 2 seconds then back on. All commands on IR respond slowly.

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:942
First occurred: 10:24:09 (6 occurrences)
Last logged: 10:25:19

Update for media_player.alien2br fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 942, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1300, in async_device_update
    await self.async_update()
  File "/config/custom_components/enigma/media_player.py", line 219, in async_update
    await self.load_sources()
  File "/config/custom_components/enigma/media_player.py", line 154, in load_sources
    reference = urllib.parse.quote_plus(await self.get_bouquet_reference())
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/enigma/media_player.py", line 176, in get_bouquet_reference
    return soup.find('e2servicereference').renderContents().decode('UTF8')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'renderContents'


Logger: homeassistant.helpers.entity
Source: helpers/entity.py:1270
First occurred: 10:24:31 (1 occurrences)
Last logged: 10:24:31

Update of media_player.alien2br is taking over 10 seconds

Can’t see any other logs enteries connected to the box.
The enigma2 media card was greyed out and if I clicked on 3 dots in top right it remained grey but opened up. No channel bouqets had loaded.
This circle on/off would continue until using the IR remote I changed the channel twice. Then the circle went and card lit up and bouqet appeared and I could pick a channel from the card.
If I restart the box again it comes up with media card working. If I put in standby and come out of it the card works.
If there is anything else you want me to report on let me know. I can live with pressing channel selection twice and improvement on having to restart HA with the box already on.

I hope I’m allowed to post this here, but it fits in well with the enigma2 theme: I once made a remote control for my Duo2, here

Hi @Spiro

I am currently running the plugin against 3 Enigma2 devices.

  • GigaBlue UHD QUAD 4K - openATV 7.4.
  • Dream Multimedia DM800 HD se - OpenPLi 10.1
  • Dream Multimedia DM800 HD se - OpenPLi 10.2

And it is running without any problems.
Both dreambox are quite old, and laggy, and I don’t feel any kind of issue.

However, I did face a similar problem on the Gigablue last year.
It had nothing to do with the plugin, but with a extension I had.

Check if you have the enigma2-plugin-extensions-lcd4linux installed.

Also, which device do you have and which firmware (enigma2) is it running ?
Can you remove the device from HA configuration, restart HA and check if the issue still occurs on the Engima2 ?

Thanks

1 Like

Interesting …

Thanks for sharing, I will have a look :slight_smile:

Thanks. As you suggested above worked.
Removing the box from configuration.yaml and restarting HA. Then adding back the yaml again and restarting HA again.
Now the recurring busy circle has gone.
The box is an old Amiko Alien 2 running ViX4E2PROJECT Version 4.2. I found this to be the most stable image. I couldn’t find enigma2-plugin-extensions-lcd4linux on it.

Apologies if already asked, but what is the difference this integration and the official one in core?

Thanks

@cinzas First of all, I would like to thank you for the integration and your work.

Have you considered introducing more commands for the remote control via services? The integration (GitHub - mercs600/ha-adb_service: Control your ADB (NC+) decoder by HomeAssistant Service) to my previous decoder had it quite developed, thanks to which it was possible to create a simple graphical remote control on the dashboard.

In your code, I added behavior for pause, play and stop in the media_player service, but through a dedicated service for integration with an action for the remote control button, it would be possible to handle each button, knowing its code (e.g. it can be read from the OpenWebIF web interface source).

Olá! Joao. @cinzas

The plugin works great for me, i have two enigma2 devices with the last openatv firmware 7.5.1.

I say well “except” the picon!. I mean.

If you customize the channel name in the bouquet, give error, the plugin ask for channel reference plus channel name.

If you leave the bouquet as default without personalizing the name it works fine.

Thank you for your work and your time !!!

Hola @DelBierzo

I am using openatv 7.4
Let me update my enigmas do 7.5.1 and test it.

Can you share your yaml file ?

Because you should not configure a channel but rather a bouquet on the configuration, like so:

  - host: 192.168.1.21
    port: 80
    name: Dreambox Room
    timeout: 20
    picon: picon
    username: root
    password: !secret enigma_password
    bouquet: '1:7:1:0:0:0:0:0:0:0:FROM BOUQUET "userbouquet.dbe01.tv" ORDER BY bouquet'

Hi!
I tried it both ways with and without bouquet, removing plugin and restarting HA, between changes.

this way:

enigma:
  devices:
    - host: 192.168.1.4
      port: 80
      name: gbip4k
      username: root
      password: !secret enigma2password
      bouquet: '1:7:1:0:0:0:0:0:0:0:FROM BOUQUET "userbouquet.favourites.tv" ORDER BY bouquet:TDT'
      timeout: 20
      picon: picon

    - host: 192.168.1.5
      port: 80
      name: gbue4k
      username: root
      password: !secret enigma2password
      bouquet: '1:7:1:0:0:0:0:0:0:0:FROM BOUQUET "userbouquet.favourites.tv" ORDER BY bouquet:TDT'
      timeout: 20
      picon: picon

notify:
  - platform: enigma
    host: 192.168.1.4
    port: 80
    username: root
    password: !secret enigma2password
    name: gbip4k

  - platform: enigma
    host: 192.168.1.5
    port: 80
    username: root
    password: !secret enigma2password
    name: gbue4k

and this other way:

enigma:
  devices:
    - host: 192.168.1.4
      port: 80
      name: gbip4k
      username: root
      password: !secret enigma2password
      timeout: 20
      picon: picon

    - host: 192.168.1.5
      port: 80
      name: gbue4k
      username: root
      password: !secret enigma2password
      timeout: 20
      picon: picon

notify:
  - platform: enigma
    host: 192.168.1.4
    port: 80
    username: root
    password: !secret enigma2password
    name: gbip4k

  - platform: enigma
    host: 192.168.1.5
    port: 80
    username: root
    password: !secret enigma2password
    name: gbue4k

The problem only arises if you personalize the channel name in the bouquet.

this way, doesn’t work

#NAME TDT
#SERVICE 1:0:1F:9C43:9C40:22D4:EEEE0000:0:0:0::LA 1 UHD
#DESCRIPTION LA 1 UHD

in the normal way. it works

#NAME TDT
#SERVICE 1:0:1F:9C43:9C40:22D4:EEEE0000:0:0:0:

With this configuration,

3 enigma devices. One with PICON and two with SCREENSHOT
All of them I am selecting the first bouquet.

devices:
  - host: 192.168.1.20
    port: 80
    name: Gigablue
    picon: picon
    timeout: 20
    username: root
    password: !secret enigma_password
    bouquet: '1:7:1:0:0:0:0:0:0:0:FROM BOUQUET "userbouquet.dbe05.tv" ORDER BY bouquet'
  - host: 192.168.1.21
    port: 80
    name: Dreambox Room
    timeout: 20
    picon: screenshot
    username: root
    password: !secret enigma_password
    bouquet: '1:7:1:0:0:0:0:0:0:0:FROM BOUQUET "userbouquet.dbe01.tv" ORDER BY bouquet'
  - host: 192.168.1.22
    port: 80
    name: Dreambox Kitchen
    timeout: 20
    picon: screenshot
    username: root
    password: !secret enigma_password
    bouquet: '1:7:1:0:0:0:0:0:0:0:FROM BOUQUET "userbouquet.dbe00.tv" ORDER BY bouquet'

I have the following:

image

You can see the TVE picon for the first media player card.
The other two cards are showing a screenshot of what is showing in the TV.

Please check in your browser if you are selecting the right bouquet
http://box.ip/web/getservices

If you access via browsers to OpenWebIF, on that bouquet, does it show the picons ?

Hi! again.

The problem is not the configuration.
The question is, and more specifically in your case.

If you go to your enigma2, to userbouquet.dbe00.tv and there you customize the name of the channels, that’s when you get the error of the picon in the plugin.

this way, doesn’t work

#NAME TDT
#SERVICE 1:0:1F:9C43:9C40:22D4:EEEE0000:0:0:0::LA 1 UHD
#DESCRIPTION LA 1 UHD

That’s when the plugin asks for “channel reference + channel name”, and of course the picon only has the reference.

If you don’t customize the name of the channels, there is no error.

in the normal way. it works

#NAME TDT
#SERVICE 1:0:1F:9C43:9C40:22D4:EEEE0000:0:0:0:

If in enigma2 you leave everything by default it works perfectly, the question is if you want / can, correct this error so those who want to modify the name of the channel in enigma2 don’t get this error.

Apart from that it works wonderfully.

Thanks again.

Hi @DelBierzo

Now I understood :slight_smile:

This is how it works, the plugins gets the channel reference and asks for the PICON (png format) using that reference. If you are customizing the channel name, then you also need to customize the picon name, because it seems the custom name is appended to the reference (strange)

For the channel you customized the channel name, does the picon show on the TV and on the OpenWebIf interface ?
For the channel “LA 1 UHD”, with the customized name, go the the openwebif, and if the logo is there, right click and copy the url address and paste the url here (like in the example below).

image

If you want to make a test, go to the login folder on your device and, assuming the reference id that channel is 1:0:1F:9C43:9C40:22D4:EEEE0000:0:0:0:

Go to the picon folder on your device and copy the icon 1_0_1F_9C43_9C40_22D4_EEEE0000_0_0_0
.png to 1_0_1F_9C43_9C40_22D4_EEEE0000_0_0_0 LA 1 UHD.png and check if it works.

I will have to do some tests on my devices first, before planning on do a change.
Technically seems possible.

Thanks

Hi! @cinzas

The answer is yes to both questions.

Change the picon name in enigma2 does not work.

channel reference:

1:0:1F:9C43:9C40:22D4:EEEE0000:0:0:0:

customizing the channel name, you have to add at the end: colon + channel name

1:0:1F:9C43:9C40:22D4:EEEE0000:0:0:0::LA 1 UHD

the plugin, eats the last letter of the channel name.

error, ask for:

Error retrieving proxied image from
http://xxxx:[email protected]/picon/1_0_1F_9C43_9C40
_22D4_EEEE0000_0_0_0_LA%201%20UH.png

copying link address from openwebif on channel name gives me:

javascript:zapChannel('1:0:1F:9C43:9C40:22D4:EEEE0000:0:0:0::LA 1 UHD', 'LA 1 UHD');

although openwebif seems to also request the name, but picón (.PNG) actually does not have it.

Hi @DelBierzo

I just solved with 1 line of code.

Let me correct another small bug and I will upload a new version

New version 1.9.1

  • Picon working if channel has a custon name defined
  • MEDIA_TYPE_CHANNEL and MEDIA_TYPE_TVSHOW warnigns from boot

image

image

2 Likes

@cinzas

Fast work !! Now it works perfect !!! . Thank you very much. :crazy_face:

After racking my brain for a couple of days, it finally worked!

Controlling our Enigma2 with Alexa !! With OpenATV image, it works perfect, with default settings.

We need to install if we don’t have:

  • Node-RED
    .how to install Node-RED → Home Assistant Community Add-on: Node-RED

  • In Node-RED the node “node-red-contrib-virtual-smart-home”
    .Click on the menu button on upper right corner
    .Click palette manager
    .Click install
    .Type in: node-red-contrib-virtual-smart-home
    .Install it

  • The skill for the virtual smart home
    .On our phone in the Alexa app.
    .Search the skill “virtual smart home” and enable it.
    .Complete the account linking process by logging in with your Amazon account credentials.

virtual-smart-home have two plan: one free and one paid

FREE plan free of charge for as long as you want, it is currently limited to 7 virtual devices.
PAID plan. For 12 EUR per year, you can deploy up to 200 virtual devices. You can upgrade to the “Pro” plan from the Connection dialog within Node-RED.

For our purpose, free plan is enough!

  • And add the shell_command to our configuration.yaml
    .in each line of the shell_command we have to change:
    .curl -u root:YourEnigma2Password -X POST "http://x.x.x.x
    .with our Enigma2 password and our Enigma2 IP

Once we have prepared everything and restarted our home assistant.

In node-red we import the flow or copy the content of it and paste
.Click on the menu button on upper right corner
.Click import
.Click paste or finde the flow and import

Now configure your “virtual device”
.name: “the one you will see on Alexa and to which you will give the orders”
.connection: your account
.type “Here you have to put: Entertainment Device”

And we need to change only the “entity” of our media player with double click we edit and select ours:
.Set Volume to… {media player}
.Set Channel to… {media player}

Once everything is configured, we click deploy (to save the changes)
Every change we make is only saved when we hit delpoy, so don’t forget.

If we did everything correctly, at this moment, in the Alexa app, a new device “TV” appeared, and

¡¡¡ we can now control it !!!

  • if you copy the flow for a second enigma2, we need change it to shell_command_pvr2 <— and so on
  • and of course also change the media player entity

You can ask Alexa to:

  • turn on
  • turn off
  • restart
  • previous channel
  • next channel
  • change to channel (number)
  • volume down
  • volume up
  • volume to (1 through 100)
  • mute
  • unmute

change to channel (number)

The only thing is that in the media player in Home Assistant we will only see the changes in the channels that we have in the first bouquet of the media player. That is, if it has 20 channels and we change to channel 30 of the “second bouquet” the channel change in the decoder but we will not see this change in the media player.

The volume steps in “volume down / volume up” are the ones we have configured in our Enigma2.

With OpenATV image, it works perfect, with default settings.
With another firmware perhaps would have to change:
.*Channel down: shell_command.pvr_left or shell_command.pvr_previous
.*Channel up: shell_command.pvr_right or shell_command.pvr_next

Taking advantage of the notify:

Without having to do the above, if you have the Ulanzi Pixel Clock, with AWTRIX 3 firmware, and mqtt installed you can view on the clock each channel change and what is being broadcast with the following automation.

*change “media_player.xxxxx” and topic “awtrix_xxxxx”

alias: Awtrix - Enigma2
description: ""
triggers:
  - entity_id:
      - media_player.xxxxxx
    attribute: media_title
    trigger: state
conditions:
  - condition: state
    entity_id: media_player.xxxxxx
    state: "on"
actions:
  - data:
      topic: awtrix_xxxxxx/notify
      payload: |-
        {"textCase": 0,
         "repeat": 3,
         "text": "{{states.media_player.xxxxxx.attributes.media_title}}"
        }
    action: mqtt.publish
mode: single

Give thanks to @knuti1960, a member of another community where I got the information about the shell_command.

And of course @cinzas for his work with the add-on for enigma2.

I think I didn’t forget anything and that’s all.

enigma2_shell_command

# 
# just put this file in your home assistant /config dir, and add to your configuration.yaml
# shell_command: !include enigma2_shell_command.yaml
#
# or copy the content below direct to your configuration.yaml
# if you copy, in this case do not forget to remove hash symbol/key # from shell_command:
#
# you have to edit each line with your Enigma2password and Enigma2 IP
# curl -u root:YourEnigma2Password -X POST "http://x.x.x.x
#

#shell_command:
  ### ENIGMA2 (1) ### 
  pvr_reboot: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.51/web/powerstate?newstate=2"'
  pvr_on: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.51/web/powerstate?newstate=4"'
  pvr_off: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.51/web/powerstate?newstate=5"'
  pvr_channel_up: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.51/web/remotecontrol?command=402"'
  pvr_channel_down: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.51/web/remotecontrol?command=403"'
  pvr_mute: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.51/web/remotecontrol?command=113"'
  pvr_volume_up: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.51/web/remotecontrol?command=115"'
  pvr_volume_down: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.51/web/remotecontrol?command=114"'
  pvr_restart_enigma2: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.51/web/powerstate?newstate=3"'
  pvr_left: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.51/web/remotecontrol?command=105"'
  pvr_right: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.51/web/remotecontrol?command=106"'
  pvr_previous: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.51/web/remotecontrol?command=412"'
  pvr_next: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.51/web/remotecontrol?command=407"'

  ### ENIGMA2 (2) ### 
  pvr2_reboot: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.52/web/powerstate?newstate=2"'
  pvr2_on: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.52/web/powerstate?newstate=4"'
  pvr2_off: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.52/web/powerstate?newstate=5"'
  pvr2_channel_up: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.52/web/remotecontrol?command=402"'
  pvr2_channel_down: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.52/web/remotecontrol?command=403"'
  pvr2_mute: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.52/web/remotecontrol?command=113"'
  pvr2_volume_up: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.52/web/remotecontrol?command=115"'
  pvr2_volume_down: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.52/web/remotecontrol?command=114"'
  pvr2_restart_enigma2: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.52/web/powerstate?newstate=3"'
  pvr2_left: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.52/web/remotecontrol?command=105"'
  pvr2_right: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.52/web/remotecontrol?command=106"'
  pvr2_previous: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.52/web/remotecontrol?command=412"'
  pvr2_next: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.52/web/remotecontrol?command=407"'

  ### ENIGMA2 (3) ###
  pvr3_reboot: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.53/web/powerstate?newstate=2"'
  pvr3_on: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.53/web/powerstate?newstate=4"'
  pvr3_off: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.53/web/powerstate?newstate=5"'
  pvr3_channel_up: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.53/web/remotecontrol?command=402"'
  pvr3_channel_down: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.53/web/remotecontrol?command=403"'
  pvr3_mute: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.53/web/remotecontrol?command=113"'
  pvr3_volume_up: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.53/web/remotecontrol?command=115"'
  pvr3_volume_down: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.53/web/remotecontrol?command=114"'
  pvr3_restart_enigma2: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.53/web/powerstate?newstate=3"'
  pvr3_left: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.53/web/remotecontrol?command=105"'
  pvr3_right: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.53/web/remotecontrol?command=106"'
  pvr3_previous: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.53/web/remotecontrol?command=412"'
  pvr3_next: 'curl -u root:YourEnigma2Password -X POST "http://192.168.1.53/web/remotecontrol?command=407"'

The Flows for Node-RED

[
    {
        "id": "7e20344bc034be5c",
        "type": "group",
        "z": "3c9fc4da31e7f319",
        "style": {
            "stroke": "#999999",
            "stroke-opacity": "1",
            "fill": "none",
            "fill-opacity": "1",
            "label": true,
            "label-position": "nw",
            "color": "#a4a4a4"
        },
        "nodes": [
            "562040cf29c7d424",
            "a569b5aba8c377e8",
            "b2e28b86f904da7d",
            "1a0f9e2d1ecb79dd",
            "8cd1313767677423",
            "fdc4698a3655d11e",
            "5f39b64683233f86",
            "903cf8e937a76957",
            "1bfdf29d54fd9d58",
            "1c9406eb4fc791f0",
            "110510273821e5e1",
            "e03a329302417f61",
            "b5bc65683f5874d1",
            "a72dc53614e0a672",
            "cfee494360d0652f",
            "31dd3814c1d98b75",
            "db5684b35e6aa9da",
            "b046c54de93a325b",
            "3593c2d63d2a4def",
            "715ebeebee8012e8",
            "0b6737f4831b742c",
            "58ab113a48e13b4a",
            "5e6d1b6f2223c517",
            "56579d7b971b91d2",
            "5f4fa90d41af8d34",
            "3be0e74eccfabf5c",
            "7dcc2790a6faeb69",
            "dfc158ccc99f71f3",
            "d6b6aa235aaeea30",
            "14a842fb81428ae2",
            "5cae9c2950d6f4cc",
            "6463100de24c1be9",
            "77b21e49617a1e58",
            "67644423b54f31ce",
            "b70c2f04a8742472",
            "a248dc41c9feee9a"
        ],
        "x": 514,
        "y": 6499,
        "w": 1952,
        "h": 842
    },
    {
        "id": "562040cf29c7d424",
        "type": "api-call-service",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "Set Volume to.... {media player}",
        "server": "44bb2d4a.187a64",
        "version": 7,
        "debugenabled": false,
        "action": "media_player.volume_set",
        "floorId": [],
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "media_player.gbip4k"
        ],
        "labelId": [],
        "data": "{ \"volume_level\": \"{{payload.volume}}\" }",
        "dataType": "json",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "blockInputOverrides": true,
        "domain": "media_player",
        "service": "volume_set",
        "x": 1870,
        "y": 6980,
        "wires": [
            []
        ]
    },
    {
        "id": "a569b5aba8c377e8",
        "type": "switch",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "You command, I obey",
        "property": "payload.directive",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "StartOver",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "TurnOn",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "TurnOff",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "SetMute",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "SetVolume",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "AdjustVolume",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "SkipChannels",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "ChangeChannel",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 8,
        "x": 1000,
        "y": 7040,
        "wires": [
            [
                "5f39b64683233f86"
            ],
            [
                "fdc4698a3655d11e"
            ],
            [
                "8cd1313767677423"
            ],
            [
                "1a0f9e2d1ecb79dd"
            ],
            [
                "b2e28b86f904da7d"
            ],
            [
                "cfee494360d0652f"
            ],
            [
                "a72dc53614e0a672"
            ],
            [
                "b5bc65683f5874d1"
            ]
        ]
    },
    {
        "id": "b2e28b86f904da7d",
        "type": "function",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "change volume from 0/100 to 0/1 {media player request}",
        "func": "msg.payload.volume = msg.payload.volume/100;\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1490,
        "y": 6980,
        "wires": [
            [
                "562040cf29c7d424"
            ]
        ]
    },
    {
        "id": "1a0f9e2d1ecb79dd",
        "type": "api-call-service",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "Mute {shell command}",
        "server": "44bb2d4a.187a64",
        "version": 7,
        "debugenabled": false,
        "action": "shell_command.pvr_mute",
        "floorId": [],
        "areaId": [],
        "deviceId": [],
        "entityId": [],
        "labelId": [],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "blockInputOverrides": true,
        "domain": "shell_command",
        "service": "pvr_mute",
        "x": 1380,
        "y": 6920,
        "wires": [
            []
        ]
    },
    {
        "id": "8cd1313767677423",
        "type": "api-call-service",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "Power off {shell command}",
        "server": "44bb2d4a.187a64",
        "version": 7,
        "debugenabled": false,
        "action": "shell_command.pvr_off",
        "floorId": [],
        "areaId": [],
        "deviceId": [],
        "entityId": [],
        "labelId": [],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "blockInputOverrides": true,
        "domain": "shell_command",
        "service": "pvr_off",
        "x": 1400,
        "y": 6860,
        "wires": [
            []
        ]
    },
    {
        "id": "fdc4698a3655d11e",
        "type": "api-call-service",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "Power on {shell command}",
        "server": "44bb2d4a.187a64",
        "version": 7,
        "debugenabled": false,
        "action": "shell_command.pvr_on",
        "floorId": [],
        "areaId": [],
        "deviceId": [],
        "entityId": [],
        "labelId": [],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "blockInputOverrides": true,
        "domain": "shell_command",
        "service": "pvr_on",
        "x": 1400,
        "y": 6800,
        "wires": [
            []
        ]
    },
    {
        "id": "5f39b64683233f86",
        "type": "api-call-service",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "Reboot decoder {shell command}",
        "server": "44bb2d4a.187a64",
        "version": 7,
        "debugenabled": false,
        "action": "shell_command.pvr_reboot",
        "floorId": [],
        "areaId": [],
        "deviceId": [],
        "entityId": [],
        "labelId": [],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "blockInputOverrides": true,
        "domain": "shell_command",
        "service": "pvr_reboot",
        "x": 1180,
        "y": 6740,
        "wires": [
            []
        ]
    },
    {
        "id": "903cf8e937a76957",
        "type": "api-call-service",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "Reboot enigma2 image {shell command}",
        "server": "44bb2d4a.187a64",
        "version": 7,
        "debugenabled": false,
        "action": "shell_command.pvr_reboot",
        "floorId": [],
        "areaId": [],
        "deviceId": [],
        "entityId": [],
        "labelId": [],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "blockInputOverrides": true,
        "domain": "shell_command",
        "service": "pvr_reboot",
        "x": 1200,
        "y": 6700,
        "wires": [
            []
        ]
    },
    {
        "id": "1bfdf29d54fd9d58",
        "type": "api-call-service",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "Volume down {shell command}",
        "server": "44bb2d4a.187a64",
        "version": 7,
        "debugenabled": false,
        "action": "shell_command.pvr_volume_down",
        "floorId": [],
        "areaId": [],
        "deviceId": [],
        "entityId": [],
        "labelId": [],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "blockInputOverrides": true,
        "domain": "shell_command",
        "service": "pvr_volume_down",
        "x": 1630,
        "y": 7040,
        "wires": [
            []
        ]
    },
    {
        "id": "1c9406eb4fc791f0",
        "type": "api-call-service",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "Volume up {shell command}",
        "server": "44bb2d4a.187a64",
        "version": 7,
        "debugenabled": false,
        "action": "shell_command.pvr_volume_up",
        "floorId": [],
        "areaId": [],
        "deviceId": [],
        "entityId": [],
        "labelId": [],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "blockInputOverrides": true,
        "domain": "shell_command",
        "service": "pvr_volume_up",
        "x": 1620,
        "y": 7080,
        "wires": [
            []
        ]
    },
    {
        "id": "110510273821e5e1",
        "type": "api-call-service",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "Channel down / previous channel {shell command}",
        "server": "44bb2d4a.187a64",
        "version": 7,
        "debugenabled": false,
        "action": "shell_command.pvr_channel_down",
        "floorId": [],
        "areaId": [],
        "deviceId": [],
        "entityId": [],
        "labelId": [],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "blockInputOverrides": true,
        "domain": "shell_command",
        "service": "pvr_channel_down",
        "x": 1650,
        "y": 7180,
        "wires": [
            []
        ]
    },
    {
        "id": "e03a329302417f61",
        "type": "api-call-service",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "Channel up / next channel {shell command}",
        "server": "44bb2d4a.187a64",
        "version": 7,
        "debugenabled": false,
        "action": "shell_command.pvr_channel_up",
        "floorId": [],
        "areaId": [],
        "deviceId": [],
        "entityId": [],
        "labelId": [],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "blockInputOverrides": true,
        "domain": "shell_command",
        "service": "pvr_channel_up",
        "x": 1630,
        "y": 7220,
        "wires": [
            []
        ]
    },
    {
        "id": "b5bc65683f5874d1",
        "type": "api-call-service",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "Set Channel to.... {media player}",
        "server": "44bb2d4a.187a64",
        "version": 7,
        "debugenabled": true,
        "action": "media_player.play_media",
        "floorId": [],
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "media_player.gbip4k"
        ],
        "labelId": [],
        "data": "{ \"media_content_id\": \"{{payload.channel}}\",   \"media_content_type\" : \"channel\" }",
        "dataType": "json",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "blockInputOverrides": true,
        "domain": "media_player",
        "service": "play_media",
        "x": 1210,
        "y": 7300,
        "wires": [
            []
        ]
    },
    {
        "id": "a72dc53614e0a672",
        "type": "switch",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "Channel down/up",
        "property": "payload.rawDirective.directive.payload.channelCount",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "-1",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "+1",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 1330,
        "y": 7200,
        "wires": [
            [
                "110510273821e5e1"
            ],
            [
                "e03a329302417f61"
            ]
        ]
    },
    {
        "id": "cfee494360d0652f",
        "type": "switch",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "Volume down/up",
        "property": "payload.rawDirective.directive.payload.volume",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "-10",
                "vt": "num"
            },
            {
                "t": "eq",
                "v": "+10",
                "vt": "num"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 1370,
        "y": 7060,
        "wires": [
            [
                "1bfdf29d54fd9d58"
            ],
            [
                "1c9406eb4fc791f0"
            ]
        ]
    },
    {
        "id": "31dd3814c1d98b75",
        "type": "comment",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "Control Enigma2 with virtual smart home + alexa + {shell_command + media_player}",
        "info": "",
        "x": 890,
        "y": 6580,
        "wires": []
    },
    {
        "id": "db5684b35e6aa9da",
        "type": "vsh-virtual-device",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "",
        "topic": "",
        "metadata": "",
        "connection": "",
        "template": "ENTERTAINMENT_DEVICE",
        "retrievable": false,
        "passthrough": true,
        "diff": false,
        "filter": false,
        "filterTopic": false,
        "plan": "free",
        "x": 690,
        "y": 7040,
        "wires": [
            [
                "a569b5aba8c377e8"
            ]
        ]
    },
    {
        "id": "b046c54de93a325b",
        "type": "comment",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "With OpenATV image, it works perfect.",
        "info": "",
        "x": 2010,
        "y": 7120,
        "wires": []
    },
    {
        "id": "3593c2d63d2a4def",
        "type": "comment",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "this flow uses the shell_command_pvr <--- for the first Enigma2",
        "info": "",
        "x": 1950,
        "y": 6540,
        "wires": []
    },
    {
        "id": "715ebeebee8012e8",
        "type": "comment",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "¡¡¡ if you copy the flow for a second enigma2, it would be shell_command_pvr2 <--- and so on !!!",
        "info": "",
        "x": 2050,
        "y": 6580,
        "wires": []
    },
    {
        "id": "0b6737f4831b742c",
        "type": "comment",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "¡¡¡ the same happens with \"entity\" media_player.xxxxx, don't forget to change it !!!",
        "info": "",
        "x": 2000,
        "y": 6620,
        "wires": []
    },
    {
        "id": "58ab113a48e13b4a",
        "type": "comment",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "The name you give to the virtual device",
        "info": "",
        "x": 690,
        "y": 6740,
        "wires": []
    },
    {
        "id": "5e6d1b6f2223c517",
        "type": "comment",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "is the name you will see on Alexa !",
        "info": "",
        "x": 680,
        "y": 6780,
        "wires": []
    },
    {
        "id": "56579d7b971b91d2",
        "type": "comment",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "then you could tell him for example...",
        "info": "",
        "x": 680,
        "y": 6820,
        "wires": []
    },
    {
        "id": "5f4fa90d41af8d34",
        "type": "comment",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "Alexa switches to channel 5 on \"virtual device name\"",
        "info": "",
        "x": 730,
        "y": 6860,
        "wires": []
    },
    {
        "id": "3be0e74eccfabf5c",
        "type": "comment",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "by default let reboot decoder, you can change it to reboot the Enigma2 image",
        "info": "",
        "x": 1650,
        "y": 6700,
        "wires": []
    },
    {
        "id": "7dcc2790a6faeb69",
        "type": "comment",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "If you change the name to your \"virtual device\" automatically",
        "info": "",
        "x": 760,
        "y": 6900,
        "wires": []
    },
    {
        "id": "dfc158ccc99f71f3",
        "type": "comment",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": " in Alexa you will see the change reflected as well",
        "info": "",
        "x": 720,
        "y": 6940,
        "wires": []
    },
    {
        "id": "d6b6aa235aaeea30",
        "type": "comment",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "the command is: Alexa restart \"virtual device name\"",
        "info": "",
        "x": 1570,
        "y": 6740,
        "wires": []
    },
    {
        "id": "14a842fb81428ae2",
        "type": "comment",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "case you decide to change it",
        "info": "",
        "x": 660,
        "y": 6980,
        "wires": []
    },
    {
        "id": "5cae9c2950d6f4cc",
        "type": "comment",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "<--- change only your \"entity\" media player",
        "info": "",
        "x": 1520,
        "y": 7300,
        "wires": []
    },
    {
        "id": "6463100de24c1be9",
        "type": "comment",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "<--- change only your \"entity\" media player",
        "info": "",
        "x": 2180,
        "y": 6980,
        "wires": []
    },
    {
        "id": "77b21e49617a1e58",
        "type": "comment",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": " Channel down to: shell_command.pvr_left or shell_command.pvr_previous",
        "info": "",
        "x": 2120,
        "y": 7200,
        "wires": []
    },
    {
        "id": "67644423b54f31ce",
        "type": "comment",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": " Channel up to: shell_command.pvr_right or shell_command.pvr_next",
        "info": "",
        "x": 2100,
        "y": 7240,
        "wires": []
    },
    {
        "id": "b70c2f04a8742472",
        "type": "comment",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "With another firmware perhaps would have to change:",
        "info": "",
        "x": 2060,
        "y": 7160,
        "wires": []
    },
    {
        "id": "a248dc41c9feee9a",
        "type": "comment",
        "z": "3c9fc4da31e7f319",
        "g": "7e20344bc034be5c",
        "name": "by default: shell_command.pvr_channel_down and shell_command.pvr_channel_up",
        "info": "\n",
        "x": 2150,
        "y": 7280,
        "wires": []
    },
    {
        "id": "44bb2d4a.187a64",
        "type": "server",
        "z": "3c9fc4da31e7f319",
        "name": "Home Assistant",
        "addon": true,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "",
        "connectionDelay": false,
        "cacheJson": false,
        "heartbeat": false,
        "heartbeatInterval": "",
        "statusSeparator": "",
        "enableGlobalContextStore": false
    }
]
2 Likes

@DelBierzo : Excellent Work.

I don’t use node red, but I can try to have a look on how to this manually.
I also don’t have Alexa, i have multiple google devices instead :slight_smile:

Let me think how we can optimize this.

I could add this information to the github in case more people is interested.

As I wrote some postings above: I once made a “remote” for the dashboard.
Based on scripts and associated shell commands. This can also be used for Alexa, as I have described here (another forum, German language). You can also find all the shell commands and scripts you need there. I don’t use Node Red. But it’s great that @DelBierzo has managed to do it with Node Red.
With these options, an Enigma2 box can be fully controlled from HA.

2 Likes