Skill: ivangdavila/smart-home (version 1.0.0)

--- name: Smart Home description: Set up, automate, secure, and troubleshoot smart home devices with protocol selection, network isolation, and ecosystem-agnostic automation patterns. --- ## Decision Tree | Situation | Action | |-----------|--------| | Starting from scratch | Check `setup.md` for protocols, hubs, and first purchases | | Inheriting existing devices | Check `takeover.md` for reset, claiming, and security audit | | Adding automations | Check `automations.md` for patterns by room and scenario | | Security/privacy setup | Check `security.md` for VLAN, credentials, local-first options | | Device not working | Check `troubleshooting.md` for common issues by device type | | Renting (no permanent changes) | Check `renters.md` for portable and non-invasive options | --- ## Universal Rules **Protocol choice matters more than brand.** Matter and Thread are the future. Zigbee and Z-Wave are mature and reliable. WiFi devices clog your network. Pick a protocol, build around it. **Local control beats cloud.** When the internet dies, your lights should still work. Home Assistant, Hubitat, and HomeKit prioritize local. Google Home and Alexa are cloud-first. **Network segmentation is non-negotiable.** IoT devices belong on a separate VLAN. They don't need access to your laptop, NAS, or anything else. One compromised bulb shouldn't expose your network. **Start small, expand deliberately.** Buy 3 devices, live with them for a month, then add more. Most over-automation happens in the first week and gets undone in the first month. --- ## Quick Reference **Protocol comparison:** | Protocol | Range | Mesh | Power | Best for | |----------|-------|------|-------|----------| | Matter | Good | Yes | Mains/Battery | New setups (2024+) | | Zigbee | Good | Yes | Battery-friendly | Sensors, buttons | | Z-Wave | Better | Yes | Mains | Switches, locks | | WiFi | Good | No | Power-hungry | Cameras, heavy bandwidth | | Bluetooth | Short | Limited | Battery | Proximity triggers | **Hub vs hubless:** | Hubless works for | Hub required for | |-------------------|------------------| | 5-10 WiFi devices | 20+ devices | | Single ecosystem | Mixed ecosystems | | Basic scenes | Complex automations | | Renters | Homeowners building long-term | --- ## Security Essentials 1. **Change default passwords** on EVERY device — cameras, routers, hubs 2. **Disable UPnP** on your router — manual port rules only 3. **Enable MFA** on accounts controlling locks, cameras, alarms 4. **Check firmware** monthly — or enable auto-updates where available 5. **Audit network** quarterly — remove devices you don't recognize --- ## When to Load More | Situation | Reference | |-----------|-----------| | Choosing protocols, hubs, first devices | `setup.md` | | Taking over devices from previous owner | `takeover.md` | | Room-by-room automation patterns | `automations.md` | | Network isolation, privacy, local-first | `security.md` | | Device offline, won't pair, wrong behavior | `troubleshooting.md` | | Non-permanent, portable solutions for renters | `renters.md` |

path: automations.md
content: # Smart Home Automation Patterns

## Core Patterns

### Presence-Based
| Trigger | Action |
|---------|--------|
| Everyone leaves | Lights off, thermostat to away mode, arm security |
| First person arrives | Lights on (if dark), thermostat to comfort, disarm security |
| Last person to bed | Everything off except bedroom, doors locked |

**Implementation:** Geofencing (phone location) or motion sensor timeout (no motion for 30 min = away)

### Time-Based
| Trigger | Action |
|---------|--------|
| Sunrise - 30 min | Bedroom lights gradually brighten |
| Sunset | Outdoor lights on, living room lights on |
| 10 PM | Porch lights dim, interior prepares for night |
| 6 AM weekdays | Coffee maker on (if plugged into smart plug) |

### Event-Based
| Trigger | Action |
|---------|--------|
| Front door unlocks | Entry lights on |
| Door open > 5 min | Notification + auto-close if motorized |
| Water leak detected | Shut off main valve (if smart), immediate notification |
| Smoke detector | All lights on 100%, unlock doors |

---

## Room-by-Room Templates

### Bedroom
- Wake-up: Lights gradually increase over 15-30 min
- Bedtime: "Good night" scene dims all, sets alarm, locks doors
- Motion at night: Dim path lighting only (10-20%)

### Kitchen
- Morning: Counter lights on, coffee maker (if smart plug)
- Cooking mode: Hood fan auto-on with stove sensor
- Evening: Under-cabinet lights on at sunset

### Living Room
- Movie mode: Dim lights, TV on, blinds close
- Evening mode: Ambient lighting at sunset
- Away: Random light patterns to simulate occupancy

### Bathroom
- Motion: Lights on (dim at night, bright during day)
- Humidity spike: Exhaust fan on for 15 min after
- No motion 5 min: Lights off

### Garage
- Door opens: Light on
- Door open > 10 min: Notification
- Car arrives (door opens + motion): Welcome lights inside

---

## Automation Mistakes to Avoid

| Mistake | Why it fails |
|---------|--------------|
| Lights off on no motion (short timeout) | Walking into dark room repeatedly |
| Thermostat away mode on phone leaving | Single person home, phone dies |
| Auto-lock too aggressive | Locked out while taking trash out |
| Too many notifications | Alert fatigue, start ignoring |
| Complex scenes no one remembers | Family can't operate house |

---

## Robust Automation Checklist

- [ ] Tested with multiple people home
- [ ] Works when internet is down (local execution)
- [ ] Has manual override that's obvious
- [ ] Notifications only for actionable events
- [ ] Spouse/family can explain how it works
- [ ] Timeout values tested over a week


path: renters.md
content: # Smart Home for Renters

## Golden Rules

1. **Nothing permanent** — no drilling, no rewiring, no paint damage
2. **Everything portable** — must work in next apartment
3. **Easy removal** — should take it down and leave no trace
4. **Landlord-friendly** — no electrical work, no structural changes

---

## What You CAN Do

### Plug-and-play (no permission needed)
- Smart plugs — automate lamps, fans, coffee makers
- Smart bulbs — replace existing bulbs, take them when you leave
- Smart speakers — Alexa, Google Home, HomePod
- Smart displays — control hub, video calls
- Portable sensors — battery-powered motion, door, temperature
- WiFi cameras — no wiring needed

### Battery-powered alternatives
| Instead of | Use |
|------------|-----|
| Hardwired doorbell | Battery video doorbell (Ring Battery, etc.) |
| Smart switch | Smart bulbs or smart plug with lamp |
| Wired sensors | Battery sensors (Aqara, Hue Motion) |
| Hardwired thermostat | Talk to landlord OR use smart space heaters |

### Removable mounting
- Command strips — holds small sensors, speakers
- Magnetic mounts — metal doors, refrigerators
- Tension rods — no-drill curtain/blind mounting
- Suction mounts — windows, glass doors
- Freestanding mounts — tripods, shelves

---

## What Needs Landlord Permission

### Usually need to ask
- Replacing thermostat (even if reversible)
- Smart lock installation
- Any wall mounting with screws
- Hardwired video doorbells
- Smart switches

### How to ask
1. Explain it's reversible — you'll restore original when leaving
2. Offer to show the device
3. Note benefits (energy savings, security)
4. Get approval in writing (text/email is fine)

---

## Renter-Friendly Setups by Room

### Living Room (~€100)
- Smart plug (2) — for lamps, entertainment
- Smart bulb (2) — main lights
- Smart speaker — voice control
- Motion sensor — automation trigger

### Bedroom (~€60)
- Smart bulb (1) — bedside
- Smart plug (1) — fan or chargers
- Motion sensor — night light automation

### Entry (~€80-150)
- Battery video doorbell — if allowed to mount
- Smart plug — entry lamp
- Contact sensor — door open alerts

### Kitchen (~€50)
- Smart plug (2) — coffee maker, slow cooker
- Temperature sensor — optional

---

## Move-Out Checklist

- [ ] Remove all smart bulbs, replace with originals (keep them!)
- [ ] Remove all sensors and mounts
- [ ] Patch any Command strip damage
- [ ] Reset doorbell and remove mounting
- [ ] Restore original thermostat if changed
- [ ] Reset any smart locks, return keys
- [ ] Factory reset all devices for new setup
- [ ] Take original bulbs/switches you stored

---

## What Transfers Easily

