Sign in   |  Join   |  Help

Masterlink Gateway and Beolink Gateway integration Home Assistant

rated by 0 users
Not Answered This post has 0 verified answers | 82 Replies | 2 Followers

Giovanni
Not Ranked
San Francisco Bay Area
55 Posts
OFFLINE
Bronze Member
Giovanni posted on Tue, Jan 5 2021 4:36 PM

Hi there

Just to let you know that I created an integration between Masterlink Gateway and Beolink Gateway with Home Assistant with some really cool functionality to tap directly into the Masterlink bus and enable all kinds of fun integrations like controlling your digital streaming from your old school Beolink devices.

 

https://github.com/giachello/mlgw

 

All Replies

Giovanni
Not Ranked
San Francisco Bay Area
55 Posts
OFFLINE
Bronze Member

Cool I think I found the issue. Fixing the code and releasing later in the weekend.

 

 

Giovanni
Not Ranked
San Francisco Bay Area
55 Posts
OFFLINE
Bronze Member

Ok, I uploaded new version of the code, let me know if it works!

 

Zeus_72
Not Ranked
35 Posts
OFFLINE
Bronze Member

Now the plug-in works fine for audio sources.

Lovelace still doesn't show when a device (eg Beovision7) plays a local source (eg TV). Seeing the logs maybe there is a trick, but I want to be sure. As for the Playload type 0X44 and its subtype 0X0B, I discovered some things that can help in reporting the info of the source in use on Home assistant. I am attaching a pdf with what I have discovered so far.

Listening to the ML protocol you discover new things every time ...Smile

 

 

Giovanni
Not Ranked
San Francisco Bay Area
55 Posts
OFFLINE
Bronze Member

Local sources are an issue because nothing is reported on the ML bus when you select a local source like A.MEM. For example, when I select A.MEM on the Audio Master no message is sent out.

So not sure there is a solution for this.

Please send the log from selecting TV on the Beovision and we can look for any traffic.

 

Giovanni
Not Ranked
San Francisco Bay Area
55 Posts
OFFLINE
Bronze Member
Giovanni replied on Wed, Jan 20 2021 12:43 AM

For the Status messages you put in the PDF for payload type, can you cut and paste the actual logs? I find it easier to read through that.

thank you!

Zeus_72
Not Ranked
35 Posts
OFFLINE
Bronze Member

 

Hi Giovanni

you found a nice way to tell me that I made a few mistakes ... and indeed it is. I have confused hexadecimal numbers with decimal ones.

I am attaching you correct pdf with the log lines examined.

I am not attaching the log because it is what I entered in the previous post.

At the weekend I rehearse with the televisions and then I send you the logs you asked for.

I would like to propose some changes to the names you used to call the Masterlink nodes.

 

In your plug in you report these associations for devices (Node Name):

 

0x80 = ALL

0x83 = ALL_LINK_DEVICES

0xC0 = VIDEO_MASTER

0xC1 = AUDIO_MASTER

0XC2 = SLAVE_DEVICE ----> 0XC2 = SOURCE_CENTER

0xF0 = MLGW

 

I would propose to use for 0XC2 the name "Source_Center" which is used in the B&O manuals when referring to multimedia / PC sources.

Zeus_72
Not Ranked
35 Posts
OFFLINE
Bronze Member

Here I am with the required log.

Here are the actions I performed while recording the log.

19:20 With the system completely off, using the beo4 remote control, I turn on the BV7 by calling up the DTV (local source).

           The BeoVision7 (VideoMaster) switches on and transmits the DTV channel. The interface lovelace does not show any B&O devices turned on.

19.25 With beo4  I change channel on the tv (ch.1)

19:30 With the remote control I change source from DTV to DVD (local sources)

          Nothing happens on the interface lovelace

19:35 Using Beo4 I turn off the BV7. The whole system shuts down.

 

19:40 Using Beo4 I turn on bv10 (VideoSlave) by calling up the TV (local source).

         The BeoVision10 switches on and transmits the TV channel. The lovelace interface does not show any B&O devices turned on.

19:45 With remote  change channel on the tv (ch.1)

           Nothing happens on the interface lovelace

19:50 With BV7 I change source from TV to DVD (from local source to VideoMaster source)

          The beovision 7 turns on with the black screen and at the same time starts the DVD.

          Home assistant shows the bv10 switched on with DVD source.

19:55 While the BV10 is on, I turn on the BL2000 through its "RADIO" button.

          The BL 2000 (Audio Slave) turns on and plays the RADIO source (AudioMaster source)

          The BV10 continues to play the DVD (both audio and video)

          Home assistant shows shows the BL2000 and BV10 switched on and playing the radio source.


20:00 I position myself in front of the BL10 and change chapter / track of the DVD with the remote control.

          The BV10 skips to the next scene and continues to play the video and audio of the DVD

          The BL2000 continues to play the radio.

          Home assistant still shows "Radio" as source for both devices.

20:05 Through the Home assistant interface I change the BL2000 source from Radio to DVD (from AudioMaster sorce to VideoMaster source)

          Both the BL2000 and the BV10 reproduce the audio of the DVD. Logically the BV10 also plays the video.

          Lovelace shows "DVD" as the source for both devices.

20:10 Through the Home assistant interface I turn off the bl2000.

          Lovelace only shows BV10 active

20:15 Using the beo4 I turn off the BeoVision10. The whole system shuts down.

I hope all of this will help you.

One thing I noticed when viewing the log is that there is a payload type (0X08) which should indicate if the audio_bus of the masterlink cable is transmitting an audio stream. (The audio stream can be from either an Audiomaster or a VideoMaster).

I saw 3 values ​​for the subtype:

If the value is equal to 0X01 then it is a status request.

If the value is 0X04 then it is an answer whose meaning is "the bus is not occupied by an audio stream"

If the value is 0X06 then it is a response with the payload_len: 4 which means "the bus is occupied by an audio stream". The last Byte will be the source that occupies the bus.

There are also two other payload types 0X07 and 0X1C but I don't know what they mean.

I am waiting for your reply.

Thanks

Giovanni
Not Ranked
San Francisco Bay Area
55 Posts
OFFLINE
Bronze Member

Thank you for sharing. The main issue is that the MLGW plugin doesn't support two sources at the same time (one on one TV and the other on the other) so some re-engineering is needed to support that. definitely doable but will take some time.

Looking at the logs it looks like the best way to detect activity on the TVs is to use the picture and sound status messages. there may be a way to tracking the audio master when it turns on and off too.

Thanks for sharing the logs, very helpful!

Giovanni

Giovanni
Not Ranked
San Francisco Bay Area
55 Posts
OFFLINE
Bronze Member

Ok try the current version on github. It should handle TVs better and the sources should be less messed up but I am not sure I handled all the corner cases, so please provide feedback on the same sequence of events you shared previously. Thanks!

 

Zeus_72
Not Ranked
35 Posts
OFFLINE
Bronze Member

Ciao Giovanni, Thanks for mentioning me on github

I attack you the new log. I performed the sequences 3 minutes apart.

I just changed the final sequence, I turned off the BV10 from Home assistant and the bl2000 with its button.

The Lovelace interface showed no change when I gave the commands to the BV7 (VideoMaster) by calling up the local sources. Same with the BV10 and local sources, while with the remote sources (DVD of the BV7) things worked.

The lovelace interface showed source changes separately for the slave tv and the slave speaker even while the bv10 showed a dvd and the beolab 2000 played the radio.

I would like to make some considerations and I hope you take them into consideration:

1) what you now call - payload_type ':' UNKNOWN_SOURCE_REQUEST -  it is what, in the previous message, I called "Audio_Bus" and it should indicate if an audio stream goes through the masterlink cable.

I believe that the payload 0x08 works together with 0x07 and 0x1C, but on this statement I have no objective data

