hjelev / rpi-mqtt-monitor

Raspberry Pi MQTT Monitor gathers system information and sends it to a MQTT server.
GNU General Public License v3.0
176 stars 42 forks source link

Feature Request: Monitor RSSI (WiFi Signal level) #12

Closed maorcc closed 1 year ago

maorcc commented 1 year ago

Is it possible to also monitor the RSSI (WiFi Signal level)?

hjelev commented 1 year ago

its a very good idea, I have created a branch called wifi and push it there. If you wish you can help me test it.

maorcc commented 1 year ago

Seems to work well. Very nice! See below. I'm used to dBm units. I guess I can get used to signal in percentage. Is it possible to add the dBm value as an attribute of the wifi_signal entity?

image

hjelev commented 1 year ago

Nice, is it working when called with a cronjob? I can't get it to work when scheduled.

hjelev commented 1 year ago

I have added wifi signal in dBm. you'll need to add wifi_signal_dbm = True to your config

maorcc commented 1 year ago

@hjelev, If I add to the config file both wifi_signal_dbm and wifi_signal, then in Home Assistant two entities are created with the following IDs:

Where both have the same name Wifi Signal. This is somewhat confusing.

maorcc commented 1 year ago

Also, don't forget to update the READM.md with the new setting.

maorcc commented 1 year ago

And yes, the two wifi fields don't seem to work from crontab. Maybe a permission issue?

maorcc commented 1 year ago

Regarding the crontab issue. It is resolved for me when I replaced lines 22 and 33 from:

full_cmd = "iwconfig wlan0 | grep -i --color quality"

to this:

full_cmd = "/sbin/iwconfig wlan0 | grep -i quality"

Using full path to the iwconfig tool. (and removing the unneeded --color flag.)

hjelev commented 1 year ago

Thank for fixing the cron tab issue - I have forgotten about paths in cron tabs. Regarding the duplicated name I made it like this on purpose as I don't think somebody will need both values. And to differentiate it them I have to name them Wifi Signal % and Wifi Signal dBm which won't look very good. If you have a better suggestion for the naming pls let me know. The cron fix is applied to wifi branch.

maorcc commented 1 year ago

I see your point regarding naming the "Wifi Signal". I don't have a better name.

hjelev commented 1 year ago

wifi branch is merged to master