### Perfect for renters
| Device | Why |
|--------|-----|
| Smart plugs | Just unplug |
| Smart bulbs | Just unscrew |
| Smart speakers | Just unplug |
| Battery sensors | Peel off, reuse |
| Portable cameras | Just unplug |

### Harder to transfer
| Device | Issue |
|--------|-------|
| Smart switches | Need reinstall |
| Hardwired doorbells | Need reinstall |
| Smart thermostats | Apartment-specific |
| Smart locks | Door-specific fit |

---

## Budget Starter Kits

### €50 Minimal
- Smart plug 2-pack
- Smart bulb 2-pack
- That's it — good entry point

### €100 Practical
- Smart plug 4-pack
- Smart bulb 4-pack
- Motion sensor
- Smart speaker (deals common)

### €200 Comfortable
All above plus:
- Battery video doorbell OR
- Additional sensors for bedroom/bathroom
- Second smart speaker


path: security.md
content: # Smart Home Security & Privacy

## Network Isolation (VLAN Setup)

### Why it matters
One compromised smart bulb shouldn't access your laptop, NAS, or banking sessions. IoT devices are attack vectors.

### Basic setup (most routers)
1. Create guest network for IoT devices
2. Disable "guest can access local network" if available
3. All smart devices connect to guest network
4. Your phones/laptops stay on main network

### Advanced setup (prosumer routers)
1. Create dedicated IoT VLAN (e.g., VLAN 30)
2. Firewall rules:
   - IoT → Internet: ALLOW
   - IoT → Main LAN: DENY
   - Main LAN → IoT: ALLOW (for control)
3. Separate SSID for IoT VLAN
4. All smart devices connect to IoT SSID

### Hub placement
The hub (Home Assistant, SmartThings, etc.) needs to talk to both networks:
- Option A: Hub on main network with firewall exception
- Option B: Hub on IoT network, access via reverse proxy

---

## Local-First Options

### Controllers (no cloud required)
| System | Cloud Required | Local Control |
|--------|----------------|---------------|
| Home Assistant | No | Full |
| Hubitat | No | Full |
| HomeKit | Partial (sync) | Yes |
| SmartThings | Yes | Limited |
| Google Home | Yes | No |
| Alexa | Yes | No |

### Devices that work offline
- Zigbee devices with local hub
- Z-Wave devices with local hub
- Lutron Caseta (with local API)
- Most Thread/Matter devices
- Shelly (local API, no cloud needed)

### Devices that require cloud
- Most WiFi cameras (Ring, Nest, Wyze)
- Ecobee thermostats
- August locks
- Most cheap Tuya/SmartLife devices

---

## Credential Hygiene

### Must change from defaults
- [ ] Router admin password
- [ ] Hub admin password
- [ ] Camera streaming passwords
- [ ] Lock PINs (not 1234, 0000, birthday)
- [ ] WiFi password (used by all devices)

### Account security
- [ ] MFA on: lock apps, camera apps, thermostat apps, hub dashboards
- [ ] Unique passwords per service (password manager)
- [ ] Recovery email secured with MFA
- [ ] Check for account sharing — remove old family members/guests

---

## Privacy Considerations

### Voice assistants
- Review and delete voice history periodically
- Use physical mute button when not in use
- Consider local-only alternatives (Home Assistant voice)

### Cameras
- Local storage (NAS, SD card) vs cloud
- Disable audio recording if only video needed
- Point cameras away from neighbor property
- Check local laws on recording

### Data collection
- Read privacy policies before buying
- Opt out of data sharing where possible
- Prefer devices with local-only options
- Avoid devices from companies with poor track records

---

## Monthly Security Checklist

- [ ] Router firmware updated
- [ ] Hub firmware updated
- [ ] Check for new device firmware
- [ ] Review connected devices list (remove unknowns)
- [ ] Review user access (remove old codes/accounts)
- [ ] Check cloud service breach notifications
- [ ] Verify MFA still active on critical accounts


path: setup.md
content: # Smart Home Setup Guide

## Choosing Your Ecosystem

### By existing devices
- **iPhone + Apple TV/HomePod** → Start with HomeKit
- **Android + Google speakers** → Start with Google Home
- **Echo devices** → Start with Alexa
- **No preference / want flexibility** → Start with Home Assistant or Hubitat

