4

I am creating a "digital dashboard", consisting of a TV and a Raspberry Pi 3B+. The TV just shows calendar, time, weather, etc..

In the tutorial I am following for that, the creator uses a cron job to turn the TV on and off via CEC. However, he does this at a specific timeframe.

What I would like to achieve here, is that whenever one of two phones (or both) - the ones of my girlfriend and mine - are logged into the router, the TV is on, if not, the TV is off. So, to recap, whenever nobody is at home, the TV shouldn't be turned on / should be turned off. Also, at the night, lets say 11PM to 6AM, the TV shouldn't be on either, respectively, it should be automatically turned OFF at 11PM.

My router is a Fritz!Box 7520, just to mention that as well.

What do you think? Is this even doable? Or am I gonna run in huge effort with high costs for this?

Thanks in advance!

8
  • before you even start thinking about your project, make sure that the RPi is able to control the TV via CEC
    – jsotola
    Commented Aug 8, 2020 at 16:15
  • @jsotola thats working fine, I tried that :) The Pi is definetely able to turn the TV on and off via command line :)
    – nameless
    Commented Aug 8, 2020 at 16:21
  • then start with the cron job ... that is separate from the cellphone detection anyway ... work your way through the project one step at a time
    – jsotola
    Commented Aug 8, 2020 at 16:26
  • the router may respond to UPnP queries for a list of connected devices ... otherwise you may have to scrape the router's setup webpage
    – jsotola
    Commented Aug 8, 2020 at 16:33
  • yeah, cron job and basic things are working and I know how to deal with it... Just don't know how to go on... Also thought about somehow connecting the raspy with my Alexa and then being able to automate it with alexa, don't know if this'd be easier...might check on the UPnP thing
    – nameless
    Commented Aug 8, 2020 at 17:05

1 Answer 1

1

I got it working!

It was pretty easy when you got the right idea.

I use the IP's of the phones. I configured them to be static in my network.

Then, I wrote a little Python script that pings both IP-addresses. If one of the two is online, TV should be turned on. If both are offline, TV should be turned off.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.