Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle to block all devices discontinued by Microsoft #37

Closed
4 tasks done
Snackington opened this issue Mar 16, 2024 · 22 comments
Closed
4 tasks done

Toggle to block all devices discontinued by Microsoft #37

Snackington opened this issue Mar 16, 2024 · 22 comments
Assignees
Labels
enhancement New feature or request upstream

Comments

@Snackington
Copy link

Snackington commented Mar 16, 2024

Notice

Microsoft appear to have disabled this functionality entirely, in fact, at least in the version of the app me (@pantherale0) is using the toggles to even set any overrides are gone entirely and instead only an option exists to enable / disable a schedule.

System Health details

System Information

version core-2024.3.1
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.2
os_name Linux
os_version 6.1.73-haos-raspi
arch aarch64
timezone America/Chicago
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4928
Installed Version 1.34.0
Stage running
Available Repositories 1400
Downloaded Repositories 12
Home Assistant Cloud
logged_in true
subscription_expiration February 27, 2025 at 6:00 PM
relayer_connected true
relayer_region us-east-1
remote_enabled true
remote_connected true
alexa_enabled true
google_enabled true
remote_server us-east-1-10.ui.nabu.casa
certificate_status ready
instance_id ddff79cdc8e647afa7f6ae72c8f35b73
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 12.1
update_channel stable
supervisor_version supervisor-2024.03.0
agent_version 1.6.0
docker_version 24.0.7
disk_total 27.7 GB
disk_used 6.1 GB
healthy true
supported true
board rpi4-64
supervisor_api ok
version_api ok
installed_addons Terminal & SSH (9.10.0), Home Assistant Google Drive Backup (0.112.1), Mosquitto broker (6.4.0), Z-Wave JS UI (3.4.1), Studio Code Server (5.15.0)
Dashboards
dashboards 1
resources 6
views 6
mode storage
Recorder
oldest_recorder_run March 7, 2024 at 4:01 AM
current_recorder_run March 15, 2024 at 9:00 PM
estimated_db_size 73.62 MiB
database_engine sqlite
database_version 3.44.2

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

Installation of the integration and connection went fine, I can see the screentime hours and the status of the "block all devices" toggle, but attempting to switch it on or off results in 500 internal server error. Tried restarting HA/Re-configuring integration.

Reproduction steps

N/A

Debug logs

2024-03-15 21:38:02.834 WARNING (MainThread) [pyfamilysafety.account] Unknown account spending response, please report to developer. {'askAParentEnabled': True, 'balances': []}
2024-03-15 21:38:05.317 WARNING (MainThread) [pyfamilysafety.account] Unknown account spending response, please report to developer. {'askAParentEnabled': True, 'balances': []}
2024-03-15 21:38:09.061 WARNING (MainThread) [pyfamilysafety.account] Unknown account spending response, please report to developer. {'askAParentEnabled': True, 'balances': []}
2024-03-15 21:38:11.915 WARNING (MainThread) [pyfamilysafety.account] Unknown account spending response, please report to developer. {'askAParentEnabled': True, 'balances': []}
2024-03-15 21:38:14.271 WARNING (MainThread) [pyfamilysafety.account] Unknown account spending response, please report to developer. {'askAParentEnabled': True, 'balances': []}
2024-03-15 21:38:16.623 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [548011862208] ('HTTP Error', 500, '"Internal Server Error"')
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2319, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2356, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 905, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/config/custom_components/family_safety/switch.py", line 117, in async_turn_off
return await self._disable_override()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/family_safety/entity_base.py", line 115, in _disable_override
await self._account.override_device(self._platform, OverrideType.CANCEL)
File "/usr/local/lib/python3.12/site-packages/pyfamilysafety/account.py", line 153, in override_device
response = await self._api.send_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyfamilysafety/api.py", line 103, in send_request
raise HttpException("HTTP Error", response.status, await response.text())
pyfamilysafety.exceptions.HttpException: ('HTTP Error', 500, '"Internal Server Error"')

Diagnostics dump

No response

@andyearnshaw
Copy link

I have the same issue, HTTP 500 error. Blocking individual systems works, Block Windows/Mobile/Xbox. It's just all devices that doesn't work correctly.

@pantherale0
Copy link
Owner

Will take a look at this asap, currently in the middle of moving so haven't got access to any of my dev environments.

@devdems
Copy link

devdems commented May 20, 2024

@pantherale0 any luck with getting this error resolved?

@gormac77
Copy link

Hi, I seem to have the same 500 error issue. I am able to block Windows as a whole but not individual apps. I have selected the apps from the UI, e.g. Roblox, so I do not think it is simply a matter of me spelling things incorrectly. Any ideas?

@idorose
Copy link

idorose commented Jun 15, 2024

Hi, I seem to have the same 500 error issue. I am able to block Windows as a whole but not individual apps. I have selected the apps from the UI, e.g. Roblox, so I do not think it is simply a matter of me spelling things incorrectly. Any ideas?

same here, I also created switches for specific apps and it gives me the 500 error.
Block mobile also doesn't seem to do anything (does it suppose to switch on and off the app time limit toggle in the health app?)

