Skip to content

[FEATURE] Support email-based 2FA code in addition to SMS #202

@Glooomster

Description

@Glooomster

Summary

The integration currently only handles SMS_MFA challenge codes.
Hive's SSO (sso.hivehome.com) also supports email-based verification
codes as a fallback, but the email code format differs from the SMS
format (prefixed with "H", e.g. "H123456") and is currently rejected
by the integration's auth flow.

Problem

For users where SMS delivery consistently fails (e.g. Irish mobile
numbers receiving codes from Hive's UK-based SMS infrastructure),
there is no working path to authenticate. The web SSO offers an
email code fallback, but:

  1. The email code format (H + 6 digits) is not accepted by the
    HA integration's 2FA input field
  2. Entering just the 6 digits also fails

This leaves affected users completely locked out of setting up
the integration with no technical workaround available.

Expected behaviour

The integration should accept email-based 2FA codes in addition
to SMS codes, either by:

  • Stripping the "H" prefix and passing the 6 digits, OR
  • Detecting the challenge type from Hive's auth response and
    handling EMAIL_MFA separately from SMS_MFA

Steps to reproduce

  1. Have a Hive account where SMS delivery does not work
  2. Attempt to add the Hive integration in HA
  3. Request email code via Hive SSO
  4. Enter code (with or without "H" prefix) → rejected

Environment

  • HA version: latest
  • Hive Custom Component: latest (HACS)
  • pyhiveapi / apyhiveapi: latest

Additional context

The Hive SSO explicitly supports email 2FA
(sso.hivehome.com/verify shows "resend via email" option).
The pyhiveapi library currently only calls sms_2fa()
an email_2fa() equivalent or a unified code handler
may be needed at the library level too (Pyhass/Pyhiveapi).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions