Sponsored Links

New Three 5G Hub (NR5103E)

You could try MioNonno's Zyxel Hack, which is explained here (in Italian, granted, but the AutoTranslate works well enough to follow his procedure):

This was neat, very clever & real easy to get working. The only problem was it can only get & display the data whilst you're logged into the router.

I'm beginning to realise the NR5103ev2 is somewhat 'crippled' in functionality & perhaps I should invest in something better. Can anyone recommend a better 4G/5G router that will work well with TPLink Deco Mesh in AccessPoint mode & supports Cell Locking & can make system data available to something like Home Assistant? And ideally isn't £££ 😁
 
scraping the the data from the /cgi-bin/DAL?oid=cardpage_status web response.
So this was interesting. I hadn't realised that the URL https://192.168.8.1/cgi-bin/DAL?oid=cardpage_status would return a whole bunch of useful data back, but unless you login to the router web interface first, then you get nothing back. I presume there's no way to automate the login process? (is this when you have to start messing around with certificates and the like?)
 
So this was interesting. I hadn't realised that the URL https://192.168.8.1/cgi-bin/DAL?oid=cardpage_status would return a whole bunch of useful data back, but unless you login to the router web interface first, then you get nothing back. I presume there's no way to automate the login process? (is this when you have to start messing around with certificates and the like?)
That's what my python is doing, every 10 seconds.

A correction on my previous; i'm actually using the requests python library to do the work, urllib3 is to allow the insecure requests so no cert's needed
 
I've cut it down, but something like this

Python:
import requests, urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) #disable insecure requests warnings

zyxelIP = "192.168.1.1"
zyxelUsername = "admin"
zyxelPassword = "yourPassword" # but this is the 'Encrypted' version, taken from the /UserLogin web request payload

values = {'Input_Account':zyxelUsername,'Input_Passwd':zyxelPassword}

s = requests.Session() #inititate a session
r = s.post(('https://'+zyxelIP+'/UserLogin'), json=values, verify = False) #login with the credentials

sessionkey = r.json()['sessionkey'] #store the session key to be able to logout at the end - doesn't like lots of simultaneous logged in sessions

cardpage_status = s.get(('https://'+zyxelIP+'/cgi-bin/DAL?oid=cardpage_status'), verify = False) #get the cardpage info

###
# do something here with the cardpage info data
###

out = s.post(('https://'+zyxelIP+'/cgi-bin/UserLogout?sessionkey='+str(sessionkey)), verify = False) #logout
 
###
# do something here with the cardpage info data
###
In the bit where you've said "# do something here with the cardpage info data" I dont know what I can do (not knowing anything about Python)? For example, how can I print some data to the terminal? or write it to a file? or 'feed' it into somewhere where Home Assistant might be able to access it?

I've taken your python, modified it with my router IP and what I believe is my encrypted (SHA512?) password, saved it as a .py and run it in a Linux Mint terminal with python3 and it presumably executes and ends (no errors generated in the terminal). So now i need to find a way to get it to "do something with the cardpage info data".
 
I've cut it down, but something like this

Python:
import requests, urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) #disable insecure requests warnings

zyxelIP = "192.168.1.1"
zyxelUsername = "admin"
zyxelPassword = "yourPassword" # but this is the 'Encrypted' version, taken from the /UserLogin web request payload

values = {'Input_Account':zyxelUsername,'Input_Passwd':zyxelPassword}

s = requests.Session() #inititate a session
r = s.post(('https://'+zyxelIP+'/UserLogin'), json=values, verify = False) #login with the credentials

sessionkey = r.json()['sessionkey'] #store the session key to be able to logout at the end - doesn't like lots of simultaneous logged in sessions

cardpage_status = s.get(('https://'+zyxelIP+'/cgi-bin/DAL?oid=cardpage_status'), verify = False) #get the cardpage info

###
# do something here with the cardpage info data
###

out = s.post(('https://'+zyxelIP+'/cgi-bin/UserLogout?sessionkey='+str(sessionkey)), verify = False) #logout
Oh my days, I wish I had looked here earlier as have been spent this morning messing around trying to find a way to have a record or the radio readings after an really shoddy service over the weekend. I found an interpreter for the NR7101 and started using that now with a couple of tweaks

link for the nr7101: https://github.com/pkorpine/nr7101
 

Attachments

  • Screenshot 2024-10-28 114140.webp
    Screenshot 2024-10-28 114140.webp
    44.2 KB · Views: 50
I found an interpreter for the NR7101 and started using that now with a couple of tweaks
What is this? Might it work for the NR5103ev2? Where can it be found?
 
What is this? Might it work for the NR5103ev2? Where can it be found?


I have added to the reply now but you can find it here:
https://github.com/pkorpine/nr7101

Don't know if you can for your model, however, I am using it for the v1. It is shonk at best but for now I am hoping it can give me some rough history as to what the readings are. I have the command running every 30s and then set up telegraf to read the file. I can't spend any more time at the moment on it but have got what I need for now. I think 😅
 
In the bit where you've said "# do something here with the cardpage info data" I dont know what I can do (not knowing anything about Python)? For example, how can I print some data to the terminal? or write it to a file? or 'feed' it into somewhere where Home Assistant might be able to access it?

I've taken your python, modified it with my router IP and what I believe is my encrypted (SHA512?) password, saved it as a .py and run it in a Linux Mint terminal with python3 and it presumably executes and ends (no errors generated in the terminal). So now i need to find a way to get it to "do something with the cardpage info data".
I'm not actually sure what encryption is used for the password, I just grabbed it from the payload..

For printing to terminal, you could print the whole response
Python:
print(cardpage_status.content)

or, you could extract a specific element, firstly by treating the response as json
Python:
bitOfInfo = cardpage_status.json()['Object'][0][item["CellIntfInfo"]][item["X_ZYXEL_PhyCellID"]]
print(bitOfInfo)
Python:
bitOfInfo = cardpage_status.json()['Object'][0]["CellIntfInfo"]["X_ZYXEL_PhyCellID"]
print(bitOfInfo)

As I say I use influxdb (which I then use Grafana as the dashboard for), so I haven't explored writing to a file (I'd expect that to be relatively easy..) or feeding to HA (unknown)
 
Last edited:
I have added to the reply now but you can find it here:
https://github.com/pkorpine/nr7101

Don't know if you can for your model, however, I am using it for the v1. It is shonk at best but for now I am hoping it can give me some rough history as to what the readings are. I have the command running every 30s and then set up telegraf to read the file. I can't spend any more time at the moment on it but have got what I need for now. I think 😅
that's essentially doing the same as what my bit of script does to get the data, just wrapped up nicer
 
or, you could extract a specific element, firstly by treating the response as json
Python:
bitOfInfo = cardpage_status.json()['Object'][0][item["CellIntfInfo"]][item["X_ZYXEL_PhyCellID"]]
print(bitOfInfo)
Okay - the print for the whole of cardpage_status.content worked, but the 'bitOfInfo' generates an error "NameError: name 'item' is not defined. Did you mean: 'iter'?"
 
that's essentially doing the same as what my bit of script does to get the data, just wrapped up nicer
Yes, I managed to get nr7101-tool to work, but its a bit 'involved' to achieve the same as your little bit of Python which I stand a much better chance of being able to get into Home Assistant somehow.
 
Okay - the print for the whole of cardpage_status.content worked, but the 'bitOfInfo' generates an error "NameError: name 'item' is not defined. Did you mean: 'iter'?"
Oh, sorry, I'm writing this off-the-cuff, simplifying from my own and not actually testing it works - try with:
Python:
bitOfInfo = cardpage_status.json()['Object'][0]["CellIntfInfo"]["X_ZYXEL_PhyCellID"]
print(bitOfInfo)
 
Oh, sorry, I'm writing this off-the-cuff, simplifying from my own and not actually testing it works - try with:
Python:
bitOfInfo = cardpage_status.json()['Object'][0]["CellIntfInfo"]["X_ZYXEL_PhyCellID"]
print(bitOfInfo)
Excellent - that works - thank you! I can work with that and see what I can do with Home Assistant You're a genious!
 
Oh my days, I wish I had looked here earlier as have been spent this morning messing around trying to find a way to have a record or the radio readings after an really shoddy service over the weekend. I found an interpreter for the NR7101 and started using that now with a couple of tweaks