@pantherale0
Copy link
Owner

Haven't got my other mobile with me at present, but debugging it looks like Microsoft's API has changed. At the moment all I literally have from Microsoft is "Internal Server Error" in the response body so it doesn't actually tell us whats wrong.

I've not used the app for a while, could someone confirm if these features are still available?

@idorose The Block Mobile switch is supposed to block mobile devices (Android), but I've never been able to get this to work. Just something that is exposed in the API.

@gormac77
Copy link

@pantherale0 I can confirm the features are still avalable in the mobile app. I can go in and manage mobile, xbox and Windows for each of the users down to the application level. The interface has changed recently so possibly the API as well.

@pantherale0
Copy link
Owner

Thanks @gormac77 if the UI has changed. The API has probably changed too in that case. I'll investigate asap but don't have the right hardware to hand at present.

@rhyssman
Copy link

rhyssman commented Oct 6, 2024

Hi @pantherale0 any update on this this issue. Am also unable to switch blocking of applications similar to the above issue.

@pantherale0 pantherale0 self-assigned this Oct 6, 2024
@pantherale0 pantherale0 added the bug Something isn't working label Oct 6, 2024
@pantherale0
Copy link
Owner

Hi @rhyssman I haven't been able to use the integration lately as blocked by #40 which is a shame.

I still need to rework the library to use the "new" app however haven't had the time or chance to yet. Work on this is next in my queue once I've released 2024.10.0 for my Fuel Prices integration.

@rhyssman
Copy link

rhyssman commented Oct 6, 2024

Hi @rhyssman I haven't been able to use the integration lately as blocked by #40 which is a shame.

I still need to rework the library to use the "new" app however haven't had the time or chance to yet. Work on this is next in my queue once I've released 2024.10.0 for my Fuel Prices integration.

Noted. Will keep tabs on this integration. Fuel prices integration looks good!

@pantherale0
Copy link
Owner

Ok, looking at the API. This entire feature is no longer available. Seems Microsoft have really changed how this all works 😞

@pantherale0 pantherale0 added enhancement New feature or request upstream and removed bug Something isn't working labels Oct 6, 2024
@pantherale0 pantherale0 changed the title Can't use toggle to block all devices. 500 error Toggle to block all devices discontinued by Microsoft Oct 6, 2024
pantherale0 added a commit to pantherale0/pyfamilysafety that referenced this issue Oct 6, 2024
@devdems
Copy link

devdems commented Oct 7, 2024

I still see the usage of the devices in HA. I can not block them, though.

@pantherale0
Copy link
Owner

@devdems usage is provided under a seperate endpoint that hasn't changed. So usage and overrides (blocking of devices) are completely seperate and probably completely different backends (assuming microservices architecture).

@pantherale0
Copy link
Owner

I've managed to get round to this finally.

2024.12.0b0 "fixes" this - although by fix, the option to block all devices has been removed entirely as the API itself does not appear to support it anymore. You'll need to toggle each platform individually instead. A few performance improvements have been made to this area so it shouldn't take as long to toggle now.

Also the application switches have been disabled for now as the API has changed and these currently aren't working.

@pantherale0 pantherale0 moved this from Next to Testing in HA Family Safety - 2024.12.0 Nov 9, 2024
@idorose
Copy link

idorose commented Nov 15, 2024

hey, just upgraded to the Beta, when I try to run the service to block an app I get an error, I tried both an app on mobile (Brawl Stars) and an app on PC (steam client webhelper).

Block Mobile doesn't seem to do anything as well.

lock windows works fine just like before.

@pantherale0
Copy link
Owner

@idorose refer to my previous comment regarding blocking applications.

I think Block Mobile is supposed to work for android devices, but I don't actually know as I haven't got anything to test with. Just exposed what is available in the API. Might work to make this more dynamic to only load platforms that you have setup rather than all of them.

@idorose
Copy link

idorose commented Nov 15, 2024

well I tried on my son's android, it doesn't seem to do anything. by the way, from Family Safety app there is no option to lock mobile as there is with windows devices, only block apps on mobile, there is an option to set up time limit for mobile (which blocks all apps with time limit)

@pantherale0
Copy link
Owner

Ok, new update has just been released which fixes blocking and unblocking applications. A number of API changes though so please try with Android and Windows applications if you can (I'm most certain Android won't work).

@idorose thanks for testing the mobile block, I will remove that platform switch for the next version.

@idorose
Copy link

idorose commented Nov 15, 2024

still not working for me, the log file shows error 400

@pantherale0
Copy link
Owner

Ok, sounds like its probably due to the platform, I need to add the diagnostic data so that you can get the app ID, then we'll be able to see whats wrong

@pantherale0
Copy link
Owner

The above app blocking issue has been converted to a separate issue as does not relate to this. Closing this issue now as this is resolved in the latest beta.

@github-project-automation github-project-automation bot moved this from Testing to Delivered in HA Family Safety - 2024.12.0 Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request upstream
Projects
Development

No branches or pull requests

7 participants