Scene controllers such as the Futurehome Modeswitch/Modusbryter (a Z-Wave
device) only ever emit `evt.scene.report` on a button press and never appear
in the periodic Vinculum state poll. Their address therefore never got an
entry in the HA state cache, so live scene events were dropped by the
`if (!payload[addr]) continue` guard in haUpdateStateValueReport, leaving the
"Scene" entity permanently 'unknown'.
- Register an address -> state-topic mapping from the device config so live
events can be routed even when the service is absent from the state poll.
- Seed the cache entry from that mapping when a report arrives for an
otherwise-unknown address.
- Preserve previously known values across state polls so a scene value set by
a live event is not wiped by a later poll that omits the service.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BRMavpbsGAcY2ctkKvcoNR
HA 2026.5 enforces strict validation of device_class/unit_of_measurement
pairs in MQTT discovery payloads. Four categories were broken:
- power_factor: unit was sent as "power_factor" (the FIMP field name); HA
requires the field to be omitted or empty for this device class. Fixed by
normalising the display unit separately from the FIMP data-path key.
- illuminance: unit "Lux" is rejected; normalise to "lx". When a sensor
reports luminance as "%" (some Z-Wave devices), the illuminance device
class is dropped so the entity becomes a generic sensor rather than
triggering a validation error.
- reactive_power (regular/export meter): unit "VAr" is rejected; HA requires
lowercase "var".
- reactive_power (extended meter values, e.g. p_import_react): the unit
determination logic fell through to the generic power branch and sent "W";
reactive power extended values now emit "var", apparent power values emit
"VA", and reactive energy values emit "kvarh".
Fixes#31
Co-authored-by: Claude <noreply@anthropic.com>