Devolo CPL/PLC/BPL

Hello there :slight_smile:

I’m using Devolo BPL (is it the proper name in English?) in my home.
It is only Ethernet, no wifi booster what so ever.

And I like the network schema in the Devolo cockpit app.

But I’d really like that to be part of Home Assistant, to see if everything is still well linked together
and maybe, who knows, alert me when something is wrong.

The Devolo integration isn’t working for my material/usage.
Do you know if something is able to “map” the Broadband over Power Line network?

1 Like

Found this here:

However a browse through its source code revealed that it is capable of sending the 0xa038 Network Info Request packet and receiving and decoding the corresponding 0xa039 Network Info Confirm reply. This was exactly what I was looking for.

https://www.tablix.org/~avian/blog/archives/2018/05/monitoring_homeplug_av_devices/

I’ll have a look at the github. Thx.

I just played a bit with it but despite I’m being to install the package version (ubuntu) of faifa I’m struggelin getting @avian2’s faifa fork executing :thinking:

autogen.sh and configure seems successfully doing something but It doesn’t build a binary afaik.

I found another (more recent?) tool called open-plc-utils

after installing it’s enough to call something like: plcstat -i wlp1s0 -t

to get a output like this:

 P/L NET TEI ------ MAC ------ ------ BDA ------  TX  RX CHIPSET FIRMWARE
 LOC STA 003 30:XX:XX:XX:XX:XX 9C:XX:XX:XX:XX:XX n/a n/a QCA7420 MAC-QCA7420-1.1.1.1193-03-20140207-CS
 REM CCO 001 30:XX:XX:XX:XX:XX 80:XX:XX:XX:XX:XX 050 071 QCA7420 MAC-QCA7420-1.1.1.1193-03-20140207-CS
 REM STA 002 30:XX:XX:XX:XX:XX 24:XX:XX:XX:XX:XX 014 034 QCA7420 MAC-QCA7420-1.1.1.1193-03-20140207-CS
 REM STA 004 30:XX:XX:XX:XX:XX 34:XX:XX:XX:XX:XX 061 077 QCA7420 MAC-QCA7420-1.1.1.1193-03-20140207-CS

So now there should be only little work left to “bridge” this command line output into ha :brain::dash:

Some more links:

And looks like openwrt actually can collect plc information too:

For now just showing … maybe the open-wrt ha plugin can utilize this metrics…

Got more or less the same output as yours:

pi@hassbian:/usr/local/bin $ plcstat -t -i eth0
 P/L NET TEI ------ MAC ------ ------ BDA ------  TX  RX CHIPSET FIRMWARE
 LOC STA 030 F4:06:8D:C1:B6:29 B8:27:EB:5E:63:B4 n/a n/a QCA7420 MAC-QCA7420-1.1.1.1193-03-20140207-CS
 REM CCO 001 30:D3:2D:12:CB:29 98:9D:5D:40:44:3B 269 283 QCA7420 MAC-QCA7420-1.1.1.1193-03-20140207-CS
 REM STA 003 30:D3:2D:12:CA:F9 30:91:8F:14:FF:54 275 302 QCA7420 MAC-QCA7420-1.1.1.1193-03-20140207-CS

Now, need to find a library to graph that to use it in HA

I would say more! Your up/down-link from your PLC devices are magnitudes better (~300mbits) then mine :stuck_out_tongue:

Any idea how to feed the output from the command line into ha? I see you run plcstat directly on ha - so that could be even a command line sensor in your case I guess :point_down:

I’m looking at python first, with mathplotlib and networkx
It should be able to draw an image, not very interactive but yet it is something to start.

Wouldn’t be the approach to get the TX/RX rates for each PLC device into HA and then use some (custom) card to do the drawing/plotting? That way it could be even interactive and HA can keep a proper history of the data. :page_with_curl:

I have also the hope to spot some device(s) which (when turned on) negatively influence the performance of my PLC network. Should be a treat ones I have the stats in HA to just plot them beside (HA attached) loads to see what impact they have :microscope:

One is not blocking the other.
My plan is to do a drawing with nodes and speed (to see if this is something viable).
Then, whould be better to have something integrated.
The data can still be push into HA with some script + mqtt.

1 Like

Both is not needed in your case I think.

You can just use something like this Command Line - Home Assistant

# Example configuration.yaml entry
sensor:
  - platform: command_line
    command: plcstat -t -i eth0
    name: "Devolo TV Downstream"
    unique_id: devolo_tv_downstream
    unit_of_measurement: mbits
    value_template: # the hard part goes here

as for a visual like the devolo cockpit you can just go with picture elements card :framed_picture: use this as background image:

and dynamically show the link rates with the help of a state label :label:

For me it looks like the values for down- and upstream are actually twisted in the devolo cockpit software.

For example for the device on top left the upstream indicates 43mbits and downstream 20mbits for me.

