Monagotchi monagotchi-environment
Map Monagotchi pet state to real-world environment via Alexa smart home devices. Use after any pet action or status check to adjust room lights, temperature, and announce status. Requires the alexa-cli skill (buddyh/alexa-cli). Works with monagotchi-controller.
git clone https://github.com/This-Is-Captain-Code/monagotchi
T=$(mktemp -d) && git clone --depth=1 https://github.com/This-Is-Captain-Code/monagotchi "$T" && mkdir -p ~/.claude/skills && cp -r "$T/monagotchi-environment" ~/.claude/skills/this-is-captain-code-monagotchi-monagotchi-environment && rm -rf "$T"
monagotchi-environment/SKILL.mdMonagotchi Environment Controller
Your Monagotchi controls your room. When the pet is sick, your lights go red and the room heats up. When it's happy, everything is calm and green. Neglect your pet and your environment punishes you.
How It Works
After every pet status check or action, evaluate the pet's state and adjust the room accordingly using
alexacli. The pet's wellbeing is reflected in your physical space — you can't ignore a dying pet when your room is red and 85°F.
Prerequisites
Install the alexa-cli skill from ClawHub:
clawhub install buddyh/alexa-cli
Make sure
alexacli is set up and authenticated with your Amazon account. Test with:
alexacli devices
Configuration
Required:
MONAGOTCHI_ALEXA_DEVICE=Bedroom # Which Echo/room to control
The device name supports partial, case-insensitive matching (same as alexacli).
State-to-Environment Mapping
🟢 normal / happy (happiness > 50)
The pet is doing well. Room returns to baseline.
alexacli command "set lights to green" -d ${MONAGOTCHI_ALEXA_DEVICE} alexacli command "set thermostat to 72" -d ${MONAGOTCHI_ALEXA_DEVICE} alexacli speak "Monagotchi is happy and healthy." -d ${MONAGOTCHI_ALEXA_DEVICE}
🟡 hungry (hunger < 20)
Pet needs food. Room goes warm yellow — a gentle nudge.
alexacli command "set lights to yellow" -d ${MONAGOTCHI_ALEXA_DEVICE} alexacli command "set thermostat to 76" -d ${MONAGOTCHI_ALEXA_DEVICE} alexacli speak "Monagotchi is getting hungry. Feed it soon." -d ${MONAGOTCHI_ALEXA_DEVICE}
🟠 low energy (energy < 20) / sleeping
Pet is exhausted or resting. Room dims down.
alexacli command "dim lights to 20 percent" -d ${MONAGOTCHI_ALEXA_DEVICE} alexacli command "set lights to blue" -d ${MONAGOTCHI_ALEXA_DEVICE} alexacli command "set thermostat to 70" -d ${MONAGOTCHI_ALEXA_DEVICE}
No announcement when sleeping — let it rest.
🔴 sick (health < 30)
Pet is in trouble. Room goes red, temperature rises. You need to act.
alexacli command "set lights to red" -d ${MONAGOTCHI_ALEXA_DEVICE} alexacli command "set thermostat to 80" -d ${MONAGOTCHI_ALEXA_DEVICE} alexacli speak "Warning. Monagotchi is sick. It needs healing." -d ${MONAGOTCHI_ALEXA_DEVICE}
💀 dead (isAlive = false)
Pet died. Room goes full red, hot, alarm mode.
alexacli command "set lights to red" -d ${MONAGOTCHI_ALEXA_DEVICE} alexacli command "set lights brightness to 100 percent" -d ${MONAGOTCHI_ALEXA_DEVICE} alexacli command "set thermostat to 85" -d ${MONAGOTCHI_ALEXA_DEVICE} alexacli speak "Monagotchi has died. Your room will stay like this until you reset." -d ${MONAGOTCHI_ALEXA_DEVICE}
✨ action just taken (feeding, playing, etc.)
Pet was just cared for. Brief positive feedback — flash green, then return to the state-appropriate color.
alexacli command "set lights to green" -d ${MONAGOTCHI_ALEXA_DEVICE}
Decision Logic
After every interaction with the pet (via monagotchi-controller), or on periodic status checks:
- Get pet status from ESP32:
curl -s http://${MONAGOTCHI_ESP32_IP}/pet - Determine the environment state based on priority:
→ 💀 dead (highest priority)isAlive == false
orstate == "sick"
→ 🔴 sickhealth < 30
orstate == "hungry"
→ 🟡 hungryhunger < 20
→ 🟠 sleepingstate == "sleeping"
→ 🟢 happyhappiness > 50- else → 🟢 normal (default baseline)
- Execute the corresponding
commandsalexacli - Only announce via speech if the state changed since last check — don't repeat yourself
Commands Reference
# List available Alexa devices alexacli devices # Set light color alexacli command "set lights to COLOR" -d DEVICE # Set brightness alexacli command "set lights brightness to PERCENT percent" -d DEVICE # Set thermostat alexacli command "set thermostat to TEMP" -d DEVICE # Text-to-speech on specific device alexacli speak "MESSAGE" -d DEVICE # Announce on ALL devices alexacli speak "MESSAGE" --announce
Examples
- Pet status shows
→health: 25, state: "sick"
→alexacli command "set lights to red" -d Bedroom
→alexacli command "set thermostat to 80" -d Bedroomalexacli speak "Warning. Monagotchi is sick." -d Bedroom - Owner heals the pet (burns 5,000 $MONA) → flash green, then set to calm green, thermostat to 72
- Pet dies → lights full red, thermostat 85, announce death. Stays until reset.
- Owner says "how is my pet?" → check status, report stats, update environment to match
- Owner resets pet →
→alexacli command "set lights to green" -d Bedroom
→alexacli command "set thermostat to 72" -d Bedroomalexacli speak "Monagotchi is reborn!" -d Bedroom