I’m pretty damn lazy. and I miss my alarms all the time… and I can’t be sure that I’ll actually get out of bed when an alarm is stopped.

Thankfully, I’ve got a awesome local smart home system (Home Assistant), that has AI Powered calendar/news/weather/state/automations and god knows what else I’ve forgotten.

My problem is I want the system to have it seamlessly wake me up, when I need to be woken, and if I ignore it, try harder.

I came up with this quick pseudo-automation

  1. Detect user getting out of bed (occupancy: On Off)

  2. Check if the user is home (Accidental trigger?)

  3. Check if the time is relatively sane for a briefing. (6am 6pm)

  4. Check if the occupied time is above n hours (defaulting to 3.92)

  5. Check if it’s been 12 hours since last activation

  6. Grab the Local Forecast for today

  7. Grab all Calendar events for today

  8. Send that to a LLM to generate a good morning briefing.

Now.. I was stuck on step 1. How can I get the bed sense my occupancy? After some searching on some home assistant forums, I found this: The Force Resistive Sensor (FSR). A FSR is a long resistor that changes voltage depending on how much force is applied to it.

PERFECT!

I followed the forum building, testing, calibrating and added one to my Volksensor board next to my bed.

Calibration

The Volksensor is a ESPHome DIY job. When I rigged up the FSR to it, it just reads a voltage value. 0.14v - I’m in bed. 1.6 to 3.3v - I’m not in bed.

So, we setup 3 ‘things’ in ESPHome, which are adjustable from in Home Assistant.

  1. Trigger Voltage (In Bed) - What voltage counts as being in bed?
  2. Trigger Voltage (Out of Bed) - What voltage counts as not being in bed?
  3. Occupied Binary - True / False output of bed occupancy.

This lets me adjust the voltages if my mattress changes, or any shifting parts changes the voltage readings.

Fritzing Diagram

LLM Prompt

Generate a short, sarcastic GLaDOS-style good morning message for someone waking up at {{ now() }}. If it's past midday, mock them for it. 

- Briefly mention the weather if it's out of the ordinary
- Mention how long the user slept ( {{ states('sensor.bed_occupied_time_last_12_hours') | float | round(1) }} hours )
- Tell them the time to their first calendar event
- Mention only the most relevant or interesting Movie/TV/Anime release.
- Summarise one headline from each news feed, pick the most stand-alone that makes sense with just the headline, however, also pick the bizzare and entertaining ones if possible.

Calendar Data:
{{ calendar }}

Forecast:

{{ forecast }}

HackerNews Feed:

{% set entries = state_attr('sensor.hacker_news', 'entries') %} {{ {'titles': entries | map(attribute='title') | list } | tojson }}

Local News:

{% set entries = state_attr('sensor.redacted_name', 'entries') %} {{ {'titles': entries | map(attribute='title') | list } | tojson }}

I specifically mention GLaDOS-style since my TTS voice is trained on GLaDOS.