image
image

checking with the command line I get the opposite/twisted (and little lower) values:

TX 015 mbps Primary
RX 033 mbps Primary

I know but I do not exclude more CPL, so I’d like to be as dynamic as possible starting with the easiest and moving forward, maybe included in the Devolo integration.

1 Like

Not very nice but it is my first attempt

devolo

Edit: Little lower is because it is in MB/s while Devolo cockpit is MiB/s (I think, the infamous 1000 or 1024)
Edit2 : All my arrows are green. One of yours is yellow-ish orange-ish, do you know why?
Edit3: I’ll work on it in the week-end.

1 Like

Because the link budget is so weak.

Only 20Mbit/s for (by the looks of it the downstream for the device up left - but actually it seems to be the upload for me :thinking:)

I’m not that much interrested in the value in my case but more about the link.

I used to lose the link with the PLC providing the internet connection and I’d like to detect it (and maybe do an operation)

Today, when I’m facing this issue, I’m starting the cockpit, and just disable/enable the LED and it is discovering all the plugs back. Maybe I could trigger that action from the tools installed 2 days ago…

(devolo) pi@hassbian:~/devolo $ plcstat -t -i eth0
 P/L NET TEI ------ MAC ------ ------ BDA ------  TX  RX CHIPSET FIRMWARE
 LOC STA 006 F4:06:8D:C1:B6:29 B8:27:EB:5E:63:B4 n/a n/a QCA7420 MAC-QCA7420-1.1.1.1193-03-20140207-CS
 REM STA 002 30:D3:2D:12:CB:29 98:9D:5D:40:44:3B 279 280 QCA7420 MAC-QCA7420-1.1.1.1193-03-20140207-CS
 REM CCO 003 30:D3:2D:12:CA:F9 30:91:8F:14:FF:54 282 309 QCA7420 MAC-QCA7420-1.1.1.1193-03-20140207-CS

(devolo) pi@hassbian:~/devolo $ plcrate -n -i eth0 F4:06:8D:C1:B6:29
eth0 F4:06:8D:C1:B6:29 30:D3:2D:12:CB:29 TX 280 mbps Primary
eth0 F4:06:8D:C1:B6:29 30:D3:2D:12:CB:29 RX 281 mbps Primary
eth0 F4:06:8D:C1:B6:29 30:D3:2D:12:CA:F9 TX 281 mbps Primary
eth0 F4:06:8D:C1:B6:29 30:D3:2D:12:CA:F9 RX 309 mbps Primary

(devolo) pi@hassbian:~/devolo $ plcrate -n -i eth0 30:D3:2D:12:CB:29
eth0 30:D3:2D:12:CB:29 30:D3:2D:12:CA:F9 TX 339 mbps Primary
eth0 30:D3:2D:12:CB:29 30:D3:2D:12:CA:F9 RX 336 mbps Primary
eth0 30:D3:2D:12:CB:29 F4:06:8D:C1:B6:29 TX 281 mbps Primary
eth0 30:D3:2D:12:CB:29 F4:06:8D:C1:B6:29 RX 280 mbps Primary

(devolo) pi@hassbian:~/devolo $ plcrate -n -i eth0 30:D3:2D:12:CA:F9
eth0 30:D3:2D:12:CA:F9 30:D3:2D:12:CB:29 TX 336 mbps Primary
eth0 30:D3:2D:12:CA:F9 30:D3:2D:12:CB:29 RX 339 mbps Primary
eth0 30:D3:2D:12:CA:F9 F4:06:8D:C1:B6:29 TX 309 mbps Primary
eth0 30:D3:2D:12:CA:F9 F4:06:8D:C1:B6:29 RX 281 mbps Primary

Obviously some are duplicated link
Like

plcrate -n -i eth0 30:D3:2D:12:CB:29
eth0 30:D3:2D:12:CB:29 30:D3:2D:12:CA:F9 TX 339 mbps Primary

is the same as

plcrate -n -i eth0 30:D3:2D:12:CA:F9
eth0 30:D3:2D:12:CA:F9 30:D3:2D:12:CB:29 RX 339 mbps Primary

The TX of one is the RX of the other. Where am I going? My hair already turned white.

EDIT: Pretty happy so far

1 Like

As a picture glance card in HA. Image is updated every 10 minutes.
image

@orange-assistant, are you interrested in something like this? using mqtt?

I can give you one shell doing it.

I’m very much - but not with mqtt if possible. I don’t have a broker running anymore since couple years and to shut it down was one of the biggest efficiency boosts (not in terms of computing power but just getting things working much quicker without debugging, retained messages etc.) mostly by just using the esphome native api in my case.

But it should be more (or less) trivial to get the entities you are showing with solely relying on the command line sensor (in case no HaOS is involved - I guess)

Just the last line needs the proper value_template to extract the wanted measurement and that should be it.