Restart tmobile modem using Rest API


I'd like to schedule nightly restarts of my tmobile 5g gateway. i've identified the rest API commands needed. I can port them over from powershell but am looking for a Restapi interface that can handle a sequence of commands. Any suggestions on how to build this? should I create an app or a device or is there a way to use Maker API?

Thank you in advance!

  1. $body = @"

  2. {

  3. "username": "admin",

  4. "password": ""

  5. }

  6. "@

  1. $token = $reponse.auth.token
  • $header = @{Authorization="Bearer $token"}
  1. $response = Invoke-RestMethod -Method POST -Uri "" -headers $header

  2. $response

1 Like

I do not.

Might be easier to schedule a power cut and restore. I expect the gateway is engineered to survive it.

nightly reboot seems like overkill. Why not on demand? I guess you could lose remote access which is somewhat impaired by 5g TMHI anyway. Still I think a watchdog app/routine, if it fails to ping for 20-40 minutes whatever, then cycle the gateway power, if it fails again, then try again in 1-2 hours.

I was very proud when I whipped this up in X10! about 20 minutes before I left for vacation, Comcast cablemodem? about 15 years ago. The Comcast neighborhood amp was bad or something, and we could read our worsening signal levels at the modem, and rebooting usually helped. All automatic... just read the logs about the problems later.

Download the Hubitat app