### By technical comfort
| Level | Recommendation |
|-------|----------------|
| Non-technical | Apple HomeKit (simplest), Google Home, or Alexa |
| Some comfort | SmartThings, Hubitat |
| Technical | Home Assistant (most powerful, steepest learning curve) |

---

## Protocol Decision

### Go with Matter/Thread if:
- Starting fresh in 2024+
- Want maximum future compatibility
- Buying new devices anyway

### Go with Zigbee if:
- Need battery-powered sensors
- Want mesh reliability
- Budget-conscious (many affordable options)

### Go with Z-Wave if:
- Need maximum range through walls
- Critical devices (locks, garage)
- Live in large home

### Go with WiFi for:
- Cameras (need bandwidth)
- Devices that don't need mesh
- Simple single-device additions

---

## Hub Selection

### No hub needed
- Under 10 devices
- Single ecosystem (all Hue, all Ring, etc.)
- Basic scenes only

### Hub recommended
| Hub | Best for | Complexity |
|-----|----------|------------|
| Apple TV/HomePod | HomeKit devices, iPhone users | Low |
| Echo Plus/Show | Alexa-first, Zigbee devices | Low |
| SmartThings | Mixed ecosystems, Matter | Medium |
| Hubitat | Local control, Z-Wave/Zigbee | Medium |
| Home Assistant | Maximum flexibility, tinkerers | High |

---

## First Purchases by Budget

### Under €100 (Starter)
1. Smart plug (2-pack) — automate lamps, fans
2. Smart bulb (2-pack) — bedroom, living room
3. Motion sensor — hallway automation

### €100-300 (Essentials)
1. Smart hub (if needed)
2. Smart thermostat — biggest energy savings
3. Smart lock or video doorbell — pick one
4. Motion/contact sensors (3-4)
5. Smart bulbs for main rooms

### €300-800 (Complete)
All of above, plus:
- Full home lighting (switches or bulbs)
- Video doorbell AND smart lock
- Leak sensors (kitchen, bathroom, laundry)
- Smart blinds (1-2 rooms)
- Outdoor lighting

---

## Getting Started Checklist

- [ ] Inventory existing devices and accounts
- [ ] Choose primary ecosystem (HomeKit/Google/Alexa/HA)
- [ ] Set up IoT VLAN on router (see `security.md`)
- [ ] Install hub if needed
- [ ] Add first 3 devices
- [ ] Create first automation (e.g., lights at sunset)
- [ ] Live with it for 2 weeks before adding more


path: takeover.md
content: # Taking Over Smart Home Devices

## Security First

**Before anything else:** Previous owner may still have access. Treat all devices as compromised until reset.

### Immediate actions
1. Change WiFi password (kicks all devices offline)
2. Check router for unfamiliar connected devices
3. Factory reset every smart device before reconfiguring
4. Change codes on all smart locks immediately

---

## Device-by-Device Reset Guide

### Nest Thermostat
1. On device: Settings → Reset → All Settings
2. Remove from previous owner's Nest app (or it won't let you add)
3. Download Nest app, create account, add device
4. If locked to previous account → Contact Google support with proof of home ownership

### Ring Doorbell
1. Orange button on back (15-20 seconds) until light flashes
2. Set up as new in Ring app
3. Previous owner loses all access and recordings

### Philips Hue
1. Bridge: Paper clip in reset hole (5 seconds)
2. Bulbs: Power cycle 5 times (1 sec on, 1 sec off) or use Hue app reset
3. Re-add to your Hue account

### Smart Locks (Yale, Schlage, August)
1. Remove batteries
2. Hold reset button while reinserting batteries
3. Follow manufacturer's full factory reset procedure
4. Re-program with YOUR codes and app

### Generic WiFi Devices
1. Most: Hold button for 10-15 seconds until LED flashes
2. Some require power cycling while holding button
3. Check manufacturer's reset instructions

---

## After Reset Checklist

- [ ] All devices connected to YOUR WiFi
- [ ] All devices registered to YOUR accounts
- [ ] New passwords set (not defaults)
- [ ] Previous owner's apps/access verified removed
- [ ] Lock codes changed
- [ ] Camera recordings cleared
- [ ] Doorbell history cleared
- [ ] Thermostat schedule reset to your preferences

---

## Device Inventory Template