link for the nr7101: https://github.com/pkorpine/nr7101
Out of interest, what shoddy service? I had connection outage (Three, on my NR5103e) from 1:40am yesterday morning that needed a router reboot to restore the connectivity (SIM seemingly wasn't detected anymore, somehow - and thats the 2nd instance of that in 2-3months)
 
Out of interest, what shoddy service? I had connection outage (Three, on my NR5103e) from 1:40am yesterday morning that needed a router reboot to restore the connectivity (SIM seemingly wasn't detected anymore, somehow - and thats the 2nd instance of that in 2-3months)
I'm on Three as well, I don't think it went down but latency was so bad that had IoT devices failing and when I was home streaming was really hit and miss. I am in an oversubscribed area and the weekend before as well as the one before that was massively improved so disappointing to what feels moving further back! That's why I went on a mission this morning to get the readings recorded somewhere I can keep and crosscheck when the wheels have possibly fallen off!
 
Just to complete my wee project to get some 'data' out of my NR5103ev2 and into Home Assistant (thanks to @GavinAshford for his help) here's the three parts I have working:

1. Gavins python code to login to the router and extract the data (cardpage_status) which I dump out to a .json file

Python:
import requests, urllib3, json

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) #disable insecure requests warnings
zyxelIP = "192.168.1.1"
zyxelUsername = "<yourusername>"
zyxelPassword = "<yourencryptedpassword>" # but this is the 'Encrypted' version, taken from the /UserLogin web request payload
values = {'Input_Account':zyxelUsername,'Input_Passwd':zyxelPassword}
s = requests.Session() #inititate a session
r = s.post(('https://'+zyxelIP+'/UserLogin'), json=values, verify = False) #login with the credentials
sessionkey = r.json()['sessionkey'] #store the session key to be able to logout at the end - doesn't like lots of simultaneous logged in sessions
cardpage_status = s.get(('https://'+zyxelIP+'/cgi-bin/DAL?oid=cardpage_status'), verify = False) #get the cardpage info

with open('data.json', 'w') as out_file:
     json.dump(cardpage_status.json(), out_file, sort_keys = True, indent = 4, ensure_ascii = False)

out = s.post(('https://'+zyxelIP+'/cgi-bin/UserLogout?sessionkey='+str(sessionkey)), verify = False) #logout

2. Short Home Assistant Automation (as .yaml) to run the python code every 15 minutes (i'm not sure I needed the 'update_entity' action but wasn't sure):

YAML:
alias: Get Zyxel
description: Get Zyxel data
triggers:
  - trigger: time_pattern
    minutes: /15
conditions: []
actions:
  - action: shell_command.zyxel
    metadata: {}
    data: {}
  - action: homeassistant.update_entity
    metadata: {}
    data:
      entity_id:
        - sensor.x_zyxel_rsrp
        - sensor.x_zyxel_rsrq
        - sensor.x_zyxel_sinr
mode: single

3. Added some sensors to my Home Assistant configuration.yaml to use the 'RESTful' integration to read the three values I wanted from the .json file:

YAML:
rest:
  - resource: "http://192.168.1.100:8123/local/zyxel/data.json"
    scan_interval: 900
    sensor:
      - name: "X_ZYXEL_RSRP"
        value_template: "{{ value_json['Object'][0]['CellIntfInfo']['X_ZYXEL_RSRP'] }}"
        unit_of_measurement: "dB"
        force_update: true
      - name: "X_ZYXEL_RSRQ"
        value_template: "{{ value_json['Object'][0]['CellIntfInfo']['X_ZYXEL_RSRQ'] }}"
        unit_of_measurement: "dB"
        force_update: true
      - name: "X_ZYXEL_SINR"
        value_template: "{{ value_json['Object'][0]['CellIntfInfo']['X_ZYXEL_SINR'] }}"
        unit_of_measurement: "dB"
        force_update: true
      - name: "zyxel_result"
        value_template: "{{ value_json.result }}"
        force_update: true

And the three sensor values displayed in my Home Assistant as Sensor Cards & as a History Graph (i'm not sure SINR should be in dB as its really a ratio, but it doesn't matter):

dashboard.webp

historygraph.webp


There's probably more efficient ways of getting the data into Home Assistant, but its fine for me as I can actually understand how it works as it is :)
 
Hi nd0, welcome along to the forums. :)

I have used all 4 network SIM's in the router just fine, you may have to edit the relevant APN's, as sometimes the router doesn't always add it correctly, this is very easy to do though.

V1.00(ACBJ.0)b15 is still the most up to date firmware.(y)
I'm on V1.00(ACBJ.0)b14. Is the firmware file available?
 
I'm on V1.00(ACBJ.0)b14. Is the firmware file available?
No firmware files are available for download unfortunately benparker, it should update overnight to b15 with a three or a three piggybacker SIM in the router. :)
 
Top
Cheap BIG ISPs for 100Mbps+
Community Fibre UK ISP Logo
150Mbps
Gift: None
Virgin Media UK ISP Logo
Virgin Media £22.99
132Mbps
Gift: None
Vodafone UK ISP Logo
Vodafone £24.00 - 26.00
150Mbps
Gift: None
NOW UK ISP Logo
NOW £24.00
100Mbps
Gift: None
Plusnet UK ISP Logo
Plusnet £25.99
145Mbps
Gift: £50 Reward Card
Large Availability | View All
Cheapest ISPs for 100Mbps+
Gigaclear UK ISP Logo
Gigaclear £17.00
200Mbps
Gift: None
Community Fibre UK ISP Logo
150Mbps
Gift: None
Virgin Media UK ISP Logo
Virgin Media £22.99
132Mbps
Gift: None
Hey! Broadband UK ISP Logo
150Mbps
Gift: None
Youfibre UK ISP Logo
Youfibre £23.99
150Mbps
Gift: None
Large Availability | View All
Sponsored Links
The Top 15 Category Tags
  1. FTTP (6024)
  2. BT (3638)
  3. Politics (2720)
  4. Business (2439)
  5. Openreach (2405)
  6. Building Digital UK (2330)
  7. Mobile Broadband (2143)
  8. FTTC (2083)
  9. Statistics (1899)
  10. 4G (1813)
  11. Virgin Media (1762)
  12. Ofcom Regulation (1582)
  13. Fibre Optic (1467)
  14. Wireless Internet (1462)
  15. 5G (1404)
Sponsored

Copyright © 1999 to Present - ISPreview.co.uk - All Rights Reserved - Terms  ,  Privacy and Cookie Policy  ,  Links  ,  Website Rules