This custom integration allows you to monitor and interact with your hiking portal directly from Home Assistant.
- Next Hike - Shows your next upcoming hike with full details
- Upcoming Hikes Count - Number of upcoming hikes
- My Hikes Count - Number of hikes you're interested in
- Pending Users (Admin only) - Number of users awaiting approval
- Total Hikes - Total number of hikes in the system
- Hiking Calendar - All your hikes displayed in Home Assistant calendar
- Integrates with Google Calendar, Apple Calendar, etc.
- Shows hike details, location, difficulty, and more
- Real-time notifications for new hikes
- Alerts when users need approval
- Reminders before your hikes
- Open HACS in Home Assistant
- Go to "Integrations"
- Click the three dots in the top right
- Select "Custom repositories"
- Add repository URL:
https://github.com/hiking-portal/homeassistant - Category: Integration
- Click "Add"
- Search for "The Narrow Trail" and install
- Copy the
custom_components/hiking_portalfolder to your Home Assistant'scustom_componentsdirectory - Restart Home Assistant
- Log into your hiking portal at https://helloliam.web.app
- Go to your profile (click your name in the top right)
- Look for your JWT token (or generate a long-lived token)
- Copy the token
- In Home Assistant, go to Settings > Devices & Services
- Click Add Integration
- Search for "The Narrow Trail Hiking Portal"
- Enter the following:
- API URL:
https://backend-4kzqyywlqq-ew.a.run.app(default) - Authentication Token: Your JWT token from Step 1
- API URL:
- Click Submit
Once configured, the following sensors will be available:
sensor.next_hike- Name of your next hikesensor.upcoming_hikes_count- Number of upcoming hikessensor.my_hikes_count- Number of hikes you're interested insensor.pending_users- Number of pending users (admins only)sensor.total_hikes- Total hikes in system
Each sensor has additional attributes with detailed information:
Next Hike Attributes:
hike_id- Unique hike identifierdate- Hike date and timelocation- Hike locationdifficulty- Difficulty leveldistance- Distance in kilometersduration- Duration in hoursprice- Cost in ZARinterested_count- Number of interested peopledescription- Full hike description
type: entities
title: Hiking Portal
entities:
- entity: sensor.next_hike
name: Next Hike
secondary_info: last-changed
- entity: sensor.my_hikes_count
name: My Hikes
- entity: sensor.upcoming_hikes_count
name: Upcoming Hikes
- entity: sensor.pending_users
name: Users Awaiting Approvaltype: custom:mushroom-template-card
primary: "{{ states('sensor.next_hike') }}"
secondary: |
{{ state_attr('sensor.next_hike', 'date') | as_datetime | as_local }}
π {{ state_attr('sensor.next_hike', 'location') }}
π₯ {{ state_attr('sensor.next_hike', 'interested_count') }} interested
icon: mdi:hiking
icon_color: green
tap_action:
action: url
url_path: https://helloliam.web.app/hikes/{{ state_attr('sensor.next_hike', 'hike_id') }}The hiking calendar will appear automatically in Home Assistant's Calendar view:
- Go to Calendar in the sidebar
- You'll see "Hiking Portal Events" with all your hikes
automation:
- alias: "Notify New Hike"
trigger:
- platform: state
entity_id: sensor.upcoming_hikes_count
condition:
- condition: template
value_template: "{{ trigger.to_state.state | int > trigger.from_state.state | int }}"
action:
- service: notify.mobile_app
data:
title: "New Hike Available!"
message: "Check out the latest hike on The Narrow Trail"
#### Reminder 24h Before Hike
```yaml
automation:
- alias: "Hike Reminder"
trigger:
- platform: time
at: "09:00:00"
condition:
- condition: template
value_template: |
{% set hike_date = state_attr('sensor.next_hike', 'date') %}
{% if hike_date %}
{{ (as_timestamp(hike_date) - as_timestamp(now())) < 86400 }}
{% else %}
false
{% endif %}
action:
- service: notify.mobile_app
data:
title: "Hike Tomorrow!"
message: "Don't forget: {{ states('sensor.next_hike') }} tomorrow at {{ state_attr('sensor.next_hike', 'location') }}"
#### Admin Alert for Pending Users
```yaml
automation:
- alias: "Alert Pending Users"
trigger:
- platform: state
entity_id: sensor.pending_users
condition:
- condition: template
value_template: "{{ trigger.to_state.state | int > 0 }}"
action:
- service: notify.admin
data:
title: "Users Awaiting Approval"
message: "{{ states('sensor.pending_users') }} users need approval"- Check your authentication token is valid
- Verify API URL is correct
- Check Home Assistant logs for errors: Settings > System > Logs
- The integration polls the API every 5 minutes
- Force update: Developer Tools > States > Find sensor > Reload
- Or restart Home Assistant
- Make sure you're logged into the portal
- Verify you have hikes you're interested in
- Check the calendar shows "Hiking Portal Events"
- Issues: https://github.com/hiking-portal/homeassistant/issues
- Hiking Portal: https://helloliam.web.app
- Home Assistant Community: https://community.home-assistant.io/
- Initial release
- 5 sensors (Next Hike, Upcoming, My Hikes, Pending Users, Total)
- Calendar integration
- Config flow for easy setup
- Auto-refresh every 5 minutes
MIT License - See LICENSE file for details