Home Assistant
Booking calendars, occupancy sensors, locks in both directions, access events, meter readings and room displays with the Home Assistant integration.
With the inwendo ERP integration for Home Assistant, you control your building according to your bookings in vynst (inwendo ERP): heating on before training, lights off after it ends, door open for the booked group. The integration is open source: github.com/inwendo/iw_erp_homeassistant.
What you get
| Feature | Default | Switch in vynst |
|---|---|---|
| Calendar per room or object, updated instantly via webhook, otherwise every 15 minutes | on | none |
| Locks from vynst as Home Assistant locks | off | none |
| Open locks from Home Assistant in vynst, with vynst’s access rules | off | none |
| Occupancy sensors: occupied, lead time, open, next booking, participants | off | integration_occupancy_api_enabled |
Events iw_erp_access and iw_erp_check_in, sensor “Last access” |
off | integration_ha_access_events_enabled |
Service check_access for card, QR and keypad readers |
none | integration_ha_access_check_enabled |
Service create_ticket, for example for a water alarm |
none | integration_ha_ticket_enabled |
| Meter readings from vynst as sensors, Home Assistant counters reported to vynst | off | integration_usage_counter_api_enabled |
| Room displays on OpenDisplay e-paper signs | off | none |
The switches in vynst are under Settings → Smart home & automation (Einstellungen → Smart Home & Automationen) and are off by default. If a feature is off in vynst, the integration skips it and writes an info line to the log.
Installation
- In Home Assistant, open HACS → Integrations → ⋮ → Custom repositories (HACS → Integrationen → ⋮ → Benutzerdefinierte Repositories).
- Add
https://github.com/inwendo/iw_erp_homeassistantas an Integration, install “inwendo ERP” and restart Home Assistant. - Go to Settings → Devices & services → Add integration → inwendo ERP (Einstellungen → Geräte & Dienste → Integration hinzufügen → inwendo ERP).
- Enter the address of your instance (
https://your-instance.iw-erp.de) and an API token.
Home Assistant 2025.1 or later is required.
API token
Create the token in vynst, in your user settings under API access. It needs these rights:
| Right | Purpose |
|---|---|
Read locations (location) |
read rooms and objects, occupancy, room displays and meters |
Write locations (location) |
report meter readings |
Read and write bookings (event_booking) |
calendar and webhook sign-up |
Write events (event) |
offer locks to vynst, check_access |
| Write tickets | create_ticket |
Also restrict the token to the path /api/homeassistant/.*. The .* at the end is required so that the pattern works as a prefix.
Webhook
During setup, the integration registers a webhook with vynst itself (POST /api/homeassistant/webhook). When a booking changes, vynst sends an update immediately.
- vynst only accepts
https://addresses with a public hostname. Home Assistant therefore needs an external URL (Settings → System → Network, or Home Assistant Cloud). Without one, the integration polls regularly and reports this under Repairs. - vynst sends the token that was passed during registration back as
X-IW-Webhook-Token. Only then do events arrive withverified: true. Checkverifiedbefore an automation does anything security-relevant.
Locks in both directions
Importing locks from vynst: For every lock that the token’s user may open, a lock is created in Home Assistant. Opening goes through vynst, which checks the rights and writes to the lock log.
Offering Home Assistant locks to vynst: You select locks. The integration reports them, and every state change, to vynst. There they appear as a smart lock connection with the name of your Home Assistant. Only after an administrator syncs the devices in vynst and grants rights can anyone open them. Commands from vynst are signed:
- Header
X-IW-Signature: HMAC-SHA256 over the content, with a key that only this installation and vynst know - Commands older than two minutes, or sent twice, are rejected
- Only selected locks are accepted. Locks imported from vynst cannot be offered back.
Examples
Light on with the first check-in in the studio:
triggers:
- trigger: event
event_type: iw_erp_check_in
event_data:
attendance_list_name: Fitnessstudio
checked_in: true
actions:
- action: light.turn_on
target:
entity_id: light.studio
RFID reader checks with vynst and opens the door:
triggers:
- trigger: event
event_type: esphome.rfid_scanned
actions:
- action: iw_erp_homeassistant.check_access
data:
credential: "{{ trigger.event.data.uid }}"
credential_type: card
lock: lock.haupteingang
response_variable: access
- if: "{{ access.granted }}"
then:
- action: lock.open
target:
entity_id: lock.haupteingang
The response contains granted, reason (granted, unknown_credential, no_access, invalid_code, code_expired), person and opened.
Ticket for a water alarm, without duplicates:
actions:
- action: iw_erp_homeassistant.create_ticket
data:
title: Water alarm hall 1
bookable_id: 7
priority: urgent
dedupe_key: water_leak_hall_1
Blueprints
Three ready-made automations work with the calendars only: Preheat room before each booking, Light for booking and Frost protection outside bookings and opening hours. Import them via the link in the README. A room’s lead time comes from its field automation_pre_start_minutes in vynst, otherwise it is 30 minutes.
Room displays
In vynst, under Rooms & resources → Room displays (Räume & Ressourcen → Raum-Displays), create a display of type OpenDisplay. In Home Assistant, you assign an e-paper sign to it. Home Assistant fetches the image from vynst (/api/homeassistant/displays/{id}/frame.png, with ETag), transfers it via Bluetooth and reports the battery level and the last contact back. If the battery is low or the display fails, vynst sends an email to room management.
API
The endpoints under /api/homeassistant/ are listed under Smart home and automation. vynst runs its own contract tests against them so that the integration does not break on updates.