Skip to content

Comments

Enabling LTE sensors readout#242

Closed
teixeluis wants to merge 17 commits intoAlexandrErohin:mainfrom
teixeluis:main
Closed

Enabling LTE sensors readout#242
teixeluis wants to merge 17 commits intoAlexandrErohin:mainfrom
teixeluis:main

Conversation

@teixeluis
Copy link
Contributor

I found and commented in this issue that LTE integration code appeared to be already WIP in this project and the related lib.

Therefore in this PR I decided to close the gap, and implement the necessary changes to cover the retrieval of the LTE / cellular related attributes. For simplicity I have centralized the data retrieval around the existing get_status() function, and have slightly reorganized the data classes in the lib, in order to preserve the segregation of categories while at the same time aggregate these for hassio integration as a single top level State object. This way the simplicity of the sensor.py module is preserved.

Have been able to test the feature in my ‪TL-MR105 device, and as expected it exposes the existing and new attributes:

image

Meanwhile I have identified some improvements to take care of, such as the SNR value be properly converted (needs to be divided by 10), the signal level which does not seem to be correctly represented, and fields like "LTE Network Type", "LTE SIM Status", "LTE Connection Status" which should be mapped to the corresponding names.

The "total wired clients" field seems a bit flakey (alternates between 0 and 1 erratically) but I can confirm this was already like this before this change.

@teixeluis
Copy link
Contributor Author

PR from the router lib: AlexandrErohin/TP-Link-Archer-C6U#98

icon="mdi:wan",
value=lambda status: status.conn_type,
),
TPLinkRouterSensorEntityDescription(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget about compatibility for all routers. Most routers do not have LTE. Only some routers has. So for the most routers these sensors would be Unavailable. It is better to add these sensors separately for LTE routers

@AlexandrErohin
Copy link
Owner

I have added those sensors only for LTE rputers, please try the latest version

@teixeluis
Copy link
Contributor Author

I have added those sensors only for LTE rputers, please try the latest version

Ok, looking good:

image

I will focus on the values representation/conversion issues I mentioned before. Thanks

@teixeluis
Copy link
Contributor Author

Fyi the improvements I mentioned in this PR, I have then covered in this new one:

#244

it covers:

  • total statistics now including the units (Bytes)
  • LTE SNR is now being converted to the correct value in dBmW (the raw value had to be divided by 10);
  • LTE SIM status is now represented by the pertinent state names;
  • LTE Network Type is now represented by the pertinent state names;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants