Google Family link

Anyone who knows if it is possible to make home assistant lock/unlock kids phone somehow.
I see that the https://familylink.google.com/ now has got buttons to lock and unlock on the devices. Played a little trying to lock and unlock, but can’t figure out how to include the missing to the url

Sorry for my bad english.

1 Like

Did you even figure this out? I’m keen to use this and tie it to chores. :slight_smile:

3 Likes

Still nothing?

I’m using a daily chore list together with my Unifi WiFi controller to enable and disable the kids WiFi connection. Not exactly the same but pretty okay anyway, especially as they grow older Internet becomes the primal desire :wink:

Also got a scoring system so that when they do all the daily chores they get a point. The points then can be used to buy an hour of Internet time or swap for SEK :smiley: never seen the kids as motivated as they are now haha…

2 Likes

Just to be clear, your setup do not include Google Family Link?

Nope this has nothing to do with family link unfortunately, it’s just another way to kinda achieve the things you want

Apologises for the confusion

What a brilliant setup @Mattie ! I’m paving the same road here, though your setup is by far more advanced. Would you mind sharing your configuration for this example please?

Thanks :slight_smile:

Well, I’ve built it almost with helpers alone. I’ve created a switch for each task and also an i out number helper for the points. When all tasks are set to on (done) an automation triggers an increase for the input number entity.

Then I have different scripts that decreases X points for different things, if there are points, for example 1h TV time, 1hour Internet enabled on their devices (through Unifi network controller)

It’s all really easy once you get started. That Unifi controller creates entities for each network device when you set it up. You get switches that you can turn off to disconnect the network devices.

I reset the kids chores each night so that they can do them again nmthe next day.

I believe you have overestimated my skills here :wink:

That being said, I followed your guidance and have now set up switches for each task. And yes, that was easy! However I’m struggling with the next step where you mention input number entity. I chose ‘Number’ but then I’m not sure which to chose between the slider and the input field.

Well, on top of that I have also managed to set up switches to enable/disable Internet for our devices… Also quite easy to set up :slight_smile:

But all the configuration in between here is a big blur to me. I’m guessing I need a counter for each child to keep track of their points. And then some sort of helper (input number?) that decreases points from the counter when the children selects internet/money to make use of their points?

Well by now you see I have a long walk ahead of me. I do enjoy the walk but I’m not correctly geared so to say…Literally wearing clogs for that marathon walk. Additional hints and guidance are most welcome! :pleading_face:

Hehee… I’ll try to guide you the best way I can :slight_smile: So you have the device control and the switches ready. Next is the helper and I meant the “counter” helper! I’m sorry for the confusion! Just create it and use it in your automations to increase it whan the chores are done :slight_smile:

My automation to grant a point when all chores are done looks like this:

the condition is that all switches have to be on for the action to be triggered. Also the delay for 5h is to prevent my kids from outsmarting me in flickering the switches on and off to get the condition to be met multiple times thus getting more than one point! I’m actually proud that they found that loophole that quick :smiley:

alias: Dagssysslor Alex Klart! Ger en poäng!
description: ""
trigger:
  - platform: state
    entity_id:
      - input_boolean.alex_uppgifter_borsta_haret
    to: "on"
    for:
      hours: 0
      minutes: 0
      seconds: 10
  - platform: state
    entity_id:
      - input_boolean.alex_uppgifter_borsta_tanderna
    to: "on"
    for:
      hours: 0
      minutes: 0
      seconds: 10
  - platform: state
    entity_id:
      - input_boolean.alex_uppgifter_badda_sangen
    to: "on"
    for:
      hours: 0
      minutes: 0
      seconds: 10
  - platform: state
    entity_id:
      - input_boolean.alex_uppgifter_stada_rummet
    to: "on"
    for:
      hours: 0
      minutes: 0
      seconds: 10
  - platform: state
    entity_id:
      - input_boolean.alex_uppgifter_laxor
    to: "on"
    for:
      hours: 0
      minutes: 0
      seconds: 10
  - platform: state
    entity_id:
      - input_boolean.alex_uppgifter_plocka_undan_sina_saker_pa_nedervaningen
    to: "on"
    for:
      hours: 0
      minutes: 0
      seconds: 10
  - platform: state
    entity_id:
      - input_boolean.alex_uppgifter_plocka_undan_sina_saker_pa_overvaningen
    to: "on"
    for:
      hours: 0
      minutes: 0
      seconds: 10
condition:
  - condition: state
    entity_id: input_boolean.alex_uppgifter_borsta_haret
    state: "on"
  - condition: state
    entity_id: input_boolean.alex_uppgifter_borsta_tanderna
    state: "on"
  - condition: state
    entity_id: input_boolean.alex_uppgifter_badda_sangen
    state: "on"
  - condition: state
    entity_id: input_boolean.alex_uppgifter_stada_rummet
    state: "on"
  - condition: state
    entity_id: input_boolean.alex_uppgifter_laxor
    state: "on"
  - condition: state
    entity_id: input_boolean.alex_uppgifter_plocka_undan_sina_saker_pa_nedervaningen
    state: "on"
  - condition: state
    entity_id: input_boolean.alex_uppgifter_plocka_undan_sina_saker_pa_overvaningen
    state: "on"
action:
  - target:
      entity_id: counter.dagssysslor_poang_alex
    data: {}
    action: counter.increment
  - delay:
      hours: 5
      minutes: 0
      seconds: 0
      milliseconds: 0
mode: single

My automation to use one point for an hour internet looks like this:

alias: Dagssysslor Alex - Använd Poäng till Internet
description: Om poäng finns så minskas en poäng för aktivering av internet
trigger: []
condition:
  - condition: numeric_state
    entity_id: counter.dagssysslor_poang_alex
    above: 0
action:
  - target:
      entity_id: counter.dagssysslor_poang_alex
    data: {}
    action: counter.decrement
  - metadata: {}
    data: {}
    action: script.wifi_alex_chromebook_pc_1h
mode: single

1 Like

Many thanks Mattias for the great explanation! I have followed your guidance and it now makes perfect sense. I actually had to redo my previous switches as I realized i had to create unique ones for each child in order to prevent child 1 from activating the same switch for child 2… Rookie mistake I guess :slight_smile:

Im now trying to get a button to activate both the automation (one point to one hour internet) and to activate the internet switch. This seems to be a rather tough challenge. Would it be correct to assume you have one button in HA which triggers the automation “Dagssysslor Alex - Använd Poäng till Internet”? The script, script.wifi_alex_chromebook_pc_1h, in this automation then enables internet access to this device for one hour? If so then I think I get the hang of it, I just need to learn how to write scripts in HA. I guess you need to have separate scripts/buttons for each device or perhaps using another helper with a drop down menu?

Do you have a similar button for transferring points to SEK or do you do this differently? Maybe you already have this but I’m thinking of setting up a counter for SEK as well. The kids would then be able to “cash in” desired amount from their SEK counter (sort of like a bank :D) whenever they feel the need for it.

Well your idea on how to solve this is just such a great idea, thank you once again for your guidance and inspiration! :star:

hey! Sorry for the late reply, your assumption is correct

I use this automation without trigger (as a button in the ui) to use one point for internet time!
It checks if she has any points available then decrements and runs the separate script that turns the device on, waits and then turns it back off again

alias: Dagssysslor Alex - Använd Poäng till Internet
description: Om poäng finns så minskas en poäng för aktivering av internet
trigger: []
condition:
  - condition: numeric_state
    entity_id: counter.dagssysslor_poang_alex
    above: 0
action:
  - target:
      entity_id: counter.dagssysslor_poang_alex
    data: {}
    action: counter.decrement
  - metadata: {}
    data: {}
    action: script.wifi_alex_chromebook_pc_1h
mode: single

Then I use this script to call the 1hour PC time, it is called from the automation above:

alias: WiFi - Alex Chromebook/PC 1h
sequence:
  - metadata: {}
    data: {}
    target:
      entity_id:
        - switch.unifi_block_68_7a_64_6b_36_27
        - switch.h6n0cv114789256
    action: switch.turn_on
  - delay:
      hours: 1
      minutes: 0
      seconds: 0
      milliseconds: 0
  - metadata: {}
    data: {}
    target:
      entity_id:
        - switch.unifi_block_68_7a_64_6b_36_27
        - switch.h6n0cv114789256
    action: switch.turn_off
mode: single
icon: mdi:camera-timer

Simple as that :smiley:

1 Like

Wow, that sure did the trick!! I absolutely love how your code got me into the scripts-section and made me realize it was not that intimidating as I first thought it would be. Managed to set up a simple automation to transfer points to money, very easy once you know how to think (thanks to your excellent guidance here :)).

My next idea is to have a “cash out”-button. Once pressed it will send a message to a specified Telegram-group I’ve created for this purpose. The message will include the value of the childs counter/saved money. It will then reset the counter. That way I know how much to transfer and I also get some traceability :slight_smile:

Oh and I have to let you know that my kids were also extremely excited today when they got to tick of their chores :wink: Thanks once again!

That’s what I love about ha, it is flexible and can do almost everything once you get started. It can be intimidating at first but nowadays it has become much easier with everything available through the UI, especially the scripting and automation part :slight_smile:
I’m glad that I could help you out :slight_smile: