Technicolor TG-789vac V2 DSL Stats

Hi @cryptelli

Thanks for your interest in this project. As you suggested I’ve upgraded the Gist to a repository and the link is below:

I’ve added you as a contributor and look forward to receiving your PR

Thanks for doing the groundwork! :star:

Cheers, PR submitted. I also have another one ready to go for the readme which I’ve updated with a heap of information including instructions and configuration options.

I believe you’ve answered your own question here :wink:. The script uses a python package which scrapes the web interface, if the firmware/theme you’ve installed has changed what it’s expecting then it might not return and if it does the data might be out of order.

Yep, seems to be the case. In the code for the components it looks for broadband-bridge-modal.lp, where as mine is now at broadband-modal.lp.

The only other issue I have is that this doesn’t seem to be logging into my modem. Using the original tgiistat script I can get it to work, but with the component, it doesn’t authenticate.

Yep, that is going to affect things.

As it works with tgiistat the only difference in the authentication section between the two are the missing lines between session = requests.Session() and return session. I’m not too experienced with Python so not sure what needs to be done, @htpc-helper any ideas?

I’m not sure, but I was using a old custom component I found on GitHub that would log in. Not sure if it helps, but there might be something there you guys can use.

Well, I got it working again with authentication. I just modified where the data is pulled from, and removed the snr, and power value lines as they were causing some sort of issue. I don’t need them, so no need for me to worry.

Not sure what your component offers over this one I’m using. Maybe you can combine both into one.

@cryptelli - thanks for your PR, I’ve approved and merged it into master. Please submit your doco PR when you are ready.

@cjsimmons - yes I noticed the difference in the URL when I worked on your code. I thought this may have been because my modem has been modified with this, or possibly due to a different model number. Mine is 799vac and I believe yours is 789vac.

Thank you, have another one!

Thought I should add for information stake that mine is stock (running in bridge) apart from being rooted using the autoflashgui tool and installing telnet.

The hacks you posted @htpc-helper look interesting… :thinking:

I hope you enjoy the hacks @cryptelli. It seems that they have no impact on compatibility with the sensor and the url difference identified by @cjsimmons is purely due to the model difference.

Also thinking back to last year when I wrote this I remember removing the auth code that @cjsimmons had in his solution which is another reason this isn’t working for him. My router doesn’t require username and password.

Thanks again @cryptelli for the PR with the updated documentation. Really appreciate your hard work to polish this and make it useful to more people!

I’ll look at using them for sure, since I’m already rooted.

I wondered why the auth code was missing, tried adding it back but it baulked when trying to connect since as with you I don’t require a user/pass to login.

I’m glad I decided to contribute, what started as a fix for my own use has turned into a improvement which can benefit anyone who stumbles across this custom sensor.

Suggestion, would it be worth while starting a separate post (with reference to this)? Depending on the search term used your initial post doesn’t come up and if people don’t go digging might think it only applies to a TG-789vac

@htpc-helper actually, it less to do with the model and more to do with the fact that I have a modded GUI running on mine. Before the modded GUI, everything was working fine, and the URL you use is the same one I was using. I installed this as the firmware I’m using from UNO in the UK doesn’t show all the line stats that this component requires. This fixes that but changed a few things around

The GUI I’m running now is tch-nginx-gui. This is installed after rooting the modem with autoflashgui.

As for my modem, I have the TG789vac V2. It’s the VANT6 variant used by iiNet in AU. The TG789vac V2 is a slightly basic version of the TG799vac.

Basically, any component I use now I just have to make sure the modal URL being scrapped works with my modem and adjust if needed. Not a big deal for me.

hi guys was trying to set this up and getting some errors. I am also running tch-nginx-gui.the code is point to the right modal file but am getting the below error in my log for every bit value that is trying to be scrapped and obviously no data. Any ideas?

Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 248, in _async_add_entity
await entity.async_device_update(warning=False)
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 379, in async_device_update
await self.hass.async_add_executor_job(self.update)
File “/usr/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/home/homeassistant/.homeassistant/custom_components/technicolormodem/sensor.py”, line 104, in update
self.modem.update()
File “/home/homeassistant/.homeassistant/custom_components/technicolormodem/sensor.py”, line 141, in update
self.data[‘up_speed’], self.data[‘down_speed’] = self.__fetch_pair(“Line Rate”, ‘Mbps’)
File “/home/homeassistant/.homeassistant/custom_components/technicolormodem/sensor.py”, line 181, in __fetch_pair
updown = lr[0].parent.parent.find_all(string=re.compile(unit))
IndexError: list index out of range

I take it you are using the component from @htpc-helper?? If so, I can’t help as I’m using a rather old component that pre-dates his and I modified to work with my setup.

From memory though, I had to disable some lines that got line snr values as they were causing issues. Not sure if that is a problem with htpc component with tch-nginx-gui.

Yes it is component from @htpc-helper .I think the problem is authentication.if I load the lp file directly in the browser I still need to login first then the data comes through.might need to look at the tgiistat project and reinstate the authentication from that

ah yes, that’s the issue I was having with his script. Sorry, I forgot about that. :grimacing: For some reason, the stock firmware (I assume) he is using exposes a lot of the tiles without logging in. The tch-nginx-gui theme requires you to log in. I can’t see a way around this and thought it was normal as my stock firmware from my ISP also requires a login.

yeah my stock required login as well.I thought maybe calling the modals bypassed the need for authentication but nope. Just looking at the authentication part of tgiistat part now.might need to hardcode user etc in at the start till I can get my head fully around how HA passes values through.

I posted a link above with the component I’m using. It works with authentication, but needs to be modified to have the correct modal. I also needed to comment out the lines getting snr values as it was giving me errors.

I haven’t looked yet at merging the two different components. Not sure if it can be done.

Sorry I missed the original post about tch-nginx-gui. This looks awesome and I’m keen to have a look. Perhaps we just make the plugin compatible with this as it can become a standard interface for all the variants of the modem.

I’m still running the original version of the plugin that I published in Nov last year. I haven’t updated my Hass setup since then.

This weekend I’m setting up a Technicolor modem with Hass monitoring for my Dad and it would be ideal if I can have tch-nginx-gui on this new setup with the latest version of the plugin.

You could, but that would require that everyone has rooted their modem and installed this.

Ideally, I think a few checks might be the better way to go. Check to see if authentication is required, if so, then authenticate, or have it as a config option. No details, not authentication. Also check to see if the normal modal works, if not, load the other, either way doesn’t matter.

I feel this wold be a better functioning component that everyone can use and not just by those brave enough to fiddle with their modem.