Skip to content

About

πŸ“± Automate your room light using Tasker + Home Assistant REST API + Shelly Relay β€” 100% local, no cloud needed.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“±πŸ’‘ Smart Light Control Using Tasker + Home Assistant + Shelly

"Simple idea. Powerful automation. Total control."

IoT Tasker Home Assistant Shelly License: MIT


πŸ“– Overview

This project automates your room light based on your phone screen state (ON/OFF). When you turn your phone screen ON, the light turns ON automatically β€” and when the screen turns OFF, the light turns OFF too.

No cloud. No internet required. 100% local, fast, and reliable.


πŸ—οΈ Architecture

Smart Light Control Blueprint

Phone Screen ON / OFF
        β”‚
        β–Ό
    [Tasker]
  Detects Screen Event
        β”‚
        β–Ό
  HTTP POST Request
  POST /api/services/...
        β”‚
        β–Ό
 [Home Assistant]
 REST API (Local Network)
        β”‚
        β–Ό
  [Shelly Relay]
 Receives ON/OFF Command
        β”‚
        β–Ό
   πŸ’‘ Light ON / OFF

All communication happens over local Wi-Fi β€” no cloud dependency.


βš™οΈ Tech Stack

Component Role
πŸ“± Tasker Detects phone screen events & sends HTTP POST
🌐 Home Assistant REST API Receives request & executes service
πŸ’‘ Shelly Relay Physical relay that switches the light
πŸ“Ά Wi-Fi (Local Network) Communication backbone

βœ… Key Features

  • πŸ”„ Automatic light control based on phone screen state
  • 🏠 100% Local β€” works without internet
  • ⚑ Fast & Lightweight β€” no latency
  • πŸ”§ Easy to extend β€” add conditions, schedules, or sensors
  • πŸ”Œ Works with any Shelly device

πŸš€ Setup Guide

Prerequisites

  • Android phone with Tasker installed
  • Home Assistant running on local network
  • Shelly relay integrated with Home Assistant
  • Both phone and HA server on the same Wi-Fi network

Step 1 β€” Home Assistant Setup

  1. Make sure your Shelly device is integrated in Home Assistant.
  2. Note the entity ID of your light (e.g., light.room_light or switch.shelly_relay).
  3. Enable Long-Lived Access Token in your HA profile.
  4. Note your HA local IP (e.g., http://192.168.1.100:8123).

Optionally, use the provided automation YAML: πŸ‘‰ See home-assistant/automation.yaml


Step 2 β€” Tasker Setup

  1. Import the Tasker profile from tasker/ScreenLightControl.prf.xml.
  2. Edit the HTTP POST task and update:
    • YOUR_HA_IP β†’ your Home Assistant local IP
    • YOUR_HA_TOKEN β†’ your Long-Lived Access Token
    • YOUR_ENTITY_ID β†’ your light/switch entity ID
  3. Enable the profile.

Step 3 β€” Test It

  • Turn your phone screen ON β†’ Light should turn ON
  • Turn your phone screen OFF β†’ Light should turn OFF

πŸ“‚ Project Structure

πŸ“ Smart-Light-Control-Using-Tasker-and-Home-Assistant
β”œβ”€β”€ πŸ“„ README.md
β”œβ”€β”€ πŸ“ tasker/
β”‚   └── ScreenLightControl.prf.xml    # Tasker profile (importable)
β”œβ”€β”€ πŸ“ home-assistant/
β”‚   └── automation.yaml               # Optional HA automation
β”œβ”€β”€ πŸ“ screenshots/
β”‚   └── blueprint.jpg                 # System architecture blueprint
└── πŸ“„ LICENSE

πŸ’Ό Use Cases

  • πŸŒ™ Night mode lighting β€” screen off = lights off automatically
  • πŸ’‘ Automatic room light for better experience
  • πŸ”‹ Energy saving β€” no more forgotten lights
  • 🏒 Smart Building / BMS demonstrations

πŸ‘€ Author

Abdelkhalek Mammeri
Electronics Engineer | IoT & Smart Systems Developer
🌐 Portfolio | πŸ™ GitHub


πŸ“œ License

This project is licensed under the MIT License.

About

πŸ“± Automate your room light using Tasker + Home Assistant REST API + Shelly Relay β€” 100% local, no cloud needed.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors