AlexandrErohin / home-assistant-tplink-router

Home Assistant component for TP-Link router administration with sensors, button reboot, switches and device tracking.
https://community.home-assistant.io/t/custom-component-tp-link-router-integration
MIT License
111 stars 13 forks source link

Add support to send text messages #85

Open Momro opened 1 week ago

Momro commented 1 week ago

Hi,

I have a TL-MR100 v2.0. I use a SIM card and the LTE connection of the router as fallback internet. I would like to utilize the SIM card for short text messages, too, but I cannot find an integration that does that.

I was able to connect and send a text message like this:

python
[...]
from tplinkrouterc6u import (
...     TplinkRouterProvider,
...     TplinkRouter,
...     TplinkC1200Router,
...     TPLinkMRClient,
...     TPLinkDecoClient,
...     Connection
... )

router = TplinkRouterProvider.get_client('http://192.168.9.1', 'xxxxx')
router.authorize()
router.send_sms("017622181435", "hallo aus der python console")
router.logout()

This uses https://pypi.org/project/tplinkrouterc6u/#status though, and I was told that you cannot add Python libraries in HAOS, so I'm a bit stuck here.

Any chance you could add this to your integration?

AlexandrErohin commented 1 week ago

This integrations supports many routers but only some of them has sms feature. I don't think it is good to add feature which would be unavailable for most of users You may use this code as individual python script https://www.home-assistant.io/integrations/python_script/

Momro commented 1 week ago

It appears to be not exactly possible to do this in python code because one cannot sideload pip libraries though