Skip to content

Comments

Feature improve lte sensor value conversions and mappings#244

Merged
AlexandrErohin merged 17 commits intoAlexandrErohin:mainfrom
teixeluis:feature-improve-lte-sensors
Oct 17, 2025
Merged

Feature improve lte sensor value conversions and mappings#244
AlexandrErohin merged 17 commits intoAlexandrErohin:mainfrom
teixeluis:feature-improve-lte-sensors

Conversation

@teixeluis
Copy link
Contributor

@teixeluis teixeluis commented Oct 12, 2025

Adding this small change that will properly translate the values of some of the sensors, in a similar fashion to what the TP-Link web UI does:

Sensors:

Captura de ecrã 2025-10-12 180954

Web UI:

Captura de ecrã 2025-10-12 180946

Reference data and calculations extracted from the web UI javascript.

Changes:

  • 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;

@teixeluis
Copy link
Contributor Author

@AlexandrErohin anything in particular you would like to point out about the PR?

@AlexandrErohin
Copy link
Owner

@teixeluis Hi. Thank you for this update. I need some more time. There is a bug with LTE info - #245 I need to fix it before moving forward with it

),
)

network_types = {
Copy link
Owner

Choose a reason for hiding this comment

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

I thought it would be more useful to move this dict to the client. So I have added this to client

name="LTE SIM Status",
icon="mdi:sim-outline",
value=lambda status: status.sim_status,
value=lambda status: sim_statuses[status.sim_status],
Copy link
Owner

Choose a reason for hiding this comment

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

I have added 2 properties to the client network_type_info and sim_status_info - I think it is better to keep here sim_status and network_type for automation use - it is better to check int values then string. And add 2 more sensors for network_type_info and sim_status_info to show str values. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, makes sense, closer to where that responsibility should be. Changed it accordingly, still working ok.

@AlexandrErohin AlexandrErohin merged commit 782b656 into AlexandrErohin:main Oct 17, 2025
3 checks passed
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