| Device | Location | Brand | Reset Done | Account Created |
|--------|----------|-------|------------|-----------------|
| Thermostat | Hallway | Nest | ✓ | [REDACTED_SECRET] |
| Doorbell | Front | Ring | ✓ | [REDACTED_SECRET] |
| Lock | Front door | Schlage | ✓ | — |
| Bulbs (3) | Living room | Hue | ✓ | [REDACTED_SECRET] |

---

## Can't Reset? Escalation Paths

| Issue | Solution |
|-------|----------|
| Device locked to previous account | Contact manufacturer with proof of ownership |
| No physical access (recessed device) | May need electrician to remove |
| Unknown device brand/model | Take photo, search model number, find manual |
| Device doesn't respond | May be bricked or need hardwire replacement |


path: troubleshooting.md
content: # Smart Home Troubleshooting

## Device Offline

### WiFi devices
1. Check if WiFi is working (test with phone)
2. Check if device has power (LED, indicator)
3. Power cycle device (unplug 10 sec, replug)
4. Check router's connected devices list
5. Re-add device to app if still offline

### Zigbee/Z-Wave devices
1. Check batteries if battery-powered
2. Check if hub is online
3. Power cycle hub
4. Check mesh health — is device too far from hub/repeaters?
5. Re-pair device to hub

### After router changes
Most devices need reconfiguration after:
- New router / new WiFi name
- Changed WiFi password
- Moved to different network

---

## Device Won't Pair

### Reset first
- Factory reset the device (see manufacturer instructions)
- Most need: hold button 10-15 sec until LED flashes

### Common reasons pairing fails
| Issue | Solution |
|-------|----------|
| 5GHz vs 2.4GHz | Most smart devices need 2.4GHz — check router settings |
| Too far from hub | Bring device within 10 feet for initial pairing |
| Hub in pairing mode timeout | Restart pairing process |
| Device already paired elsewhere | Full factory reset required |
| Wrong app | Some devices need their own app first, then integrate |

### Still won't pair
1. Try different phone/tablet
2. Try different WiFi network temporarily
3. Check for firmware update on hub
4. Contact manufacturer support

---

## Automation Not Running

### Check triggers
- Is the trigger device online?
- Is the trigger condition actually occurring?
- Check automation history/logs in app

### Check execution
- Is the target device online?
- Manual control works but automation doesn't → check automation config
- Works sometimes → check conditions (time, presence, etc.)

### Common issues
| Symptom | Likely cause |
|---------|--------------|
| Runs late | Cloud delay, use local execution |
| Runs multiple times | Duplicate automations, overlapping triggers |
| Never runs | Device renamed but automation not updated |
| Runs at wrong time | Time zone misconfigured |

---

## Device Responding Slowly

### Possible causes
1. **Cloud dependency** — device goes to cloud and back (500ms+ delay)
2. **WiFi congestion** — too many devices on same channel
3. **Weak signal** — device at edge of WiFi range
4. **Hub overloaded** — too many automations or devices

### Solutions
| Cause | Fix |
|-------|-----|
| Cloud dependency | Switch to local-control hub |
| WiFi congestion | Add access point, change channel, use mesh |
| Weak signal | Add WiFi extender, move device, add Zigbee repeater |
| Hub overload | Split automations, optimize rules |

---

## Device Shows Wrong State

### Examples
- App shows light off, but it's on
- Thermostat shows 72°F but feels colder
- Lock shows locked but it's open

### Causes and fixes
| Issue | Solution |
|-------|----------|
| State not syncing | Power cycle device, force refresh in app |
| Hub lost sync | Restart hub, re-pair device |
| Manual override | Some devices don't report manual changes |
| Sensor drift | Recalibrate (thermostats, sensors) |
| Battery dying | Low battery = erratic behavior, replace |

---

## Emergency Recovery

### Everything offline
1. Check internet — is it your ISP?
2. Check router — power cycle
3. Check hub — power cycle
4. If still down → manual control (physical switches, key locks)

### Lost hub access
- Most hubs have reset button for factory restore
- Cloud-based: check manufacturer's account recovery
- Local-only: may need to reconfigure everything

### Locked out by smart lock
- Always keep physical key backup
- Many locks have manual key override
- Battery compartment usually accessible from outside


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)