Wifi Signal strengh sensor

Hi,

Setting a command-line sensor on HA to just show the Wifi Signal !

  - platform: command_line
    name: Wifi Signal
    command: 'iwconfig wlan0 |grep Signal|cut -d"=" -f3|cut -d" " -f1'
    unit_of_measurement: " dBm"
    value_template: '{{ value | round(1) }}'

Command line is OS specific.

What have you tried that did not work satisfactorily? We are here to help those who at least try themselves.

I’m using rasbian … so debian
I’m trying to use the command line sensor

I want the wifi strehgh / signal in the HA lovelace frontend.
I’m not skilled enough to just have the value for them to publish in the frontend

Its working :slight_smile:

  - platform: command_line
    name: Wifi Signal
    command: 'iwconfig wlan0 |grep Signal|cut -d"=" -f3|cut -d" " -f1'
    unit_of_measurement: " dBm"
    value_template: '{{ value | round(1) }}'

How to get this to work?
Looks like iwconfig isn’t available anymore in hass.
In buster it’s working

Hi,
I’m using system info:
Distro…: Raspbian GNU/Linux 9 (stretch)
Kernel…: Linux 4.19.66-v7+
and iwconfig works fine …
do note that HASSIO is based on resin OS and not Debian .

I’m on buster, iwconfig works but it’s not in hass docker

sorry . I’m probably not getting it …
are you refering to docker instalation ? … i’m using rasbian … hassbian … not the docker version (HassIO)

but if it works for you , that’s good , right ?
is there any way to install it on docker ?

That’s the question yes: is there any way to install it on docker ?

1 Like

Are you able to install ?

sudo apt-get install wireless-tools

dont have HASSIO … dont know if it works …

the mention to issues is just referring to Debian (not docker :frowning: )

It’s installed but not available in docker, maybe some of the profs can give a hint

I know the conversation here is old but have been working on this for a few days and came up with two sensors. Hope this helps.


- platform: command_line
  name: Wifi Level
  command: "grep 'wlan0' /proc/net/wireless | awk '{print $4}'"
  unit_of_measurement: "dBm"
  value_template: '{{ value | multiply(1) }}'
  
- platform: command_line
  name: Wifi Quality
  command: "grep 'wlan0' /proc/net/wireless | awk '{print $3}'"
  unit_of_measurement: "%"
  value_template: '{{ value | multiply(100) | float / 70 }}'
  scan_interval: 300

1 Like

well … to late for me … moved away from wireless months ago … I now have the raspberry PI directly connected via Port on router.
it increased the speed to ways I’m now possible to use some addons (eg: adGuard) that was unthinkable with WIFI …

BTW : I’m also on HassIO

Hi! On my NUC with HassIO i recieve error:
grep /proc/net/wireless: No such file or directory

Do you happen to know how to solve this?

Are you running on a wireless connection? I am running Home Assistant OS with wireless and can see the file…

Yes, I running on a WiFi, i see received/sent statistic for WiFi adapter, but i don’t see this file :frowning:

As suggestion, pls check this :slight_smile:
8 Linux Commands: To Find Out Wireless Network Speed, Signal Strength And Other Information - nixCraft (cyberciti.biz)

I looked it up, almost all the commands are not available in HassOS. And in the end there is no result.

yes, the lack of those commands in Hassio is something it cannot be contravened

In Core 6.0 all work again :slight_smile:

1 Like