Skip to content

openGym 0.12.0

Latest

Choose a tag to compare

@JImmyB0nes JImmyB0nes released this 24 Nov 11:53
· 2 commits to main since this release
d67a489

What's new since 0.11.4

Three new features. No migration, existing entity IDs unchanged; a few entities are added on setup.

New

Event entities

  • event.opengym_workout_finished, event.opengym_personal_record, event.opengym_weigh_in and — on instances with a coach — event.opengym_coach_result.
  • The state is the time of the last event; details (name, volume, sets, duration, records, weight) arrive as attributes.
  • Selectable in the automation editor without YAML. They listen to the same HA events the webhooks and coach results already use, so nothing arrives on a second path.

Training recommendation

  • sensor.opengym_training_recommendation: only recovered muscle groups qualify, using the same recovery model as the muscle card. Of those, the ones furthest below their weekly target and longest untrained come first, and the routine that hits exactly those — without loading the fatigued ones — is picked.
  • State is e.g. "upper back, biceps and calves", rest or free choice; the text attribute holds the full sentence for notifications.
  • Voice: "What should I train today?" / "Was soll ich heute trainieren?"

Coach by voice and service

  • opengym.coach_ask and opengym.coach_debrief return the answer as a response and wait up to wait seconds (default 60).
  • Every result also fires opengym_coach_answer / opengym_coach_debrief, updates event.opengym_coach_result and lands in the logbook.
  • With notify: true, a late answer shows up as a Home Assistant notification.
  • Voice: "Ask the coach whether …" / "Frag den Coach, ob …" and "How was my last workout?" / "Wie war mein letztes Training?" If the answer takes longer than ~25 s, Assist says so and the answer arrives as a notification.
  • New option Coach: evaluate every new workout (off by default, it consumes the coach's daily quota).
  • openGym rejections (busy, daily limit, missing consent) are shown with openGym's own message.
  • Questions started in the openGym app stay there: Home Assistant only fetches and closes answers to its own questions.

Also fixed

  • Muscle groups with a weekly target of 0–0 would still have been recommended.
  • If openGym re-issued a task id, the integration would have returned a stale result.

Testing

  • python -m unittest discover tests: green (new tests/test_v012.py — recommendation, event attributes, coach texts).
  • pytest tests_ha: 33 tests green against a real Home Assistant core, 10 of them new (tests_ha/test_features_012.py): event entities over real webhook calls, instances without a coach, recommendation sensor and voice command, coach question via service including closing the answer, app-originated answers left alone, late answer as notification, rejection (409) and failure, coach by voice, automatic evaluation after a new workout, and the en/de sentences end-to-end through the built-in voice agent.
  • The README test confirms every entity ID named there exists on a fresh install.