New Custom Component - Device Tracker for MitraStar GPT-2541GNAC Router (Movistar Spain Router)

Hi. I write a component for device tracker that work with MitraStar_GPT-2541GNAC. One router that use Movistar in Spain.

I´m testing now (beta). Work well but sometimes when start Home Assistant not work because not connect to router. It´s strange because when I use a py file that only conect to router and search for MAC address work well all the times, but when I integrate this script to Home Assistant, sometimes break.

any help is good…

if someone can use it and test, I upload the component to github here:
https://github.com/joseska/MitraStar_GPT-2541GNAC_HA

sorry for my english :wink:

Hi! Thanks for sharing! I use the nmap component. Not an expert here so sorry for the noob question but: is your approach better in terms of performance or reliability? Or are both methods just very similar?

PS: Your english is fine - at least for me (Spanish) :grin:

Hi timseebeck I´m Spanish too. The problem with nmap for me is that my iphone cut off the wifi to save battery and many times the nmap device tracker was “not home” for this reason…

trought the router the precision is greater

Thanks for your answer! Which brings me to another question: if your iPhone cuts the wifi, how does the router know that it is at home?
I would like to better understand all of this because my phone is an android device and, while it does not switch off wifi, I experience with nmap random short disconnections (which is very bad for presence detection automations). Thanks.

Hello… I think that the smartphones turn off WIFI when the phones not used and only turn on WIFI for 5-10 seconds to download new data and turn off again.

I’m testing this but it doesn’t seem to be working for me. It doesn’t detect my phones connected to wifi, despite putting the correct MAC address. Is there any other version of this?

Hi Joseka

Good work. Im also from spain. Do you know any way to control this stupid router via snmp? im not read forum from movistar that even if you can see the agent for snmp this is totally disable :frowning:

Hi from Spain… Is this custom component working with the latest versions of Home Assistant?

I´ve followed the instructions on GitHub and I´ve saved the files in the path indicated:

[core-ssh MitraStar_GPT-2541GNAC]$ pwd
/config/custom_components/MitraStar_GPT-2541GNAC
[core-ssh MitraStar_GPT-2541GNAC]$ ls -la
total 68
drwxrwxrwx    3 root     root          4096 Feb  7 19:49 .
drwxr-xr-x    5 root     root          4096 Feb  7 19:42 ..
drwxr-xr-x    8 root     root          4096 Feb  7 19:40 .git
-rw-r--r--    1 root     root          1203 Feb  7 19:40 .gitignore
-rw-r--r--    1 root     root         35149 Feb  7 19:40 LICENSE
-rw-r--r--    1 root     root          1036 Feb  7 19:40 README.md
-rw-r--r--    1 root     root             0 Feb  7 19:40 __init__.py
-rw-r--r--    1 root     root          5644 Feb  7 19:40 device_tracker.py
-rw-r--r--    1 root     root           255 Feb  7 19:40 manifest.json
[core-ssh MitraStar_GPT-2541GNAC]$

configuration.yaml is defined like this:

# Supervision de dispositivos en red local
device_tracker:
  - platform: MitraStar_GPT-2541GNAC
    host: !secret router_ip_address
    username: !secret router_username
    password: !secret router_password
    interval_seconds: 120
    consider_home: 200
    new_device_defaults:
      track_new_devices: False

But, when I click on verify configuration…
imagen

Can someone help me?

sorry… not working anymore and dont have this router now…

If you have copied all files from GitHub, you should modify the “manifest.json” file and add this line:

"version": "1.0.0",

I don’t remember when this changed, but now it’s a requirement that any integration has a version number.

Regards

Thanks a lot @aluisperezh for your help.
However, I´m still getting the same error message when I click on validate configuration. Let me show you my config files:

configuration.yaml

# Supervision de dispositivos en red local
device_tracker:
  - platform: MitraStar_GPT-2541GNAC
    host: !secret router_ip_address
    username: !secret router_username
    password: !secret router_password
    interval_seconds: 120
    consider_home: 200
    new_device_defaults:
      track_new_devices: False
#

manifest.json file has been updated:

{
    "domain": "MitraStar_GPT-2541GNAC",
    "name": "MitraStar GPT-2541GNAC router - Movistar (Spain)",
    "documentation": "https://github.com/joseska/MitraStar_GPT-2541GNAC_HA",
	"version": "1.0.0",
    "requirements": [],
    "dependencies": [],
    "codeowners": []
  }

And files are still in the same path:

imagen

Keep waiting your comments. Thanks again for your help.

I’m really sorry. I’ve been checking my config and I’ve found that, even when I don’t get your validation error, the integration is not working anymore. I get errors in the logfiles stating that there is some conversion error. I don’t know Python enough to debug this, but I’ll try to take a look at it when I have time. Maybe the firmware in the router has changed, I really don’t know.

Sorry again. Regards.

OK @aluisperezh if you find something or you need to test anything from me side… Let me know and I´ll help you.

Anyway, thanks a lot for your help.

What do you need this integration for? If you want to be able to ping or reboot a Movistar router from HA, you probably can do it with a REST binary sensor (ping) and cURL commands extracted from a browser’s Web Developer Tools (log into the router and reboot). I have an Askey HGU RFT3505VW and I managed to do that.

I´m starting with HA… and I´m not familiarized of how to do a ping from a binary sensor neither using cURL commands. Can you show me?

Apart of manage the devices connected…
Is it possible possible also to check the UL/DL bandwidth?

BR

Sorry for the belated reply. I have an Askey HGU, not a Mitrastar, so I cannot help with specific cURL commands for your model, as I guess the cURL commands will be different. However, for your reference, I can share my config with you. Perhaps you manage to make it work for you if you find out the cURL commands for rebooting a Mitrastar…

For the UL/DL bandwidth, I guess you want to check router’s. It should be possible with cURL commands as well. But I cannot know without checking a Mitrastar, and I don’t have any.

Is someone able to have this integration working?
I used it in the past but from some versions on it is not working for me anymore.
It would be great to have it back. Thanks!