Hi, I’ve created a custome HACS integration to get some usage data of Youfone.be mobile phone/data subscription (similar to the Telenet Telemeter and Pixometer integrations I have created recently)
Youfone.be is a very cheap Dutch operator, recently getting active in Belgium, using the Belgian Proximus network.
Just tried it, working great Was just starting to create mine as I switched to Youfone for the kids
Thanks! You gave me some extra time off this weekend
Can I also use this integration for youfone.nl? I’m using a python script right now that uses the same URL’s so I think this should be possible. Is it possible to make the domain (youfone.be) configurable?
@silvan New release R.2.1.0 has the option for NL. Could you validate and provide feedback if it works correctly? In case you’d see any issue, could you share logs and the python script you previously used?
@myT I’ve also added the account of my wife and now I get some errors in de HA error log. She has an unlimited voice/sms account, maybe that causes the error?
Error log:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 541, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 747, in async_device_update
await task
File "/config/custom_components/youfone_be/sensor.py", line 193, in async_update
self._used_percentage = round((int(self._includedvolume_usage)/int(self._total_volume.split(" ")[0]))*100,2)
ValueError: invalid literal for int() with base 10: ''
@myT The integration stopped working, I have following error:
Logger: homeassistant.components.sensor
Bron: helpers/entity_platform.py:356
integratie: Sensor (documentatie, problemen)
Eerst voorgekomen: 16 april 2024 om 12:44:09 (2 gebeurtenissen)
Laatst gelogd: 20:28:42
Error while setting up youfone_be platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
await asyncio.shield(awaitable)
File "/config/custom_components/youfone_be/sensor.py", line 119, in async_setup_entry
await dry_setup(hass, config, async_add_devices)
File "/config/custom_components/youfone_be/sensor.py", line 83, in dry_setup
await componentData._forced_update()
File "/config/custom_components/youfone_be/sensor.py", line 156, in _forced_update
self._user_details = await self._hass.async_add_executor_job(lambda: self._session.login(self._username, self._password))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/youfone_be/sensor.py", line 156, in <lambda>
self._user_details = await self._hass.async_add_executor_job(lambda: self._session.login(self._username, self._password))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/youfone_be/utils.py", line 153, in login
assert response.status_code == 200
AssertionError