Services
The integration registers the following service actions under the sunriser domain.
Download Backup (sunriser.backup)
Download a complete backup of all device configuration and save it as a .msgpack file in your Home Assistant /config directory. Returns the saved file path so you can use it with the restore service later.
Restore Backup (sunriser.restore)
Restore device configuration from a previously downloaded backup file. The device performs a deep restart after applying the config. Use the file path returned by the backup service.
| Field | Description | Required |
|---|---|---|
file_path |
Absolute path to the .msgpack backup file (e.g. /config/sunriser_backup_20260323_120000.msgpack). | Yes |
Get Error Log (sunriser.get_errors)
Retrieve the device error log. Returns a dict with a "content" key containing the raw log text.
Get Diagnostic Log (sunriser.get_log)
Retrieve the device diagnostic log. Returns a dict with a "content" key containing the raw log text.
Get Day Planner Schedule (sunriser.get_dayplanner_schedule)
Read the current day planner schedule for a PWM channel. Returns a dict with "pwm" and "markers" keys. Each marker has "time" (HH:MM) and "percent" (0–100).
| Field | Description | Required |
|---|---|---|
pwm |
PWM channel number (1–10). | Yes |
Set Day Planner Schedule (sunriser.set_dayplanner_schedule)
Replace the day planner schedule for a PWM channel. The device will follow the new schedule from the next minute boundary. Provide at least one marker.
| Field | Description | Required |
|---|---|---|
pwm |
PWM channel number (1–10). | Yes |
markers |
List of schedule markers. Each marker needs "time" (HH:MM, 24-hour) and "percent" (0–100). The device interpolates linearly between markers. | Yes |
Get Week Planner Schedule (sunriser.get_weekplanner_schedule)
Read the current week planner program assignment for a PWM channel. Returns a dict with "pwm", "name", "color_id", and "schedule" keys. The schedule maps day names (sunday, monday, …, saturday, default) to program IDs (integers). "default" is the fallback program used on days with no explicit assignment.
| Field | Description | Required |
|---|---|---|
pwm |
PWM channel number (1–10). | Yes |
Set Week Planner Schedule (sunriser.set_weekplanner_schedule)
Write the week planner program assignment for a PWM channel. Provide a "schedule" dict mapping day names (sunday, monday, tuesday, wednesday, thursday, friday, saturday, default) to program IDs. Omitted days default to 0 (no program). "default" is the fallback used on unassigned days.
| Field | Description | Required |
|---|---|---|
pwm |
PWM channel number (1–10). | Yes |
schedule |
Dict mapping day names to program IDs (integers). Include only the days you want to set; omitted days are written as 0 (no program). | Yes |
Download Factory Backup (sunriser.download_factory_backup)
Download the factory default configuration from the device and save it as a .msgpack file in your Home Assistant /config directory. Returns the saved file path.
Download Firmware Info (sunriser.download_firmware)
Download the firmware info blob (GET /firmware.mp) from the device and save it as a .msgpack file in /config. Developer/diagnostic use only.
Download Bootload Info (sunriser.download_bootload)
Download the bootload info blob (GET /bootload.mp) from the device and save it as a .msgpack file in /config. Developer/diagnostic use only.
Factory Reset (sunriser.factory_reset)
Reset ALL device configuration to factory defaults (DELETE /). This is irreversible — all PWM settings, schedules, and network config will be wiped. You must pass confirm: true to proceed.
| Field | Description | Required |
|---|---|---|
confirm |
Must be set to true to execute the reset. | Yes |
Examples
Backup and restore
# Take a backup
action: sunriser.backup
response_variable: result
# result.path = /config/sunriser_backup_20260323_120000.msgpack
# Restore from backup
action: sunriser.restore
data:
file_path: /config/sunriser_backup_20260323_120000.msgpack
Scheduled backup automation
automation:
alias: "SunRiser nightly backup"
trigger:
- platform: time
at: "03:00:00"
action:
- action: sunriser.backup
Read and write a week planner schedule
# Read schedule for PWM channel 1
action: sunriser.get_weekplanner_schedule
data:
pwm: 1
response_variable: schedule
# schedule.schedule = {"monday": 1, "tuesday": 1, ..., "default": 0}
# Write a new week planner schedule for PWM channel 1
action: sunriser.set_weekplanner_schedule
data:
pwm: 1
schedule:
monday: 1
tuesday: 1
wednesday: 1
thursday: 1
friday: 1
saturday: 2
sunday: 2
default: 0
Read and write a day planner schedule
# Read schedule for PWM channel 1
action: sunriser.get_dayplanner_schedule
data:
pwm: 1
response_variable: schedule
# Write a new schedule for PWM channel 1
action: sunriser.set_dayplanner_schedule
data:
pwm: 1
markers:
- time: "06:00"
percent: 0
- time: "08:00"
percent: 80
- time: "20:00"
percent: 80
- time: "22:00"
percent: 0