sensor.velya_next_wake timestamp to Home Assistant every time your schedule changes — no helpers to create. Your automation triggers on it. Optionally, Home Assistant can also trigger, snooze or dismiss alarms back. The iPhone alarm (iOS 26 AlarmKit, rings through Silent/DND/Focus) is always the independent backstop.
1 Connect Velya to Home Assistant
In Home Assistant, create a long-lived access token (your profile → Security → Long-lived access tokens → Create). In Velya, go to Settings ▸ Integrations ▸ Home Assistant and enter your HA URL (e.g. http://homeassistant.local:8123) and the token.
That's the entire setup on the outbound side. Velya stores the token in the device Keychain and talks to your HA directly — nothing routes through LorisLabs.
2 React to your next wake
Whenever your soonest alarm changes, Velya writes it to Home Assistant:
sensor.velya_next_wake— the next wake time as an ISO-8601 timestamp (device_class: timestamp). It appears automatically once Velya is connected.- Attribute
velya_actions— a JSON list of the home actions you attached in Velya (scenes, sunrise ramp, webhooks), if any. - When no alarm is set, the state becomes
unavailable.
Point one automation at it. Because the state is the timestamp, your automation fires exactly at wake time — server-side, independent of the phone:
alias: Velya — morning wake
trigger:
- platform: time
at: sensor.velya_next_wake
condition:
# ignore a stale/past value (e.g. a missed clear)
- condition: template
value_template: "{{ as_datetime(states('sensor.velya_next_wake')) >= now() - timedelta(minutes=1) }}"
action:
- service: cover.open_cover
target: { entity_id: cover.bedroom }
- service: scene.turn_on
target: { entity_id: scene.sunrise }
- service: climate.set_temperature
target: { entity_id: climate.bedroom }
data: { temperature: 21 }
mode: single
Prefer an input_datetime helper instead? Velya also mirrors the wake to input_datetime.velya_wake if you create that helper — either trigger works. The sensor needs no helper at all.
3 Control Velya from Home Assistant
Velya can also take commands from your home — trigger, snooze or dismiss an alarm. Turn on Settings ▸ Advanced ▸ Webhook Server (off by default; it binds Wi-Fi only and requires a Bearer token shown in that screen). Then POST to your iPhone on your local network:
rest_command:
velya_snooze:
url: "http://<your-iphone-ip>:8080/webhook"
method: POST
headers:
Authorization: "Bearer <token-from-Velya>"
content_type: "application/json"
payload: '{"action":"snooze_alarm","duration":9}'
Supported actions: trigger_alarm, snooze_alarm (optional duration in minutes), dismiss_alarm (optional alarm_id). Give your iPhone a DHCP reservation so its IP is stable.
Why this design? iOS won't wake a killed app to run an HTTP call at ring time, so Velya pre-publishes the wake to Home Assistant ahead of time and lets HA fire the automation. The ring itself is guaranteed by AlarmKit on the phone. Two layers, each independent.