Skip to content

Control H1270 main/halo elements over IoT instead of the Platform API - #715

Open
danieldubrovski wants to merge 1 commit into
wez:mainfrom
danieldubrovski:h1270-element-toggle
Open

Control H1270 main/halo elements over IoT instead of the Platform API#715
danieldubrovski wants to merge 1 commit into
wez:mainfrom
danieldubrovski:h1270-element-toggle

Conversation

@danieldubrovski

Copy link
Copy Markdown

The H1270 Ceiling Light Ultra has an independently switchable main panel and background halo ring. The Platform API exposes these as mainLightToggle and backgroundLightToggle, but on this device both return code: 200 success and change nothing, and device/state reports an empty string for each — so the switches also sit at unknown state in Home Assistant.

The vendor app drives these elements over IoT with a 0x33 0x30 packet. I found this by decoding the ptReal payloads stored in a Tap-to-Run shortcut — i.e. the app's own serialized command, not guesswork. The same capture shows the device reporting both element states back in a single 0xaa 0x30

packet, whichever element index was queried.

This PR:

  • adds SetElementToggle / NotifyElementState codecs using the existing packet! macro
  • adds device_set_element_toggle, shaped like device_power_on — IoT first, Platform API retained as fallback
  • routes the two toggle instances in mqtt_switch_command through it
  • feeds the status report into Device::element_state and out to the switch entities

That last point closes the existing TODO in CapabilitySwitch::notify_state — Govee does return meaningful state for these instances, just over IoT rather than the Platform API.

Registered for H1270 only rather than Generic:Light, since that's the only SKU I can confirm the layout on.

Verified against a physical H1270

The H1270 Ceiling Light Ultra has an independently switchable main panel
and background halo ring, exposed by the Platform API as the
mainLightToggle and backgroundLightToggle instances. Both of those return
`code: 200 success` and change nothing on the device, and device/state
reports an empty string for each, so the switches also show as unknown in
Home Assistant.

The vendor app drives these elements over IoT with a 0x33 0x30 packet.
That was confirmed by decoding the ptReal payloads stored in a Tap-to-Run
shortcut created in the Govee app, which is the app's own serialized
command; the same capture shows the device reporting both element states
back in a single 0xaa 0x30 packet, whichever element index was queried.

Add codecs for both packets, route the two toggle instances through IoT
with the existing Platform API path kept as a fallback, and feed the
status report into the switch entities. That last part closes the TODO in
CapabilitySwitch::notify_state: Govee does return meaningful state for
these instances, just over IoT rather than the Platform API.

Registered for H1270 only, as that is the only SKU the packet layout has
been confirmed on. Verified against a physical device.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant