A Home Assistant custom component for monitoring cross-country ski trail conditions from Sporet.no.
- Monitor ski trail slope status
- Track trail preparation time
- View preparation quality across slope segments
- Automatic updates every 15 minutes
- Open HACS in your Home Assistant instance
- Click on "Integrations"
- Click the three dots in the top right corner
- Select "Custom repositories"
- Add this repository URL:
https://github.com/yourusername/home-assistant-sporet - Select "Integration" as the category
- Click "Add"
- Find "Sporet" in the HACS integration list and click "Download"
- Restart Home Assistant
- Download the
custom_components/sporetfolder from this repository - Copy the entire
sporetfolder to your Home Assistantcustom_componentsdirectory:- Path:
<config_dir>/custom_components/sporet/
- Path:
- Restart Home Assistant
Before setting up the integration, you need:
-
Ski Trail Slope ID: Find this at sporet.no
- Navigate to your desired ski trail
- Select a slope in the map
- Click the
Sharebutton - Extract the slope id from the copied URL
-
Bearer Token:
- Log in to sporet.no
- Open the network anaylser in the developer tools of the browser
- Find the
detailstraffic, find theauthorizationattribute in the header section - Copy the token
Important
Make sure you copy the entire token!
Some browsers might truncate the Bearer Token when you copy it. Look for a switch to "display raw headers" or similar which will ensure the entire string is available.
Another option is to right click on one of the requests to https://api.sporet.no and look for
Copy Request Headers, or Copy as Curl or something similar. Paste the result into
a plain text file and find the line starting with Authorization:. Copy the entire line and
paste it into the Bearer Token field below.
- In Home Assistant, go to Settings → Devices & Services
- Click + Add Integration
- Search for "Sporet"
- Enter your configuration:
- Bearer Token: Your API authentication token
- Click Submit
The integration will validate your credentials.
After the main entry is created, you can add slopes and segments.
- Go to Settings → Devices & Services
- Find the "Sporet" integration
- Click the "+" sign next to "Add entry" in the Sporet Integration
- Add a Slope - either a "Share" link from the Slope or Segment or just the ID number
The integration will create sensors for the specified slope.
The integration creates three sensors for each configured slope:
- Entity ID:
sensor.<slope_name>_prepped_time - Description: Timestamp of when the trail was last prepared
- Device Class: Timestamp
- Example:
2025-12-01T09:06:12Z
- Entity ID:
sensor.<slope_name>_prep_symbol - Description: Numeric code indicating overall trail condition
- Values:
30: Good condition50: Fair condition70: Poor condition or not groomed- Other values as defined by Sporet
- Example:
30
- Entity ID:
sensor.<slope_name>_prep_symbol_parts - Description: Shows the lowest prep symbol value across all route segments
- Attributes: Contains
partsarray with detailed breakdown by segment - Example:
30(lowest value from all segments)
Each sensor includes additional attributes with detailed route information:
slope_id: The route identifierslope_name: Name of the ski trail routedestination_name: Name of the destination areacounty: County namemunicipal: Municipality namecountry: Countryprepped_by: Organization responsible for groominghasClassic: Boolean - Classic skiing availablehasSkating: Boolean - Skating skiing availablehasFloodlight: Boolean - Floodlight availableisScooterTrail: Boolean - Scooter trailroutelength: Total length of the route in meterstotalElevationGain: Total elevation gain in meterstotalElevationLoss: Total elevation loss in metersparts: (prep_symbol_parts sensor only) Array of segment-level prep symbols with percentages
If your bearer token expires or needs to be updated:
- Go to Settings → Devices & Services
- Find the "Sporet" integration
- Click Configure
- Enter your new bearer token
- Click Submit
The integration will reload with the new token without losing your configuration.
automation:
- alias: "Notify when trail is groomed"
trigger:
- platform: state
entity_id: sensor.sjusjoen_ljosheim_kort_prepped_time
condition:
- condition: template
value_template: >
{{ (now() - states.sensor.sjusjoen_ljosheim_kort_prepped_time.state | as_datetime).total_seconds() < 3600 }}
action:
- service: notify.mobile_app
data:
title: "Trail Groomed!"
message: "Ljøsheim trail segment was just groomed."type: entities
title: Ski Trail Status
entities:
- entity: sensor.heistadmoen_10_km_prepped_time
name: Last Groomed
- entity: sensor.heistadmoen_10_km_prep_symbol
name: Overall Condition
- entity: sensor.heistadmoen_10_km_prep_symbol_parts
name: Worst Segment ConditionThe integration uses the Sporet public API:
- Endpoint:
https://api.sporet.no/loypeapi/public/skiroutes/{slope_id}/details - Authentication: Bearer token in Authorization header
- Update Interval: 900 seconds (15 minutes)
- Method: GET
- Verify your internet connection
- Check if sporet.no is accessible
- Ensure the API endpoint is not blocked by your firewall
- Verify your bearer token is correct
- Check if the token has expired
- Regenerate a new token from sporet.no
- Verify the slope ID exists on sporet.no
- Check the slope ID is correct
- Make a manual API call to verify the route exists
Add to your configuration.yaml:
logger:
default: info
logs:
custom_components.sporet: debugThis integration includes a development container for easy testing:
- Open the project in VS Code
- Install the "Remote - Containers" extension
- Click "Reopen in Container" when prompted
- The development Home Assistant instance will start automatically
- Access at
http://localhost:8123
For issues, feature requests, or contributions:
- GitHub Issues: Create an issue
- Discussions: Join the discussion
This project is licensed under the MIT License - see the LICENSE file for details.
- Data provided by Sporet.no
- Integration developed for Home Assistant