I said:

         I saw 3 values ​​for the subtype:

        -  If the value is equal to 0X01 then it is a status request.

        -  If the value is 0X04 then it is an answer whose meaning is "the bus is not occupied by an audio stream"

         - If the value is 0X06 then it is a response with the payload_len: 4 which means "the bus is occupied by an audio stream".

           The last Byte will be the source that occupies the bus.

In the log we see:

VideoMaster asks AudioMaster : 'payload_type': 'UNKNOWN_SOURCE_REQUEST', 'payload_len': '0', 'payload': {}, 'timestamp': '2021-01-25T20:23:17.259000', 'bytes': 'c1c0010b000000080001'

AudioMaster replies to Video Master : payload_type': 'UNKNOWN_SOURCE_REQUEST', 'payload_len': '4', 'payload': {}, 'timestamp': '2021-01-25T20:23:17.289000', 'bytes': 'c0c101140000000804060201006f    (0x6f =RADIO)

 

2) BeoSound 5 / BeoMaster5 consists of a beolink PC2 card connected to a winxp pc embedded. In the beolink system the BS5 / BM5 is recognized both as AudioMaster (0XC1) and as Source Center / PC (0XC2)

That's why I proposed to you:  0XC2 = SLAVE_DEVICE ----> 0XC2 = SOURCE_CENTER

    Many things I found in this repository: https://github.com/toresbe/libpc2

3) In truth this is not a consideration but a curiosity. Why did you rename (0x5C, "REQUEST_KEY") to (0x5C, "LOCK_MANAGER_COMMAND")?

I have many other questions for you, but for now I'll stop here. Continue to thank you for the work you are doing and I renew my help.

 

 

Giovanni
Not Ranked
San Francisco Bay Area
55 Posts
OFFLINE
Bronze Member

 

Odd about the beovisions not showing that they are on. I added code to set the state to on line 442 of gateway.py. there must be a bug

the code is:

if self._devices is not None and (
response[9] == 0x01 or response[11] == 0x01
):
for x in self._devices:
if x._mln == sourceMLN:
x.set_state(STATE_ON)

 

try to add a logging item just before the for statement. (with the same indentation using spaces, not tabs!!)

_LOGGER.info(f"mlgw: Picture active: {response[9]} on MLN: {sourceMLN}")

 

For 1) happy to add it.  are you 100% sure the telegram does exactly that? I am hesitant to name it with a name that assumes what it does without completely understanding it. 

2)  that's interesting I saw Slave-device in other documentation. but either may work.

3) Lock manager actually I found documented in an article that describes the actual protocol. check out  the link in const.py. I think it's a more accurate representation of the telegram.

 

 

 


Zeus_72
Not Ranked
35 Posts
OFFLINE
Bronze Member

I have attached today's log.

Giovanni
Not Ranked
San Francisco Bay Area
55 Posts
OFFLINE
Bronze Member

Ok I think I found the bug

try changing lines 412 and 385 from

sourceMLN = _getmlnstr(response[4])

to 

sourceMLN = response[4]

Zeus_72
Not Ranked
35 Posts
OFFLINE
Bronze Member
Zeus_72 replied on Tue, Jan 26 2021 10:33 PM
So,

Good news first. The Lovelace interface recognizes when the bv7 (videomaster) and the bv10 (video slave) are on and when they are off. For the video slave it also shows the correct source. A great job.

The bad news is that home assistant does not report the right source for the videomaster, moreover if I set a video source (eg DVD) through the Lovelace interface both the bv7 and the bv10 only reproduce the audio with the screen off.

Tomorrow or at the latest for the weekend I will do further and more thorough tests and I will attach the log to you.

I believe you are on the right track. Yes - thumbs up
Giovanni
Not Ranked
San Francisco Bay Area
55 Posts
OFFLINE
Bronze Member

For the right source in the videomaster

Change line 404 from

if sourceActivity == "Playing" and self._devices is not None:

to:

if sourceActivity != "Standby" and self._devices is not None:

 

For the second one I don't know... let's try to isolate it with the log.


Page 2 of 6 (83 items) < Previous 1 2 3 4 5 Next > ... Last » | RSS
Beoworld Security Certificate

SSL