zjleblanc.kasa.smart_device (1.1.0) — module

Automate kasa smart devices

| "added in version" 1.0.0 of zjleblanc.kasa"

Authors: Zach LeBlanc (@zjleblanc)

Install collection

Install with ansible-galaxy collection install zjleblanc.kasa:==1.1.0


Add to requirements.yml

  collections:
    - name: zjleblanc.kasa
      version: 1.1.0

Description

Use this module to automate Kasa smart devices in your home or business.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get smart device info
  zjleblanc.kasa.smart_device:
    target: 192.168.0.100
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get smart devices info
  zjleblanc.kasa.smart_device:
    target: 
        - 192.168.0.100
        - 192.168.0.101
        - 192.168.0.102
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Set smart device alias
  zjleblanc.kasa.smart_device:
    target: 192.168.0.100
    alias: "Backyard Lights"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Turn smart device on
  zjleblanc.kasa.smart_device:
    target: 192.168.0.100
    state: enabled
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Turn smart devices off
  zjleblanc.kasa.smart_device:
    target: 
        - 192.168.0.100
        - 192.168.0.101
        - 192.168.0.102
    state: disabled

Inputs

    
mac:
    description: The smart device mac address.
    required: false
    type: str

alias:
    description: The smart device alias (as shown in Kasa app).
    required: false
    type: str

state:
    choices:
    - enabled
    - disabled
    - updated
    description: The desired state of the smart device
    required: false
    type: str

target:
    default: []
    description: The target ip address for the smart device
    elements: str
    required: true
    type: list

Outputs

smart_devices:
  description: The target smart device info
  returned: always
  type: list