ironsheep / RPi-Reporter-MQTT2HA-Daemon

Linux service to collect and transfer Raspberry Pi data via MQTT to Home Assistant (for RPi Monitoring)
GNU General Public License v3.0
459 stars 64 forks source link

What are the rx/tx_data reported in for network interfaces #115

Open spitfire opened 11 months ago

spitfire commented 11 months ago

what are these attributes reported in? rx_data: 38168 tx_data: 39104 They match neither bytes, nor packets from ifconfig

mdisabato commented 8 months ago

I concur. The readings I get have not changed since the script started. Also, I find it hard to believe that system has only 193 bits/sec receive and 23 bits/sec transmit. It should be much higher.

ironsheep commented 8 months ago

These are the delta/time since the last time they were read. The script, by default, runs at 5-minute intervals.

Here's the relevant code:

rx_data = round((current_value - previous_value) / (current_time - previous_time) * 8 / 1024) Ditto for tx_data.

I need to check if this data is still being parsed correctly, given the massive OS overhauls that have been happening... I'll be working on this script to attend to some of the reported issues in the next week or two. I'll review all of this parsing at that time.

spitfire commented 8 months ago

Could we somehow have sensors reporting total RX/TX data? THat would be really useful.

bsimmo commented 8 months ago

The idea would be HomeAssistant can add them an provide cumulative stats and give you hourly, daily, weekly, yearly etc.

Unfortunately that would need a revision of this to finally bring everything into their own sensors, enabling longterm stats and triggers etc to be used, and away from the old setup of attributes.

spitfire commented 8 months ago

I would probably keep none of them in the recorder, but let them go to influxdb.

bsimmo commented 8 months ago

Just take the measuments you have, grab the data and send it on its way, then do whatever you want with it.

Doing it in HA database just means the built in triggers and automations would be easier and should be the default target on HA, users can then do what they want with it or stop that if they want alternatives. You can still send it elsewhere.

Have fun.

On Fri, 2 Feb 2024, 9:43 pm Mieszko Ślusarczyk, @.***> wrote:

I would probably keep none of them in the recorder, but let them go to influxdb.

— Reply to this email directly, view it on GitHub https://github.com/ironsheep/RPi-Reporter-MQTT2HA-Daemon/issues/115#issuecomment-1924740665, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYAXNZIIBIRQNMRSPCGFKDYRVMWVAVCNFSM6AAAAAA6UBEAAOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRUG42DANRWGU . You are receiving this because you commented.Message ID: @.***>

spitfire commented 8 months ago

Triggers an automations still work even if you don't record the data in db, I only do that for select entities that I look up sometimes (otherwise my DB grows to 30 GB ;)). I send everything to InfluxDB just in case, and it doesn't affect my HA's performance