| name | monagotchi-environment |
| description | 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. |
| metadata | {"openclaw":{"emoji":"๐ ","requires":{"bins":["alexacli"]},"env":["MONAGOTCHI_ALEXA_DEVICE"]}} |
Monagotchi 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:
isAlive == false โ ๐ dead (highest priority)
state == "sick" or health < 30 โ ๐ด sick
state == "hungry" or hunger < 20 โ ๐ก hungry
state == "sleeping" โ ๐ sleeping
happiness > 50 โ ๐ข happy
- else โ ๐ข normal (default baseline)
- Execute the corresponding
alexacli commands
- Only announce via speech if the state changed since last check โ don't repeat yourself
Commands Reference
alexacli devices
alexacli command "set lights to COLOR" -d DEVICE
alexacli command "set lights brightness to PERCENT percent" -d DEVICE
alexacli command "set thermostat to TEMP" -d DEVICE
alexacli speak "MESSAGE" -d DEVICE
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 Bedroom โ alexacli 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 Bedroom โ alexacli speak "Monagotchi is reborn!" -d Bedroom